PDA

View Full Version : 2 Text fields in same ability



damned
August 30th, 2014, 02:05
Is it possible to have 2 text fields for the same Ability?

top image is how it looks - the bottom is how I would like it to go...

Any suggestions/pointers?

https://www.fg-con.com/wp-content/uploads/2014/08/ability.jpg

Trenloe
August 30th, 2014, 02:37
Sure you can. Add the control information to the <sheetdata> XML in the <windowclass> you use to populate your ability <windowlist>.

Trying to speak Aunglish for you.... ;)

The following all applies to FG control entries that are in the FG XML files.

Your ability list will be defined in a <windowlist> XML specification: https://www.fantasygrounds.com/refdoc/windowlist.xcp This will contain a <class> entry which is the name of the <windowclass> that is used to populate each line in the windowlist (see the <class> entry in the Definition section of the windowlist reference I've just linked).

Your <windowclass> definition (https://www.fantasygrounds.com/refdoc/windowclass.xcp) for the line of data within the list will contain a <sheetdata> entry that is where the controls are defined. You can add another stringcontrol in this sheetdata entry to hold your benefit information - copy/paste the ability control definition, rename it and change the control positioning/which control it is anchored to.

damned
August 30th, 2014, 09:30
so my xml looks like this right now...


<windowclass name="char_ability">
<margins control="0,0,0,2" />
<sheetdata>
<genericcontrol name="rightanchor">
<anchored height="0" width="0">
<top />
<right />
</anchored>
</genericcontrol>
<button_idelete name="idelete">
<anchored>
<top offset="7" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-5" />
</anchored>
</button_idelete>

<button_stringcycler name="attribute">
<anchored width="40">
<top offset="7" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-210" />
</anchored>
<parameters>
<defaultlabelres>dash</defaultlabelres>
<labelsres>I|II|III</labelsres>
<values>I|II|III</values>
</parameters>
</button_stringcycler>


<string_textlistitem name="value" length="100">
<anchored>
<top offset="7" />
<left offset="5" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-8" />
</anchored>
<multilinespacing>20</multilinespacing>
</string_textlistitem>

</sheetdata>
</windowclass>

which gives me something like this:

7362

I tried adding various permutations of another string_textlistitem without any success at getting a second field to display.


<string_textlistitem name="benefitvalue" length="100">
<anchored>
<top offset="7" />
<left offset="5" />
<right parent="rightanchor" anchor="left" relation="relative" offset="188" />
</anchored>
<multilinespacing>20</multilinespacing>
</string_textlistitem>

ok... 1st thing i realised once I stepped away from the computer was my find in files wasnt finding string_textlistitem because that was probably in CoreRPG...

so in CoreRPG I find string_textlistitem in the following files:
\common\template_lists.xml
\campaign\template_char.xml

And they reference some lua files which seem to define movement and tab flow thru the elements and ordering etc..

So... back to the windowclass - these dont seem to be definedin any external doc?
eg looking at <windowclass name="charsheet_abilities"> I cant find charsheet_abilities any where else? not in my ruleset or in CoreRPG.
Same goes for <windowclass name="char_ability">... so Im not following your lead...

Unless it is for sheetdata which I do have corresponding entries under each windowclass...

So back again... to string_textlistitem and I dont know what Im doing wrong! I can add checkboxes and stringcycler but I cant seem to work out what to add for a second string field...

damned
August 30th, 2014, 09:58
I eventually got <string_labeled> to work. but I didnt want a labeled string so I copied <string_labeled> in template_char.xml to <string_nolabel> and removed the <script> stuff and it works... well I believe it is...

7361

Next will be that pesky weapon damage... but not today.
Today I have game to prep for....