• Mods are now organized as resources. Use the Mods link above to browse for or submit a mod, tool, or prefab.

    The TFP Official Modding Forum Policy establishes the rules and guidelines for mod creators and mod users.

How to show Cvar value inside of a label in XUI/windows.xml?

Would be interested in making custom skillpoints-to-next-level visible in the Skill List for a Learning-by-Doing mod.
From what i see in the examples so far, there is a hard coded game mechanic that binds certain implicitely given lists to certain variable names that are used in "windows.xml". It would be nice to get infos about the relation between the definitions of elements and cvars in "progression.xml" or "buffs.xml" and elements in "windows.xml".
 
Can format it like {cvar(yourCVar)}. I have one in a label:
XML:
<label pos="635, -9" depth="2" width="300" height="28" text="SPIFSAL Points: {cvar($RemainingSpifsal)}" font_size="26" color="[green]" justify="right" pivot="topright" visible="{# cvar('$RemainingSpifsal') > 0}"/>
Can use rounding and NCalc to adjust how it displays, if needed.
 
What is "NCalc" and how would it be used in 7DTD xmls? (Not getting a single match on a global search across all xmls of the game and mods)
 
Can google it. It's just functions used to affect the display of a cvar. It isn't game specific. I'm not super familiar with all of it myself.
 
Back
Top