PDA

View Full Version : Issue with placement using createWindow



feldrol
February 21st, 2016, 21:14
Hello,
I am currently re-using some existing rulesets to create one for my group. Basically, I am stuck with the script that allow to use the radial menu to create boxes for HP (Exalted ruleset style).

So, I have this windowlist :



<windowlist name="wounds0list">
<anchored>
<to>shayo_sante</to>
<position>insidetopleft</position>
<offset>80,25</offset>
<size>
<width>120</width>
<height>20</height>
</size>
</anchored>
<class>element_healthbox</class>
<datasource>.wounds0</datasource>
<script file="scripts/healthbox_menu.lua" />
</windowlist>


The class definition is :

<windowclass name="element_healthbox">
<sizelimits>
<minimum>
<height>15</height>
</minimum>
</sizelimits>
<sheetdata>
<healthbox name="healthlevel">
<anchored>
<left>
<anchor>left</anchor>
</left>
<top>
<anchor>top</anchor>
</top>
<size>
<width>15</width>
<height>15</height>
</size>
</anchored>
</healthbox>
</sheetdata>
</windowclass>

The part of the healthbox_menu.lua script that create a new box is


window.wounds0list.createWindow();


All is fine except the new HP box is created below the previous one, while I want it to go on the right of the previous one.
Am I missing something really obvious ?

damned
February 21st, 2016, 22:35
have you thought about just adding all the HP boxes to the char sheet statically?

feldrol
February 22nd, 2016, 19:22
Yes but since the number of boxes depends on the attributes of the character, it would be more neat to allow each character to customize the number of boxes.

feldrol
February 24th, 2016, 21:02
I have found the solution. It was easy, well at least when you know the solution.
In the windowlist paragraph, I inserted this :


<columns >
<width > 15 </width>
<fillwidth />
</columns>

The <fillwidth /> instruction does exactly what I wanted, that is tells to insert new boxes right of the first one and not down.

I also saw that the core fate ruleset has another solution for that, which is to hide/unhide the boxes depending on a number that is inputed by the player.

damned
February 24th, 2016, 22:05
Nice find. Keep it up!