Как вызывать
Conditions.talent.treePicker(parent, spec, value, update)
Запишите зависимость Conditions.talent.treePicker и вызывайте её по этому имени. Вызов через пространство имён не передаёт self: используйте вызов через двоеточие или передайте объект сами.
Что делает
Builds the Talent tree dropdown for the TALENT_TREE_POINTS and PRIMARY_TALENT_TREE editors, listing the client's talent trees, storing the selection in value.tree and calling update. Shows a note when the client has no Classic talent-tree layout; the dropdown is disabled when there are no trees or value.disabled is true.
Аргументы
| Имя | Тип | Что делает |
|---|---|---|
parent | table | Condition widget group the control is added to. |
spec | number | nil | Specialization the editor is for; on progression clients a value from 1 to 4 also selects the talent group to read. |
value | table | Saved condition settings; the tree field is read and written, and disabled is honored. |
update | function | Called with no arguments after every change so the editor can refresh. |
Возвращает
Ничего.
Издания
Встроенные помощники регистрируются во всех изданиях. Различается игровой API, который они читают; если нужного API нет, помощник использует запасной вариант или возвращает nil с причиной.
Не читает игровой API напрямую.
Как его вызывает аддон
- Основная ветка талантов (widget)
local top=parent:GetUserData('top');treePicker(parent,spec,value,function() top:SetStatusText(top:GetUserData('funcs'):print(top:GetUserData('root'),spec)) end) - Очки в ветке талантов (widget)
treePicker(parent,spec,value,update);parent:AddChild(addon:Widget_OperatorWidget(value,L['Points'],update))
Зависимости
dropdown→Conditions.talent.dropdowngroup→Conditions.talent.grouptext→Conditions.talent.text
Исходный код
Conditions/talent.lua, строка 636. В игре только для чтения; «Дублировать» создаёт редактируемую копию.
Conditions.talent.treePicker(parent, spec, value, update)
local choices,order={},{}
local listed=addon.TalentTrees.Choices(addon.TalentTrees.ContextClass(),group(spec))
if listed then choices,order=listed.choices,listed.order
else text(parent,L['This client does not expose a Classic talent-tree layout. The saved tree reference is preserved.']) end
local picker=dropdown(parent,L['Talent tree'],function(selected) value.tree=selected;update() end)
picker:SetDisabled(#order==0 or value.disabled==true)
picker.configure=function() picker:SetList(choices,order);picker:SetValue(value.tree) end