Referencia › Referencia de funciones › Conditions

Conditions.talent.treePicker

dependencia

Llamar como

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

Registra la dependencia Conditions.talent.treePicker y luego llámala con ese nombre. Una llamada con espacio de nombres no pasa self: usa una llamada con dos puntos o pasa tú mismo el objeto.

Qué hace

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.

Argumentos

NombreTipoQué hace
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.

Retornos

Nada.

Ediciones

Las funciones auxiliares integradas se registran en todas las ediciones. Lo que cambia es la API del juego que leen; donde falta alguna, la función auxiliar recurre a una alternativa o devuelve nil con un motivo.

No lee directamente ninguna API del juego.

Cómo la llama el addon

  • Árbol de talentos principal (widget)
    local top=parent:GetUserData('top');treePicker(parent,spec,value,function() top:SetStatusText(top:GetUserData('funcs'):print(top:GetUserData('root'),spec)) end)
  • Puntos del árbol de talentos (widget)
    treePicker(parent,spec,value,update);parent:AddChild(addon:Widget_OperatorWidget(value,L['Points'],update))

Dependencias

Código fuente

Conditions/talent.lua, línea 636. Solo lectura en el juego; Duplicar crea una copia editable.

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

Volver a Referencia de funciones