Chiamala come
Conditions.talent.treePicker(parent, spec, value, update)
Registra la dipendenza Conditions.talent.treePicker, poi chiamala con quel nome. Una chiamata con spazio dei nomi non passa self: usa una chiamata con i due punti o passa tu l'oggetto.
Cosa fa
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.
Argomenti
| Nome | Tipo | Cosa fa |
|---|---|---|
parent | table | Condition widget group the control is added to. |
spec | number | nil | Specialization the editor is for; on progression clients a value from 1 to 4 also selects the talent group to read. |
value | table | Saved condition settings; the tree field is read and written, and disabled is honored. |
update | function | Called with no arguments after every change so the editor can refresh. |
Valori restituiti
Niente.
Edizioni
Le funzioni di supporto integrate sono registrate su ogni edizione. Ciò che cambia è l'API di gioco che leggono; dove ne manca una, la funzione di supporto ripiega su un'alternativa o restituisce nil con un motivo.
Non legge direttamente alcuna API di gioco.
Come la chiama l'addon
- Albero dei talenti principale (widget)
local top=parent:GetUserData('top');treePicker(parent,spec,value,function() top:SetStatusText(top:GetUserData('funcs'):print(top:GetUserData('root'),spec)) end) - Punti nell'albero dei talenti (widget)
treePicker(parent,spec,value,update);parent:AddChild(addon:Widget_OperatorWidget(value,L['Points'],update))
Dipendenze
dropdown→Conditions.talent.dropdowngroup→Conditions.talent.grouptext→Conditions.talent.text
Sorgente
Conditions/talent.lua, riga 636. Nel gioco è in sola lettura; Duplica crea una copia modificabile.
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