TALES of the VALIANT
  1. #1
    Varsuuk's Avatar
    Join Date
    Dec 2015
    Location
    New York
    Posts
    2,104

    Having trouble with expected behavior of relation="current"

    The result of my attempts to stack a control on top of another (I will be adding code that only enables one of them based on character's class) before continuing on to add more controls did not work as planned. Instead both controls appeared side by side:

    Basic template:
    Code:
    	<template name="d6actioncheck">
    		<basicnumber>
    			<frame name="groupbox" offset="7,5,7,5" />
    			<rollable />
    			<hideonvalue value="0" />
    			<anchored to="columnanchor" height="30" width="45">
    				<top anchor="bottom" />
    				<left anchor="right" relation="relative" />
    			</anchored>
                            ...
    TECHNICALLY, the "left" line is: <left anchor="right" postoffset="10" relation="relative" /> but I removed the "postoffset" while troublshooting.

    Template in use, places things in right place but I expected turnundead to cover singforsupprt:
    Things look good except that the

    Anchors definitions:
    Code:
    	<template name="anchor_row">
    		<genericcontrol>
    			<anchored to="contentanchor" position="insidetop" height="0">
    				<top anchor="bottom" />
    				<left anchor="right" />
    			</anchored>
    			<disabled />
    			<invisible />
    		</genericcontrol>
    	</template>
    
    ...
    		<sheetdata>
    			<anchor_content_top name="contentanchor" />
    			<anchor_row name="columnanchor" />
    
    			<!-- First row of Lore/action buttons -->
    ...
    			<!-- Second row of Lore/action buttons -->
    			<anchor_row name="columnanchor2">
    				<anchored>
    					<top anchor="bottom" offset="48" />
    				</anchored>
    			</anchor_row>
    
    			<d6actioncheck name="surprisedon">
    				<anchored to="columnanchor2" />
    				<rollable mergerule="delete" />
    				<targetgenerator>lorecheck</targetgenerator>
    				<description textres="char_surprisedon_tooltip" />
    			</d6actioncheck>
    			<label_fieldtopverticalinset>
    				<anchored to="surprisedon"/>
    				<static textres="char_label_surprisedon" />
    				<tooltip textres="char_surprisedon_tooltip" />
    			</label_fieldtopverticalinset>
    
    			<d6actioncheck name="singforsupper">
    				<anchored to="columnanchor2" />
    				<targetgenerator>secretdoorcheck</targetgenerator>
    				<description textres="char_singforsupper_tooltip" />
    			</d6actioncheck>
    			<label_fieldtopverticalinset>
    				<anchored to="singforsupper" />
    				<static textres="char_label_singforsupper" />
    				<tooltip textres="char_singforsupper_tooltip" />
    			</label_fieldtopverticalinset>
    			<anchored to="columnanchor" height="30" width="45">
    				<top anchor="bottom" />
    				<left anchor="right" postoffset="10" relation="relative" />
    			</anchored> 
    
    			<d6actioncheck name="turnundead">
    				<anchored to="columnanchor2">
    					<left anchor="right" relation="current" offset="0"/>
    				</anchored>
    				<targetgenerator>secretdoorcheck</targetgenerator>
    				<description textres="char_turnundead_tooltip" />
    			</d6actioncheck>
    			<label_fieldtopverticalinset>
    				<anchored to="turnundead" />
    				<static textres="char_label_turnundead" />
    				<tooltip textres="char_turnundead_tooltip" />
    			</label_fieldtopverticalinset>

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    34,074
    Quote Originally Posted by Varsuuk View Post
    Template in use, places things in right place but I expected turnundead to cover singforsupprt:
    Things look good except that the
    I don't know what this is describing. Can you expand on what the issue is - maybe show some screenshots.

    Also make sure that the XML is correct - you have an <anchored> definition between <label_fieldtopverticalinset> and <d6actioncheck name="turnundead">
    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
    Varsuuk's Avatar
    Join Date
    Dec 2015
    Location
    New York
    Posts
    2,104
    Thanks Trenloe I was trying to do 2 things - cleanup my use of anchors to be "Best practices" I ended up where I did after much trial and error and tossing at the wall to see what stuck (ie: gave output I wanted even if the code was terrible)

    The second was I wanted to know how to handle putting multiple controls in same spot and only making one "visibile" when needed - that I suspected used relation="current" but I didnt do something right until restarted (vs reloaded) ruleset. But was moot anyway, didn't need the "current" option just the invisible flagging.

    The "anchored" thing between those controls was a cut and paste error.


    I did get it working a bit back.
    I don't think you will be interested in the detail but I received tips from Dominic and I went in and applied them keeping track of my steps so if I got no where I could ask him for advice.
    Turns out that was enough, what he told me about using the single anchor - from there I figured out to using absolute and explicitly moving myself to the left edge on "carriage return" when I wanted to start a new line then change who the "relative" anchor was.


    Next step tomorrow is looking for and if not, posting to see if anyone has general pointer on how to move an "action" from regular roll to auto-dicetowering. I tried one thing as a hail mary but no love. Will check tomorrow with fresh eyes since spent to much energy on the other thing

    The tower thing isn't important (one can simply drag) but I wanted to make a control always roll in the tower cos it made sense. But again, tomorrow.

    Here is link from where uploaded it in discord: https://cdn.discordapp.com/attachmen...4c3a3c5832d54&

    Again - don't need to look at this, it was just my tracing the fix for the questions I had on anchoring.


    I AM TERRIBLE at UI placements/XML It's "standard" coding I like to do. Stuff like figuring out rolls etc don't frustrate me unlike xml templates and UI work hehe.

Thread Information

Users Browsing this Thread

There are currently 5 users browsing this thread. (0 members and 5 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 Character Create Playlist

Log in

Log in