Справочник › Справочник функций › Conditions

Conditions.talent.treePicker

зависимость

Как вызывать

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.

Аргументы

ИмяТипЧто делает
parenttableCondition widget group the control is added to.
specnumber | nilSpecialization the editor is for; on progression clients a value from 1 to 4 also selects the talent group to read.
valuetableSaved condition settings; the tree field is read and written, and disabled is honored.
updatefunctionCalled with no arguments after every change so the editor can refresh.

Возвращает

Ничего.

Издания

Встроенные помощники регистрируются во всех изданиях. Различается игровой API, который они читают; если нужного API нет, помощник использует запасной вариант или возвращает nil с причиной.

Не читает игровой API напрямую.

Как его вызывает аддон

Зависимости

Исходный код

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

Назад: Справочник функций