1 Attachment(s)
[Programming] windowlist within windowlist object
Hey again guys! this one i imagine is fairly simple to answer, it's just a simple syntax thing i'm having trouble with, i'm sure.
so in my ruleset, vehicles have windowlists that hold inventory like a character.
the PC sheets also have a windowlist that can hold vehicles like inventory.
example of what i want to do:
the weapons section of the PC sheets shows weapons from the inventory. instead of seeing weight, we see a field for damage and bonus.
Attachment 29123
so basically what i would like is to have the armaments windowlist on the main page to contain all the armaments within the vehicles windowlist on the inventory page.
i'm sure it's something like what i have below with the setDatabaseNode() function, but i really am not sure how to delve further into the character sheet.
so i want the armaments windowlist from the mainsheet. . . .
Code:
<windowclass name="charsheet_main2" source="charsheet_main2">
<margins control="0,0,0,3" />
<sheetdata>
<windowlist name="armamentslist">
<anchored to="armamentsframe">
<top offset="40" />
<left offset="15" />
<right offset="-10" />
<bottom offset="-15" />
</anchored>
<child></child>
<child><backcolor>1A40301E</backcolor></child>
<datasource>.armamentslist</datasource>
<class>vehicle_armaments</class>
<acceptdrop>
<class>referencetext</class>
<class>referencetextwide</class>
<field>*</field>
</acceptdrop>
<allowdelete />
<script>
function onListChanged()
setDatabaseNode(DB.getPath(node, "*.vehicleinv"));
end
</script>
</windowlist>
. . . to have the same list of items as the vehicles in the list on the record_char_inventory.xml. . .
Code:
<windowlist name="vehiclelist">
<anchored to="vehicleframe">
<top offset="40" />
<left offset="15" />
<right offset="-10" />
<bottom offset="-15" />
</anchored>
<child></child>
<child><backcolor>1A40301E</backcolor></child>
<datasource>.vehiclelist</datasource>
<class>char_vehicle</class>
<acceptdrop>
<class>vehicle</class>
<class>referencetextwide</class>
<field>*</field>
</acceptdrop>
<allowdelete />
</windowlist>
the armaments list in the vehicles windowclass is in the record_vehicle.xml. . .
Code:
<windowlist name="armamentslist">
<anchored height="80">
<top parent="columnanchor" anchor="bottom" relation="relative" offset="10" />
<left offset="90" />
<right offset="-10" />
</anchored>
<frame>fielddark</frame>
<child></child>
<child><backcolor>1A40301E</backcolor></child>
<datasource>.vehicleinv</datasource>
<class>vehicle_armaments</class>
<acceptdrop>
<class>referencetext</class>
<class>referencetextwide</class>
<field>*</field>
</acceptdrop>
<allowdelete />
</windowlist>