-
Yesterday, 03:37 #1
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> ...
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>
-
Yesterday, 04:04 #2Private 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!
-
Yesterday, 07:35 #3
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 4 users browsing this thread. (0 members and 4 guests)
Bookmarks