Как вызывать
Conditions.talent.treeName(value, spec)
Запишите зависимость Conditions.talent.treeName и вызывайте её по этому имени. Вызов через пространство имён не передаёт self: используйте вызов через двоеточие или передайте объект сами.
Что делает
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.
Аргументы
| Имя | Тип | Что делает |
|---|---|---|
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. |
Возвращает
| 1 | string | Localized tree name or placeholder. |
|---|
Издания
Встроенные помощники регистрируются во всех изданиях. Различается игровой API, который они читают; если нужного API нет, помощник использует запасной вариант или возвращает nil с причиной.
Не читает игровой API напрямую.
Как его вызывает аддон
- Основная ветка талантов (print)
return string.format(L['your primary talent tree {{!is|is not}} %s'],treeName(value,spec)) - Очки в ветке талантов (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))
Зависимости
group→Conditions.talent.groupinteger→Conditions.talent.integer
Исходный код
Conditions/talent.lua, строка 624. В игре только для чтения; «Дублировать» создаёт редактируемую копию.
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>']