Referenz › Funktionsreferenz › Conditions

Conditions.talent.treePicker

Abhängigkeit

Aufruf als

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

Erfassen Sie die Abhängigkeit Conditions.talent.treePicker und rufen Sie sie dann unter diesem Namen auf. Ein Aufruf über den Namensraum übergibt kein self: Verwenden Sie einen Doppelpunkt-Aufruf oder übergeben Sie das Objekt selbst.

Was sie bewirkt

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.

Argumente

NameTypWas sie bewirkt
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.

Rückgabewerte

Nichts.

Editionen

Integrierte Hilfsfunktionen werden auf jeder Edition registriert. Unterschiedlich ist die Spiel-API, die sie lesen; fehlt eine, weicht die Hilfsfunktion aus oder gibt nil mit einem Grund zurück.

Sie liest keine Spiel-API direkt.

Wie das Addon sie aufruft

  • Primärer Talentbaum (widget)
    local top=parent:GetUserData('top');treePicker(parent,spec,value,function() top:SetStatusText(top:GetUserData('funcs'):print(top:GetUserData('root'),spec)) end)
  • Punkte im Talentbaum (widget)
    treePicker(parent,spec,value,update);parent:AddChild(addon:Widget_OperatorWidget(value,L['Points'],update))

Abhängigkeiten

Quelle

Conditions/talent.lua, Zeile 636. Im Spiel schreibgeschützt; Duplizieren erstellt eine bearbeitbare Kopie.

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

Zurück zu Funktionsreferenz