5E Product Walkthrough Playlist
  1. #1
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    244

    System list windows

    In the system list windows (I don't know what to call them, I mean the system windows that show the list of Items, Npc, Tables, etc. - could be resource list windows?) is it possible to modify the list shown by adding a column?
    I saw that you can add custom filters, but I need to add information to the list. It can be done? If yes, how?
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  2. #2

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    @Xarxus - are you referring to the grouped list (viewed by pressing a button at the top of the main list window)? Or the main campaign data lists themselves?

    If you're referring to the grouped lists - for example, the Armor or Weapons button at the top of the items campaign data list in 5E (as mentioned by @damned) then look in the ruleset specific /scripts/data_library_<ruleset>.lua file - where the "aListViews" LUA tables define the grouped lists. /scripts/data_library.lua in CoreRPG has some comments at the top of the file that provide information on the fields.

    If you're referring to adding fields to the master campaign data list, then you'll need to extend/override the masterindex_<record name> windowclass as needed. For example, in the PFRPG2 ruleset, I've added two fields to the Item record - refer to the masterindexitem_item windowclass data at the bottom of campaign\record_item.xml in the PFRPG2 ruleset.

    See the screenshot below - I've added the level field (which changes colour based off the item rarity) and the little "A" field that is show if there's automation in the item record.

    Attached Images Attached Images
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  4. #4
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    244
    Yes @Trenloe, the master campaign data list. I need something similar. I need a new column inte Item list.
    I will study masterindex_item, then.

    Ty for the hint!
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  5. #5
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    244
    After researching I made my own masterindex which adds the field I wanted (I needed a column for the level, as the one @Trenloe showed me).
    It works fine, but I have a problem and I don't understand what to do. If I take an Item and move it, it should copy it, but it doesn't. In CoreRPG it works, in my list it doesn't and I don't understand why.
    Do you have any suggestions on what I should study?
    Last edited by Xarxus; December 10th, 2022 at 17:55.
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  6. #6
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    244
    Here is my code
    Code:
        <windowclass name="masterindexitem_item">
            <margins control="0,0,0,2" />
            <script file="campaign/scripts/masterindexitem_window.lua" />
            <sheetdata>
                <hidden_record_isidentified name="isidentified" />
    			
                <masterindexitem_link_id name="link" />
    
                <masterindexitem_anchor_right name="rightanchor" />
                <masterindexitem_idelete name="idelete" />
                <masterindexitem_access name="access" />
                <masterindexitem_modified name="modified" />
                <masterindexitem_category name="category" />
    
                <masterindexitem_level_MY name="level" />
    
                <masterindexitem_name_MY name="name" />
                <masterindexitem_name_MY name="nonid_name" />
            </sheetdata>
        </windowclass>
    
    
    
        <template name="masterindexitem_level_MY">
            <numbercontrol>
                <anchored position="insidetopleft" offset="30,2" height="20" width="30" />
                <font>reference-r</font>
                <nodrag />
                <static />
                <script>
                    function onInit()
                        local nodeItem = window.getDatabaseNode();
                        local nodeItemLevel = DB.getChild(nodeItem, "level");
                        local nodeItemIdentified = DB.getChild(nodeItem, "isidentified");
    
                        nodeItemLevel.onUpdate = updateLevel;	
                        nodeItemIdentified.onUpdate = updateLevel;	
    
                        updateLevel();
                    end
                    function updateLevel()
                        local nodeItem = window.getDatabaseNode();
                        local nodeItemLevel = DB.getChild(nodeItem, "level");
                        local bIsIdentified = DB.getValue(nodeItem, "isidentified");    
    
                        if Session.IsHost or bIsIdentified == 1 then                        
                            self.setValue(nodeItemLevel.getValue());
                        else
                            self.setValue(1);                        
                        end
                    end
                </script>
            </numbercontrol>
        </template>
    
        <template name="masterindexitem_name_MY">
            <masterindexitem_name>
                <anchored position="insidetopleft" offset="65,2" height="20">
                    <right parent="rightanchor" anchor="left" relation="relative" offset="-5" />
                </anchored>
            </masterindexitem_name>
        </template>
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  7. #7
    Has you already looked at "masterindexitem_id", and the fact that you can specify the master index entry window used in the record type registration in LibraryData (see sListDisplayClass in CoreRPG LibraryData script)?

    Regards,
    JPG

  8. #8
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    244
    I debugged all the scripts and figured out the problem when I got to the handleAnyDrop function inside manager_item.lua.
    Basically I used a different tag from item (I was using itemdescription) and this gives problems to the function that doesn't recognize the source type and therefore doesn't know how to determine the target.
    Back to the original item and all goes well now!

    Thanks for your moral support!
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in