Как вызывать
Conditions.talent.info(value, spec)
Запишите зависимость Conditions.talent.info и вызывайте её по этому имени. Вызов через пространство имён не передаёт self: используйте вызов через двоеточие или передайте объект сами.
Что делает
Looks up the talent a TALENT condition refers to, according to its layout: a trait node and entry, a grid index, or a tree and talent index. Returns nil for any other shape.
Аргументы
| Имя | Тип | Что делает |
|---|---|---|
value | table | Saved TALENT condition settings. |
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 | table | nil | Talent identity from the platform (name, icon and IDs where known), or nil. |
|---|---|---|
| 2 | string | nil | The platform's reason for nil, when it gives one. |
Издания
Встроенные помощники регистрируются во всех изданиях. Различается игровой API, который они читают; если нужного API нет, помощник использует запасной вариант или возвращает nil с причиной.
Не читает игровой API напрямую.
Как его вызывает аддон
- Талант (print)
local talent=info(value,spec) Conditions.talent.gridWidgetlocal talent=info(value,spec);talentIcon:SetImage(talent and talent.icon or PLACEHOLDER);update()Conditions.talent.iconlocal current=info(value,spec);widget:SetImage(current and current.icon or PLACEHOLDER)Conditions.talent.traitsWidgetlocal current=info(value,spec)Conditions.talent.treeWidgetlocal talent=info(value,spec);talentIcon:SetImage(talent and talent.icon or PLACEHOLDER);update()
Зависимости
group→Conditions.talent.groupinteger→Conditions.talent.integerownTrees→Conditions.talent.ownTreesplatform(builtin:Conditions/talent.lua:platform)traitShape→Conditions.talent.traitShapetreeShape→Conditions.talent.treeShape
Исходный код
Conditions/talent.lua, строка 109. В игре только для чтения; «Дублировать» создаёт редактируемую копию.
Conditions.talent.info(value, spec)
if traitShape(value) then return integer(value.node,1,2147483647) and platform:GetTraitTalentIdentity(value.node,value.entry,value.spell) or nil end
if value.layout=="grid" then return platform:GetGridTalentInfo(value.value,group(spec)) end
if treeShape(value) then
-- The game answers for the player's own class only; another class's
-- talent index would name one of the player's talents instead.
if not ownTrees() then return nil end
return platform:GetTreeTalentInfo(value.tree,value.talent,group(spec))
end