-
January 1st, 2022, 15:17 #1
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
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?Using Ultimate license - that means anyone can play.
Valarian's Fantasy Grounds Rulesets
-
January 1st, 2022, 17:37 #2
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
-
January 1st, 2022, 19:23 #3
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,541
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
-
January 1st, 2022, 21:42 #4
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
Using Ultimate license - that means anyone can play.
Valarian's Fantasy Grounds Rulesets
-
January 1st, 2022, 21:43 #5
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,541
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