Reference › Function reference › Conditions

Conditions.talent.treePicker

dependency

Call as

Conditions.talent.treePicker(parent, spec, value, update)

Record the dependency Conditions.talent.treePicker, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.

What it does

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.

Arguments

NameTypeWhat it does
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.

Returns

Nothing.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

It reads no game API directly.

How the addon calls it

  • Primary Talent Tree (widget)
    local top=parent:GetUserData('top');treePicker(parent,spec,value,function() top:SetStatusText(top:GetUserData('funcs'):print(top:GetUserData('root'),spec)) end)
  • Talent Tree Points (widget)
    treePicker(parent,spec,value,update);parent:AddChild(addon:Widget_OperatorWidget(value,L['Points'],update))

Dependencies

Source

Conditions/talent.lua, line 636. Read only in game; Duplicate makes an editable copy.

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

Back to Function reference