DICE PACKS BUNDLE
  1. #1
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    268

    personalized table locked

    Hey guys, I'm back after a bit of a break with one of my problems, hoping you all can
    help me out. I need to show different tables from the ones CoreRPG usually displays.
    To do this, I wrote the code below in my datalibrary.lua.The getTableRecordDisplayClass
    function returns the correct class name to use for opening the table, and it works fine
    with both the traditional tables and my custom ruleset tables.

    However, I'm having an issue with the custom table window. It opens correctly, but
    it's locked by default and doesn't change when I click the lock.

    I can't figure out why.

    Code:
    ["table"] = {
    		bExport = true,                                                                     
    		aDataMap = { "tables", "reference.tables", "tabledata", "reference.tabledata" },    
    		aRecordDisplayClasses = {"table"},                                                  
    		aGMEditButtons = { "button_add_table_guided", "button_add_table_import_text" },     
    		sListDisplayClass = "masterindexitem_tables",                                       
    		fRecordDisplayClass = getTableRecordDisplayClass,                                   
    		aCustomFilters = {
    			["Table type"] = { sField = "tabletype", fGetValue = getTableTypeValue },       
    		}
    	},
    Code:
        <windowclass name="class_mytable" copy="record_window">
            <placement>
                <size width="470" height="550" />
            </placement>
            <sizelimits>
                <minimum width="470" height="550" />
                <maximum width="470" height="550" />
            </sizelimits>
            <softclose />
        </windowclass>
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  2. #2
    You'll need to override the "table" windowclass, rather than trying to force it in through the display class in the LibraryData which will only change the call for tables opened from the main campaign list.

    Regards,
    JPG

  3. #3
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    268
    First off, thanks a lot.

    Now, let's get to what I've done. I reverted the definition in the datalibrary.lua file
    to a version very close to the original. I'm not using the exact same version because
    I want to define custom table types to handle the specifics of my system.
    Here's the code I used:
    Code:
        ["table"] = { 
            aDataMap = { "tables", "reference.tables", "tabledata", "reference.tabledata" },   
            aGMEditButtons = { "button_add_table_guided", "button_add_table_import_text" },
            sListDisplayClass = "masterindexitem_tables",                                       
            tOptions = {
                bExport = true,
            },
            aCustomFilters = {
                ["Table type"] = { sField = "tabletype", fGetValue = getTableTypeValue },
            }
        },
    At this point, to manage the table type, I created a new window class called
    masterindexitem_tables, so it shows an extra column with my type. I'll show the
    code for that below as well.
    Code:
        <windowclass name="masterindexitem_tables">
            <margins control="0,0,0,2" />
            <script file="campaign/scripts/masterindexitem_window.lua" />
            <sheetdata>
                <anchor_listitem_left_sm name="leftanchor" />
                <anchor_listitem_right_sm name="rightanchor" />
    
                <linkc_listitem_left name="link" />
    
                <button_masterindexitem_idelete name="idelete" />
                <button_masterindexitem_access name="access" />
                <button_masterindexitem_modified name="modified" />
                <stringc_masterindexitem_category name="category" />
    
                <masterindexitem_tabletype name="tabletype" />
    
                <string_listitem_center_noframe_static_linked name="name" />
    
            </sheetdata>
        </windowclass>
    Everything works great, but now I'd like to intercept the event of creating a new
    table so I can insert something that allows me to indicate what type of table to
    create (traditional or custom).

    The masterindexitem_tables only handles the list. How do I intercept the creation?
    Which class should I redefine? Keep in mind that I don't want to do this for all lists
    (Encounters, Images, Items, etc.), but only for Tables.
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  4. #4
    Why can't you just override the "table" class to have a "type" field (combo box) that swaps out the "content" area with the data you want to show?
    This is how Item records handle changes based on Type field.

    Then, you only need to override the table class; and not even monkey with LibraryData script at all.

    Regards,
    JPG

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
  •  
GI JOE RPG Launch

Log in

Log in