STAR TREK 2d20
  1. #1
    Minty23185Fresh's Avatar
    Join Date
    Dec 2015
    Location
    Goldstone, CA, USA
    Posts
    1,211
    Blog Entries
    29

    My Bane - Merging and Anchoring (Please help with inserting a control)

    After every project I pat myself on the back and say, "Finally I have this anchoring and template merging down pat!" Then a year goes by and I try to do something slightly different and my nemeses come back in spades!

    I love screenshots, so here there are:
    First, in this one there are two panels, a view of the default behavior of the CoreRPG Encounter dialog on the left, and on the right, a view of the desired behavior: an additional control has been added, as shown in the red box.
    Untitled1.png

    I have been testing feasibility by hacking the CoreRPG ruleset to get the desired view. Now it is time to extract the functionality into an extension with the least possible footprint of duplicate script. I have a working extension but only by duplicating the entire <windowclass> that houses my added control. I need to eliminate most of that duplicate xml script.

    And in this screenshot some details (for those unfamiliar with the makeup of the Encounter dialog in the CoreRPG): The dialog is essentially a list of encounter items, each made up of a handful of controls. The "token" and "count" controls are anchored to a "left anchor". And the "link", "faction" and "id'ed" controls are anchored to a "right anchor". The "name" field in the middle is anchored on its left side to the "left anchor" and on its right side to the "right anchor". Anchoring in this manor causes the name control to shorten and lengthen as the user horizontally resizes the dialog. Following the existing pattern my control is anchored on it's right side to the right anchor.
    Untitled2.png

    I started eliminating code with various attempts at changing the anchoring of the various controls anchored to the right anchor, with little success (typically at the cost of the name field's height property).

    It seems to me, that this scenario, inserting an additional control in between a bunch of ruleset controls, has to have been repeated hundreds of times given the multitude of community developers out there. As such, it also seems to me, that there must be a simple "merge" and/or "mergerule" combination that will give me the desired outcome. But after trying a barrage of combinations I have yet to ascertain what the secret combo is.

    Any help would be greatly appreciated
    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
    I would start with something like this:

    Code:
    	<windowclass name="battle_npc" merge="join">
    		<sheetdata>
    			<button_record_eye name="eye" insertbefore="name" />
    		</sheetdata>
    	</windowclass>
    Regards,
    JPG

  3. #3
    Minty23185Fresh's Avatar
    Join Date
    Dec 2015
    Location
    Goldstone, CA, USA
    Posts
    1,211
    Blog Entries
    29
    Aargh! Moon Wizard, thank you, “insertbefore” is so blatant. I knew the obvious was right under my nose.

    Follow up. I’ve used merge=“join” before, a few times now. It is not in the Developers Guide documentation pages. (Advanced Merging). Is it the same as merge=“merge”?

  4. #4
    Yes, they are equivalent.

    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
  •  
DICE PACKS BUNDLE

Log in

Log in