PDA

View Full Version : aListViews



MadBeardMan
April 25th, 2018, 00:14
Morning All (midnight + 10 mins here),

Been adding Vehicles to the Traveller ruleset, got that all done nicely.

However there is a lovely 'Vehicles by Type' button on the Vehicles frame.

That too is ace, but the columns need changing.

So I found the:


aListViews = {
["vehicle"] = {
["bytype"] = {
sTitleRes = "vehicle_grouped_title_bytype",
aColumns = {
{ sName = "name", sType = "string", sHeadingRes = "vehicle_grouped_label_name", nWidth=200 },
{ sName = "tl", sType = "number", sHeadingRes = "vehicle_grouped_label_tl", sTooltipRes="vehicle_grouped_tooltip_tl", bCentered=true },
{ sName = "speed", sType = "string", sHeadingRes = "vehicle_grouped_label_speed", sTooltipRes="vehicle_grouped_tooltip_speed", nWidth=100, bCentered=true },
{ sName = "cost", sType = "string", sHeadingRes = "vehicle_grouped_label_cost", nWidth=80, bCentered=true },
},
aFilters = {},
aGroups = { { sDBField = "type" } },
aGroupValueOrder = {},
},
},
};

Which is also ace, but the aListViews is not being picked up, it's using the CoreRPG default values.

How do I go about telling the ruleset to use my version?

This is the last piece I need to solve, so any help would be greatly received.

Cheers,
MBM

Ken L
April 25th, 2018, 01:07
From personal experience, you need to override the xml template that invokes the script to load your version.

Moon Wizard
April 25th, 2018, 06:07
Look at 3.5E ruleset in the scripts/data_library_35E.lua file. The file contains custom list views for 3.5E, and the onInit function calls LibraryData.setListView which is used to add/overwrite the existing views.

If you want to remove an existing view, use LibraryData.setListView(kRecordType, kListView, nil)

Regards,
JPG

MadBeardMan
April 25th, 2018, 08:30
From personal experience, you need to override the xml template that invokes the script to load your version.

Thanks for the response. I did try overriding the loading scripts - but had no joy.


Look at 3.5E ruleset in the scripts/data_library_35E.lua file. The file contains custom list views for 3.5E, and the onInit function calls LibraryData.setListView which is used to add/overwrite the existing views.

If you want to remove an existing view, use LibraryData.setListView(kRecordType, kListView, nil)

Regards,
JPG

Morning Chap, thanks for that, I will do exactly that.

Edit: Worked nicely, cheers! :


for kRecordType,vRecordListViews in pairs(aListViews) do
for kListView, vListView in pairs(vRecordListViews) do
LibraryData.setListView(kRecordType, kListView, vListView);
end
end


Cheers
Col