PDA

View Full Version : Ruleset ignoring XML parameters



Archmage
April 2nd, 2008, 17:35
I'm trying to make a mini-sheet, and so far everything has worked well, except for this one bug which seems to be entirely arbitrary. I've created a basic frame, and set its bounds in relation to the minisheet. To that frame, I've anchored a modifier number.

For some unknown reason, FG is ignoring the <height></height> parameter for that number's frame. It accepts the width, but not the height. And it only does this when I anchor the number control to that generic frame. I have checked, rechecked, and triple checked my XML syntax. I'm pretty sure the problem is not there, but I have no idea where else it could be, because there are no scripts linked to these elements.

When I run the code, I get a console error that says "Ruleset Warning: Anchored control static height ignored" (in orange text if that matters).

Here's the code. The element being ignored is in bold. Any help would be appreciated.


...
<sheetdata>
<labeledstring name="name">
<bounds>15,25,120,20</bounds>
<label>name</label>
<static />
</labeledstring>


<genericcontrol name="combatframe">
<bounds>10,50,275,121</bounds>
<!--
<frame>
<name>modifier</name>
</frame>
-->

</genericcontrol>

<genericcontrol name="initiativeframe">
<bounds>125,15,100,30</bounds>
<frame>
<name>modifier</name>
<offset>5,5,5,5</offset>
</frame>

</genericcontrol>

<ministaticmod name="initiative" source="initiative.total">
<description>
<text>Initiative</text>
</description>
<anchored>
<to>initiativeframe</to>
<position>insideright</position>
<offset>3,5</offset>
<size>
<width>30</width>
<height>20</height>
</size>
</anchored>

</ministaticmod>
<stringcontrol>
<anchored>
<to>initiative</to>
<position>left</position>
<offset>5,-3</offset>
</anchored>
<static>Initiative</static>
<font>sheetlabel</font>
</stringcontrol>

...

<ministaticmod> is a template I made for this, which is basically just a linked number with <readonly/>, and a couple other preset paramaters.

Oberoten
April 2nd, 2008, 17:59
Should the size controls be within the anchored tags?

** edit **
Please ignore. I was having a blond moment.

Toadwart
April 2nd, 2008, 19:33
The template doesn't include <anchored> and/or the inner <size> node does it?
It could be a problem with the merge rules. If it does include those nodes try using the replace mergerule in the template (i.e. <anchored mergerule="replace">)

Archmage
April 2nd, 2008, 20:02
I think I might have figured it out. It seems like all the center point anchors ignore one size parameter. Anchoring to a corner rather than "insideright" makes it consider the height parameter again. All the center point anchors seem to want an offset for at least one of their size parameters.

Toadwart
April 3rd, 2008, 19:24
Ah yes. I invariably fall back to using the more simple form:


<anchored>
<left>
<parent>label</parent>
<anchor>right</anchor>
</left>
<top>
<anchor>top</anchor>
<offset>5</offset>
</top>
<size>
<width>30</width>
<height>22</height>
</size>
</anchored>

You can achieve the same placement/sizing with either method but it's more obvious to me when it's done this way.