FG Spreadshirt Swag
  1. #1
    Minty23185Fresh's Avatar
    Join Date
    Dec 2015
    Location
    Goldstone, CA, USA
    Posts
    1,211
    Blog Entries
    29

    Inserting a Control in Windowclass charsheet_overview

    This post is with respect to release 2022-07.
    There are two sticky threads in this forum that reference 2022-07, so I'm putting my question here.
    I apologize if this is the wrong place for it.
    (I basically never know what questions go here.)

    Release - 2022-07 added the charsheet_overview windowclass to the (5E) character sheet. I suspect this was done to help community developers augment the ruleset functionality that's in place. In an earlier discussion I complained of anchoring issues regarding controls that are directly affected by charsheet_overview.

    In the Development Notes (this Forum) Moon Wizard states that there are "a number of notes" that will help community content developers bring their creations up to speed. Where might those be? (A link please.) Are they simply the list of bullet points in that thread? If so I was hoping for something more substantial.

    At first glance, the changes effected by charsheet_overview might make it possible for multiple developers to handle the anchoring necessary to independently insert their control into the middle of the other controls (at the top of the 5E character sheet).

    From the 5E ruleset, in the charsheet_overview windowclass these controls, using relation relative anchoring, are loaded from right to left:
    Code:
       <genericcontrol name="rightanchor"> .... </genericcontrol>
       <button_charactivate> .... </button_charactivate>
       <token_char name="token"> .... </token_char>
    
       <label_charframetop name="inspirationtitle"> .... </label_charframetop>
       <label_charframetop name="nametitle"> .... </label_charframetop>
    Before I jump down the rabbit hole of my own personal anchoring nightmare, here is my question:
    What is the best way to insert my icon control in between "token" and "inspiration title"?

    To allow the relative anchoring to do its work, it seems to me that I might have to destroy "inspirationtitle" and "nametitle" (and any controls anchored to them). Then load my icon control, followed by reloads of "inspirationtitle" and "nametitle" (and any controls anchored to them).

    Is this about right?

    For those of us duking it out, for this highly-sought-after real estate on the 5E character sheet, it seems to me as though, the relative anchoring will really help us out.

    E.g. if damed's two extensions ("ext1" and "ext2") load his controls first, they'll be anchored between "token" and "inspirationtitle". When my extension gets loaded, after his, since I just breaking the relation relative anchoring chain at "inspirationtitle" it doesn't matter who came before me, or after me, my extension just gets tacked on after his. I don't have to know that his loaded first, nor what their names are.

    I HOPE.
    Current Projects:
    Always...
    Community Contributions:
    Extensions: Bardic Inspiration, Druid Wild Shapes, Local Dice Tower, Library Field Filters
    Tutorial Blog Series: "A Neophyte Tackles (coding) the FG Extension".

  2. #2
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,649
    Blog Entries
    1
    Hi minty

    https://fantasygroundsunity.atlassia...set+-+Layering
    try insertbefore

    Code:
    <windowclass name="effectsmall" merge="join">
      <sheetdata>
        <button_effect_apply name="apply" insertbefore="rightanchor" />
        <button_effect_units name="unit" insertbefore="duration" />
      </sheetdata>
    </windowclass>

  3. #3
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,649
    Blog Entries
    1
    Also I have not yet updated HeroPoints for 5E - just did CoreRPG. Will do 5E soonish...
    Am happy to take your suggestions on anything there...

  4. #4
    Minty23185Fresh's Avatar
    Join Date
    Dec 2015
    Location
    Goldstone, CA, USA
    Posts
    1,211
    Blog Entries
    29
    Quote Originally Posted by damned View Post
    Also I have not yet updated HeroPoints for 5E - just did CoreRPG. Will do 5E soonish...
    Am happy to take your suggestions on anything there...
    Thank you for the vote of confidence. Not too sure it's deserved. I'm almost done with Local Dice Tower for 5E, working on the other rulesets (3.5E, PFRPG and CoreRPG).

    Thanks for the "insertbefore" suggestion. Reduces a lot of script necessary to get the job done.
    It's odd though. It's like it inherits the anchoring from one of the controls, either before or after it, in the relation="relative" chain. No matter what width or offsets I put in my control's anchoring, they seem to be being ignored. (E.g. I set a width to a stupidly large value of 500 and it did nothing.)

    The changes made by Moon Wizard to the character sheet are really helping. Inserting those controls at the top right is much easier. But on the flip side I am having to have ruleset specific .xml files because of control names.

  5. #5
    Minty23185Fresh's Avatar
    Join Date
    Dec 2015
    Location
    Goldstone, CA, USA
    Posts
    1,211
    Blog Entries
    29
    Quote Originally Posted by damned View Post
    Also I have not yet updated HeroPoints for 5E - just did CoreRPG. Will do 5E soonish...
    Am happy to take your suggestions on anything there...
    It's pretty amazing how much the rework of the chararacter sheet by Moon Wizard helps reduce the script necessary for us to add our controls.

    Here's what I have done to add my dice tower forwarding control.
    I'm all but positive that the same script would insert your controls in there too.
    (Since you've already done CoreRPG, I'd bet your additions there are nearly identical to what I provided here.)
    Code:
    	<windowclass name="charsheet_overview" merge="join">
    		<sheetdata merge="join">
    			<genericcontrol name="dicetower_forwarding" insertbefore="inspirationtitle">
    				<anchored to="rightanchor" width="34" height="48">
    					<top offset="1" />
    					<right anchor="left" relation="relative" offset="-3"/>
    				</anchored>
    				<icon>dicetower_icon_5E</icon>
    			</genericcontrol>
    		</sheetdata>
    	</windowclass>
    Last edited by Minty23185Fresh; July 19th, 2022 at 15:45.

  6. #6
    While I know that all these code gyrations can be a little complicated for the extension developers, the goal at the end of the day is to do this exactly. (i.e. make changes need less code going forward)

    Cheers,
    JPG

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