FG Spreadshirt Swag
  1. #1
    Valarian's Avatar
    Join Date
    Mar 2007
    Location
    Worcestershire, UK
    Posts
    2,567

    How to influence new sidebar categories and icons

    I'm currently creating a new unofficial ruleset for the Dune roleplaying game. I've added three new reference data categories for the ruleset in the scripts/data_library_dune.lua file and called the LibraryData.overrideRecordTypes function.

    Code:
    aRecordOverrides = {
        -- CoreRPG overrides
    
    
      -- New record types
        ["talent"] = {
            bExport = true, 
            aDataMap = { "talent", "reference.talents" }, 
            sRecordDisplayClass = "reference_talent", 
        },
        ["concept"] = {
            bExport = true, 
            aDataMap = { "concept", "reference.concepts" }, 
            sRecordDisplayClass = "reference_concept", 
        },
        ["archetype"] = {
            bExport = true, 
            aDataMap = { "archetype", "reference.archetypes" }, 
            sRecordDisplayClass = "reference_archetype", 
        },
    };
    
    
    function onInit()
        LibraryData.overrideRecordTypes(aRecordOverrides);
    end
    Two of the new reference types appear under the Character category. The other appears under the Campaign category.

    Ideally, I want to have all of the new reference types under the Character sidebar category. Is there a way to influence this in the data?
    While the default icons are okay, is there a way to set the sidebar icon to use? Where are the sidebar icons located?
    Attached Images Attached Images
    Using Ultimate license - that means anyone can play.
    Valarian's Fantasy Grounds Rulesets

  2. #2
    Valarian's Avatar
    Join Date
    Mar 2007
    Location
    Worcestershire, UK
    Posts
    2,567
    Answered in part on the Discord #ruleset_wizard channel.

    The local table _tDefaultRecordTypeCategories (CoreRPG) sets the categories other than campaign. The table is in the DesktopManager (manager_desktop.lua) class.

    There's a reference to CampaignRegistry.sidebarexpand in the loadSidebarCategoryState function, but there doesn't currently seem to be a way to register an entry to the _tSidebarCategoriesExpanded table.

    Workaround at the moment is to use one of the pre-registered values for the Concept/Faction information.
    Code:
    aRecordOverrides = {
        -- CoreRPG overrides
    
    
      -- New record types
        ["talent"] = {
            bExport = true, 
            aDataMap = { "talent", "reference.talents" }, 
            sRecordDisplayClass = "reference_talent", 
        },
        ["background"] = {
            bExport = true, 
            aDataMap = { "faction", "reference.factions" }, 
            sRecordDisplayClass = "reference_faction", 
        },
        ["archetype"] = {
            bExport = true, 
            aDataMap = { "archetype", "reference.archetypes" }, 
            sRecordDisplayClass = "reference_archetype", 
        },
    };
    
    
    function onInit()
        LibraryData.overrideRecordTypes(aRecordOverrides);
    end
    Using Ultimate license - that means anyone can play.
    Valarian's Fantasy Grounds Rulesets

  3. #3
    For a unique category, Just add a unique .sSidebarCategory value to a record; and a new category will be created automatically below the others. You’ll also need to define the string resource for the label.

    I would recommend adding those to the “create” category, as that already exists in other rulesets and creates consistency.

    Regards,
    JPG

  4. #4
    Valarian's Avatar
    Join Date
    Mar 2007
    Location
    Worcestershire, UK
    Posts
    2,567
    Thanks. That's got it.
    Code:
    	["talent"] = {
    		bExport = true, 
    		aDataMap = { "talent", "reference.talents" }, 
    		sRecordDisplayClass = "reference_talent", 
    		sSidebarCategory = "create", 
    	},
    	["faction"] = {
    		bExport = true, 
    		aDataMap = { "faction", "reference.factions" }, 
    		sRecordDisplayClass = "reference_faction", 
    		sSidebarCategory = "create", 
    	},
    	["archetype"] = {
    		bExport = true, 
    		aDataMap = { "archetype", "reference.archetypes" }, 
    		sRecordDisplayClass = "reference_archetype", 
    		sSidebarCategory = "create", 
    	},
    };
    
    
    function onInit()
    	LibraryData.overrideRecordTypes(aRecordOverrides);
    end
    Attached Images Attached Images
    Using Ultimate license - that means anyone can play.
    Valarian's Fantasy Grounds Rulesets

  5. #5
    Great. Glad you got it working.

    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
  •  
DICE PACKS BUNDLE

Log in

Log in