-
May 19th, 2018, 15:48 #1
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
Reassigning Anchors to new elements in Extension
I am trying to modify and create an extension where I want to move some fields by attaching them to a new field I've created. However, when I add the anchor tags in my extension for an existing field like the following where curhp is a new text field
Code:<number_curhp name="curhp"> <anchored to="healthtitle" width="40" height="30"> <top anchor="bottom" offset="15" /> <right anchor="center" offset="-70" /> </anchored> <font>reference-b-large</font> <description textres="char_tooltip_hpcurrent" /> <min value="0" /> <script> function onValueChanged() window.onHealthChanged(); end </script> </number_curhp> <label_charfieldtop name="label_curhp"> <anchored to="curhp" offset="0,15" /> <static textres="char_label_hpcurrent" /> </label_charfieldtop> <number_dropadd name="hp"> <anchored to="curhp" position="righthigh" offset="15,0" width="40" height="30"/> </number_dropadd>
Code:Ruleset Error: window: Control (hp) anchoring to uncalculated control (curhp) in windowclass (charsheet_main) Ruleset Error: window: Control (hp) anchoring to uncalculated control (curhp) in windowclass (charsheet_main) Ruleset Error: window: Control (hp) anchoring to uncalculated control (curhp) in windowclass (charsheet_main) Ruleset Error: window: Control (hp) anchoring to uncalculated control (curhp) in windowclass (charsheet_main)
-
May 19th, 2018, 16:32 #2
if you remove your hp code does the rest of it anchor properly?
Can you add a Debug.console() to the hpcur script in an oninit and see if it is executing before the hp anchor warnings.
--
For the other - request from the devs to name the object.
In the meantime you will need to copy the whole windowclass if the element is not named.
-
May 19th, 2018, 17:09 #3
The XML tag <number_curhp> control needs to be the name of a valid FG control or control template.
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!
-
May 19th, 2018, 17:28 #4
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
I have a control template for for number_curhp based off from number_chartotal
I've added the debug script to both elements, it looks like the hp element is loading before the curhp element, even though I'm changing the anchors in my Extension after the curhp element has been created.
Code:Ruleset Error: window: Control (hp) anchoring to uncalculated control (curhp) in windowclass (charsheet_main) Ruleset Error: window: Control (hp) anchoring to uncalculated control (curhp) in windowclass (charsheet_main) Runtime Notice: s'hp is loaded' Runtime Notice: s'curhp is loaded' Ruleset Error: window: Control (hp) anchoring to uncalculated control (curhp) in windowclass (charsheet_main) Ruleset Error: window: Control (hp) anchoring to uncalculated control (curhp) in windowclass (charsheet_main)
-
May 19th, 2018, 17:30 #5
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
I'm wondering if I could run an onInit script in the curhp element to change the anchors there.
-
May 19th, 2018, 17:30 #6
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
Also, any thoughts how to move this unnamed element from the record_char_main.xml?
<label>
<anchored to="wounds" position="lefthigh" offset="15,5" />
<static textres="hp" />
</label>
-
May 19th, 2018, 17:42 #7Private 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!
-
May 19th, 2018, 17:46 #8Private 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!
-
May 20th, 2018, 01:11 #9
-
May 20th, 2018, 01:17 #10
- Join Date
- Jan 2015
- Location
- Grand Rapids, MI
- Posts
- 136
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks