Functions
Add dynamic content into your presets
Last updated
Add dynamic content into your presets
Last updated
All functions follow the following format. Arguments can also be wrapped in quotes.
Most functions can also be nested inside eachother, creating more complex behaviour. This is the main advantage of functions over placeholders.
New functions can also be added with addons using .
$data(key)
Get data from the current preset file. See .
$hasdata(key)
Same as data, but returns true if given path exists and false if not.
$context(key)
$hascontext(key)
Same as $context(key), but returns true if context is set and false if not.
⭐ $if(condition, trueText, falseText)
Conditional function, which takes an evaluated statement and depending on the output displays either trueText or falseText.
$var(global, key)
$pvar(global, key)
$parse(player, text)
Parses the given text for another player, instead of the player viewing the tooltip.
$static(text)
An important optimization function, which processes and caches the text within. This will stop the given text from being updated and will stay static.
$strip(text)
Strips the given text from all animation tags. Useful when text has to be displayed in another tooltip after an animation was done.
$preprocess(text)
Needed when importing text from elsewhere (for example using a placeholder or a function), which has animations.
Can think of some other useful function? Suggest it in the Discord!
Get a given key from condition context. In order for context to exist, the preset has to have this condition in its conditions
. $context(key)
can use similar keys to the data function. .
(By default, all conditions also return a condition.<condition>
context, which has the result of the condition (true/false) )
Variable functions allow to retrieve values from using a key. $var
is used for local variables and $pvar
is used for persistent (saved) variables.