PDA

View Full Version : Combat Tracker and visibility



celestian
May 27th, 2018, 08:42
I've written a block into the combat tab that shows on both the npc/pc sheets and the CT for npcs. The problem is it doesn't show up the same as on the npc record. Here you can see the Aarakocra in the CT and then a npc record (from the shortcut in the CT). You'll note the combat section is empty in the CT but not in the NPC record. I can add and remove those line entries (for notes on special combat information) and the CT expands and shrinks as needed but doesn't show the lines nor the shortcut buttons.

They use the same xml/code for both other than placement. I've since created a copy on the mini_combat and called in mini_combat_ct to play around with something....

https://i.imgur.com/uziA1JU.png

I think it might be something to do with the window placement in the CT and it's actually just really narrow or something and I can't see it?

This is the XML for the subwindow and title.



<!-- combat mini bar -->
<label_charframetop name="minicombattitle">
<anchored height="20">
<top parent="columnanchor" anchor="bottom" relation="relative" offset="15" />
<left offset="15" />
<right offset="-10" />
</anchored>
<icons>char_abilities</icons>
<static textres="char_label_combat" />
</label_charframetop>
<button_iedit name="abilitynotes_iedit">
<anchored to="minicombattitle" position="insidetopright" offset="5,0" />
<script>
function onValueChanged()
local bEditMode = (getValue() == 1);
window.abilitynotes_iadd.setVisible(bEditMode);
window.mini_combat_window.subwindow.abilitynotes.u pdate();
end
</script>
</button_iedit>
<button_iadd_abilitynotes name="abilitynotes_iadd">
<anchored to="abilitynotes_iedit" position="insidetopleft" offset="-25,0" />
<target>abilitynotes</target>
</button_iadd_abilitynotes>

<subwindow name="mini_combat_window">
<anchored to="columnanchor">
<top anchor="bottom" relation="relative" offset="2" />
<left offset="15" />
<right offset="-10" />
</anchored>
<class>combat_mini_section_ct</class>
<activate />
<fastinit />
</subwindow>
<!-- combat mini end -->



Is it the way I placed the subwindow? I've been futzing with this for a while and I just can't see it (almost 3am) so going to sleep on it... but hoping someone has a clue on where the error could be.

Trenloe
May 27th, 2018, 19:29
<anchored to="columnanchor">
<top anchor="bottom" relation="relative" offset="2" />
<left offset="15" />
<right offset="-10" />
</anchored>
All of the offsets are related to the control this is anchored on - so the columnanchor control as this is specified in the <anchored> tag. So, I'm guessing you're not seeing anything as the left and right offset are related to this control, not the left/right position of the header (I'm guessing you'd use the header?)

You may want to use the parent="minicombattitle" in some of the positional anchors - more info in the "Definition" section here: https://www.fantasygrounds.com/refdoc/windowcontrol.xcp

Or you may just want to change the whole anchoring to use minicombattitle rather than columnanchor

Compare the difference for the anchoring for minicombattitle:


<anchored height="20">
<top parent="columnanchor" anchor="bottom" relation="relative" offset="15" />
<left offset="15" />
<right offset="-10" />
</anchored>

Only the top is anchored on columnanchor the rest is anchored on the windowinstance where the control resides - as there is no control name in the <anchored> tag.

celestian
May 27th, 2018, 20:00
This turned out to be... as always for me, xml/alignment issues.

Doesn't work:


<subwindow name="mini_combat_window">
<anchored to="columnanchor">
<top anchor="bottom" relation="relative" offset="2" />
<left offset="15" />
<right offset="-10" />
</anchored>
<class>combat_mini_section_ct</class>
<activate />
<fastinit />
</subwindow>

Versus what works:


<subwindow name="mini_combat_window">
<anchored>
<top parent="columnanchor" anchor="bottom" relation="relative" offset="12" />
<left offset="10" />
<right offset="-5" />
</anchored>
<class>combat_mini_section_ct</class>
<activate />
<fastinit />
</subwindow>

Trenloe
May 27th, 2018, 20:06
This turned out to be... as always for me, xml/alignment issues.

Doesn't work:


<subwindow name="mini_combat_window">
<anchored to="columnanchor">
<top anchor="bottom" relation="relative" offset="2" />
<left offset="15" />
<right offset="-10" />
</anchored>
<class>combat_mini_section_ct</class>
<activate />
<fastinit />
</subwindow>

Versus what works:


<subwindow name="mini_combat_window">
<anchored>
<top parent="columnanchor" anchor="bottom" relation="relative" offset="12" />
<left offset="10" />
<right offset="-5" />
</anchored>
<class>combat_mini_section_ct</class>
<activate />
<fastinit />
</subwindow>

Yep, that’s what I was trying to say!

Glad you got it sorted. :-)

celestian
May 27th, 2018, 20:10
<anchored height="20">
<top parent="columnanchor" anchor="bottom" relation="relative" offset="15" />
<left offset="15" />
<right offset="-10" />
</anchored>


Hah, you just posted this as I was posting the update. I got up this morning and reviewed all the anchoring/etc and saw I had set a "to=". I manually forced the width to 400 and sure enough things showed up and then I realized the same thing you indicated here.

Thanks for helping me out ;)

Bidmaron
August 1st, 2018, 13:00
Man, this discussion was super helpful to me also on a problem currently kicking my butt. I did not realize that where you identify the parent made a difference. Now that I reread this, I realize it really could only work this way if you want a maximally flexible layout language.