Как вызывать
Conditions.talent.groupLabel(candidate)
Запишите зависимость Conditions.talent.groupLabel и вызывайте её по этому имени. Вызов через пространство имён не передаёт self: используйте вызов через двоеточие или передайте объект сами.
Что делает
The heading above one group of talents in the Retail and Forever talent list: class talents, specialization talents, both, one hero tree, or a plain name.
Аргументы
| Имя | Тип | Что делает |
|---|---|---|
candidate | table | A talent group with its kind ("class", "spec", "talents" or "hero") and, for a hero tree, its name. |
Возвращает
| 1 | string | The localized heading. |
|---|
Издания
Встроенные помощники регистрируются во всех изданиях. Различается игровой API, который они читают; если нужного API нет, помощник использует запасной вариант или возвращает nil с причиной.
Не читает игровой API напрямую.
Как его вызывает аддон
Conditions.talent.traitsWidgetfor index,candidate in ipairs(groups) do groupNames[index]=groupLabel(candidate);groupOrder[#groupOrder+1]=index end
Исходный код
Conditions/talent.lua, строка 293. В игре только для чтения; «Дублировать» создаёт редактируемую копию.
Conditions.talent.groupLabel(candidate)
if candidate.kind=="class" then return L["Class talents"] end
if candidate.kind=="spec" then return L["Specialization talents"] end
if candidate.kind=="talents" then return L["Class and specialization talents"] end
if candidate.kind=="hero" then return candidate.name and string.format(L["Hero talents: %s"],candidate.name) or L["Hero Talents"] end
return candidate.name or L["Talents"]