FG Spreadshirt Swag
  1. #1
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1

    2 Text fields in same ability

    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?


  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    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.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    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:

    Attachment 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...

  4. #4
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    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...

    Attachment 7361

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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Product Walkthrough Playlist

Log in

Log in