dynamic list, multiple entries, stumped
So, bird's eye view of what I am trying to do... I am using the 5e ruleset as base, specifically the actions tab with weapons. Weapons can have multiple damage dice types set but when you roll them they all roll at once. In AD&D there isn't much call for that but there is a need to have damage differences depending on the size of the creature.
So, my current task is to tweak the existing 5e ruleset actions tab/weapons/damage blocks to list individually so the user can double click (or drag) to perform the action/Damage rolls for a specific set of dice rolls that 5e already allows you to set. So instead of rolling 1d6+3 and 1d4 like 5e uses it will roll one or the other depending on the one double clicked.
Sounds simple but I've been reviewing other parts of the rulesets that do similar tasks but I can't seem to wrap my head around it and get it working. It's probably some anchor part I'm just not getting right... as I've said before layout stuff just really is my bane.
All I see at this point is this tiny blip on the tab (this character has 3 dice groups setup, you can see 3 lines). I can't seem to figure out how to get the view space visible.
https://i.imgur.com/WpeLTM0.png
I've looked over the docs as best I can but I'm a "see an example and then do it" sorta person.
I've created a windowclass (cobbled this together reviewing other similar tasks)
Code:
<windowclass name="split_damage_entries">
<margins control="0,0,0,5" />
<sheetdata>
<genericcontrol name="rightanchor">
<anchored width="0" height="0">
<top offset="2" />
<right />
</anchored>
<invisible />
</genericcontrol>
<stringcontrol name="damageasstring">
<anchored to="rightanchor">
<top anchor="bottom" offset="0" />
<left />
<right />
<bottom parent="" offset="" />
</anchored>
<multilinespacing>20</multilinespacing>
<frame name="fielddark" offset="7,8,7,8" />
<stateframe>
<hover name="rowshade" offset="7,8,7,8" />
</stateframe>
<cursor hover="hand" />
<readonly />
<script>
function onDoubleClick(x,y)
return onDamageActionSingle();
end
function onDragStart(button, x, y, draginfo)
return onDamageActionSingle(draginfo);
end
function onDamageActionSingle(draginfo)
Debug.console("record_char_weapon.xml","onDamageActionSingle","draginfo",draginfo);
end
</script>
</stringcontrol>
</sheetdata>
</windowclass>
And then I replaced the current display xml code for damageview with
Code:
<windowlist name="damage_split_list">
<anchored to="rightanchor" width="91">
<top offset="8" />
<right anchor="left" relation="relative" offset="-5" />
</anchored>
<datasource>.damagelist</datasource>
<class>split_damage_entries</class>
</windowlist>
If you have any suggestions and recommendations please do point them out ;)