Call as
Conditions.talent.treeName(value, spec)
Record the dependency Conditions.talent.treeName, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.
What it does
Names the talent tree in a talent tree condition's description: the client's tree name, else "Talent tree N", else "<talent tree>" when no tree is set.
Arguments
| Name | Type | What it does |
|---|---|---|
value | table | Condition settings with a tree field. |
spec | number | nil | Specialization the editor is for; on progression clients a value from 1 to 4 also selects the talent group to read. |
Returns
| 1 | string | Localized tree name or placeholder. |
|---|
Editions
Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.
It reads no game API directly.
How the addon calls it
- Primary Talent Tree (print)
return string.format(L['your primary talent tree {{!is|is not}} %s'],treeName(value,spec)) - Talent Tree Points (print)
return Functions.presentation.compareString(value.operator,string.format(L['the number of points spent in %s'],treeName(value,spec)),Functions.presentation.nullable(value.value))
Dependencies
group→Conditions.talent.groupinteger→Conditions.talent.integer
Source
Conditions/talent.lua, line 624. Read only in game; Duplicate makes an editable copy.
Conditions.talent.treeName(value, spec)
local name=integer(value.tree,1,16) and addon.TalentTrees.Name(value.tree,addon.TalentTrees.ContextClass(),group(spec))
return name or value.tree and string.format(L['Talent tree %s'],tostring(value.tree)) or L['<talent tree>']