Appel
Conditions.talent.treePicker(parent, spec, value, update)
Enregistrez la dépendance Conditions.talent.treePicker, puis appelez-la sous ce nom. Un appel par espace de noms ne transmet pas self : utilisez un appel avec deux-points ou passez l'objet vous-même.
Ce qu'elle fait
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
| Nom | Type | Ce qu'elle fait |
|---|---|---|
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. |
Retours
Rien.
Éditions
Les fonctions utilitaires intégrées sont enregistrées sur toutes les éditions. Ce qui diffère, c'est l'API du jeu qu'elles lisent ; quand l'une manque, la fonction utilitaire se rabat sur une alternative ou renvoie nil avec une raison.
Elle ne lit directement aucune API du jeu.
Comment l'addon l'appelle
- Arbre de talents principal (widget)
local top=parent:GetUserData('top');treePicker(parent,spec,value,function() top:SetStatusText(top:GetUserData('funcs'):print(top:GetUserData('root'),spec)) end) - Points d'arbre de talents (widget)
treePicker(parent,spec,value,update);parent:AddChild(addon:Widget_OperatorWidget(value,L['Points'],update))
Dépendances
dropdown→Conditions.talent.dropdowngroup→Conditions.talent.grouptext→Conditions.talent.text
Source
Conditions/talent.lua, ligne 636. En lecture seule dans le jeu ; Dupliquer crée une copie modifiable.
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