Referenz › Funktionsreferenz › Conditions

Conditions.talent.treeWidget

Abhängigkeit

Aufruf als

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

Erfassen Sie die Abhängigkeit Conditions.talent.treeWidget 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 editor controls for Classic talent trees: a tree dropdown, a talent icon, a talent dropdown for the chosen tree, and a Points comparison. Changing the tree clears the talent (and the comparison when switching from another layout), and every change calls update.

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 TALENT condition settings; the control reads and rewrites its layout, tree, talent, node, entry, operator and value fields.
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

  • Talent (widget)
    if current=="tree" then treeWidget(parent,spec,value,update)

Abhängigkeiten

Quelle

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

Conditions.talent.treeWidget(parent, spec, value, update)
    local trees,treeOrder={},{}
    -- Names, never positions: the game's for the player's class, the shipped
    -- table's for another class's rotation or before the game has the data.
    local listed=addon.TalentTrees.Choices(addon.TalentTrees.ContextClass(),group(spec))
    if listed then trees,treeOrder=listed.choices,listed.order end
    local talents,talentOrder={},{}
    local talentIcon,talentPicker,treePicker
    local function choices()
        talents,talentOrder={},{}
        if value.tree and ownTrees() then
            for index=1,platform:GetTreeTalentCount(value.tree) or 0 do
                local talent=platform:GetTreeTalentInfo(value.tree,index,group(spec))
                if talent then talents[index]={text=talent.name,icon=talent.icon};talentOrder[#talentOrder+1]=index end
            end
        end
    end
    choices()
    local box=block(parent)
    talentIcon=icon(box,value,spec)
    treePicker=dropdown(box,L["Talent Tree"],function(selected)
        if selected==value.tree then return end
        local wasTree=value.layout=="tree" or value.layout==nil and value.tree~=nil
        value.tree,value.talent,value.layout=selected,nil,"tree"
        if not wasTree then value.value,value.operator=nil,nil end
        choices();talentPicker:SetList(talents,talentOrder);talentPicker:SetValue(nil)
        talentPicker:SetDisabled(#talentOrder==0);talentIcon:SetImage(PLACEHOLDER);update()
    end)
    treePicker.configure=function() treePicker:SetList(trees,treeOrder);treePicker:SetValue(value.tree) end
    talentPicker=dropdown(box,L["Talent"],function(selected)
        value.talent,value.layout=selected,"tree"
        local talent=info(value,spec);talentIcon:SetImage(talent and talent.icon or PLACEHOLDER);update()
    end)
    talentPicker:SetDisabled(#talentOrder==0)
    talentPicker.configure=function() talentPicker:SetList(talents,talentOrder);talentPicker:SetValue(value.talent) end
    parent:AddChild(addon:Widget_OperatorWidget(value,L["Points"],update))

Zurück zu Funktionsreferenz