PDA

View Full Version : Help with Merge and Character Sheets



damned
March 3rd, 2016, 01:34
I want to make a modification to the record_char.xml file.
Id like to shorten the Name field and frame and add another frame in between name and portrait.
Thats all straight forward if I copy the whole record_char.xml into my extension but Id like to just try to merge my changes in.
This will make the extension usable in more rulesets and also make it far easier to maintain as rulesets may change these files in other ways over time.

So far I havent been able to nut out where to put the merge tag and the right options to use.
Any pointers?

;)

Moon Wizard
March 3rd, 2016, 18:31
Here's an example that shortens the overview frame in the charsheet windowclass by 40 pixels on the right side.



<windowclass name="charsheet" merge="join">
<sheetdata>
<frame_char name="overviewframe">
<bounds>15,20,-180,45</bounds>
</frame_char>
</sheetdata>
</windowclass>


Hopefully, this should give you a starting point.

Once you define a windowclass definition as merge=join, it will try to combine the original definition with this one. When it gets to the sheetdata, it will specifically try to match controls with the same template and name combination and merge those too.

Regards,
JPG

Skellan
March 4th, 2016, 00:30
Dead interesting. I have been geeking out over fonts and it would be really handy to be able to nudge the frame sizes a bit. Does merge basically mean that it just changes the part that is different (in moon wizars's example, -140 to -180) and so it will be less likely to break if there are changes to the original?

Moon Wizard
March 4th, 2016, 01:12
It's based on the XML tags merging or replacing each other. The merge attribute can also be used to "join"/"merge", "delete", "replace", "resetandadd", and "add".

In the example above, since I provided a new value for the bounds tag, it overrides the original bounds tag when they're merged.

Regards,
JPG

Skellan
March 4th, 2016, 01:48
Got you. Cool thanks. I'll play around with it

damned
March 4th, 2016, 12:38
Thank you Moon Wizard that worked perfectly.