PDA

View Full Version : Sidebar buttons



Xarxus
March 2nd, 2023, 00:24
Regarding the Sidebar, I'm trying to figure out how to remove a button provided by CoreRPG (vehicle
for example). I suppose it should be set to nil, but it's not clear to me how to do it.

Also I don't quite understand how to choose in which category a new button should be.

damned
March 2nd, 2023, 00:41
LibraryData.setRecordTypeInfo("vehicle", nil);

Trenloe
March 2nd, 2023, 09:01
Also I don't quite understand how to choose in which category a new button should be.

Set the sSidebarCategory variable in the library data record. For example:


["trait"] = {
bExport = true,
aDataMap = { "trait", "reference.traits" },
sListDisplayClass = "masterindexitem_trait",
sRecordDisplayClass = "reference_trait",
sSidebarCategory = "campaign";
aCustomFilters = {
["Type"] = { sField = "traittype" },
},
},

The defaults are set in CoreRPG scripts\manager_desktop.lua in the _tDefaultRecordTypeCategories table.

Xarxus
March 2nd, 2023, 11:20
Ty both!

Xarxus
March 2nd, 2023, 11:43
Looking for vehicle in CoreRPG I found the declaration in data_library.lua. As far as I can see,
there is no sSidebarCategory declared for it, so I looked for it in manager_desktop.lua,
but it's not even there.

Where does CoreRPG define where vehicle is positioned in the Sidebar? Or how does it?

Trenloe
March 2nd, 2023, 12:26
The default is "campaign" if there's no sSidebarCategory or no default listed in the _tDefaultRecordTypeCategories table in CoreRPG scripts\manager_desktop.lua

This is set with the following code in manager_desktop.lua:


local sRecordCategory = tRecordTypeInfo.sSidebarCategory or DesktopManager.getSidebarDefaultCategoryByRecordTy pe(sRecordType);

Xarxus
March 2nd, 2023, 18:53
Ty again!