PDA

View Full Version : Need some help with reference_list windowclass.



kelebros
January 5th, 2018, 01:53
Ok, so my goal is to have a setup in the Library that mimics that way the the 5E PHB and SRD show the Equipment.
Namely, when the Equipment link is clicked in the right hand window of the library a (presumably reference_list) window pops up with links to the equipment types (e.g. Armor, Weapons, etc.) Those links further open other windows with the equipment type. I've been able to create a link to a reference_list of items successfully, that seems intuitive with regards to the needed <displayclass> and <source> tags needed for the reference_list windowclass. What I'm struggling with is getting a list of links into the reference_list window. Below is what I've got so far, I've been trying different values for the <displayclass> tag, but haven't managed to find the right one yet. Any assistance is appreciated.

Thanks,
Kel


<snip>
<library static="true">
<hb5e static="true">
<categoryname type="string">Core Rules</categoryname>
<name type="string">hb5e</name>
<entries>
<item>
<librarylink type="windowreference">
<class>reference_list</class>
<recordname>..</recordname>
</librarylink>
<name type="string">Equipment</name>
<source type="string">lists.equipment_types@HB-5E</source>
<displayclass type="string">reference_list_item</displayclass>
</item>
</snip>
<snip>
<lists>
<equipment_types>
<name type="string">Equipment</name>
<index>
<id-00001>
<listlink type="windowreference">
<class>reference_mountsandotheranimalstable</class>
<recordname>reference.equipmentdata.id-00005@HB-5E</recordname>
</listlink>
<name type="string">Mounts and Other Animals</name>
</id-00001>
</index>
</equipment_types>
</snip>


This gets me this behavior (before click):
21872

After click:
21873

Talyn
January 5th, 2018, 02:33
The 'reference_list' class simply presents a generic list window, the same as 'referenceindex' just easier to work with. The 5E-specific equipment window(s) use the 'reference_adventuringgeartable' class, and the corresponding list data goes in reference.equipmentlists.adventuringgeartable (if you wish to mimic SmiteWorks' data paths anyway).

I think the SRD should have sample markup to build the equipment list using that class.

kelebros
January 5th, 2018, 02:35
Thanks for the reply, Talyn. I couldn't find any sample markup from the SRD as it is password protected. But I'll see if I can't look at the reference_adventuringgeartable class.

Moon Wizard
January 5th, 2018, 02:53
Since v3.3.2, you could use reference_list for a simple list, single column list; and reference_groupedlist for a single layer collapsible list with one or more columns. You needed to define all the fields to define the list. You had to peruse the lua code in the CoreRPG ruleset to see how to define the lists.

With v3.3.4, this will be a lot easier. The ruleset can pre-define specific views by record type. The specific views available depend on the record type and ruleset. This version is currently available in the Test channel.

For 5E,
the "npc" record type has the following views: byletter, bycr, bytype
the "item" record type has the following views: armor, weapon, vehicledrawn, vehiclemount, vehiclewater

To use a reference_groupedlist view, you can do it like this:

<armor>
<recordtype type="string">item</recordtype>
<source type="string">reference.armor</source>
<listview type="string">armor</listview>
</armor>

If you leave out the "source" tag, then all records of that type in the module will be displayed. Otherwise, only the ones in the specific path are displayed.

For a reference_list view, you can define like this:

<feats>
<name type="string">Feats</name>
<recordtype type="string">feat</recordtype>
</feats>

Regards,
JPG

Talyn
January 5th, 2018, 02:59
Thanks JPG!

Also @kelebros, check this module (https://www.fantasygrounds.com/forums/showthread.php?36157-5e-Asset-Templates) that Nickademus made, it has samples of what you're looking for (minus the new CoreRPG classes JPG has given us the past two updates).

kelebros
January 5th, 2018, 03:18
Talyn, that was exactly what I was looking for! You rock!

JPG, thanks for the heads up on the new features coming, and the examples for the reference_list.