Chame como
Conditions.talent.dropdown(parent, title, changed)
Registre a dependência Conditions.talent.dropdown e depois chame-a por esse nome. Uma chamada com namespace não passa self: use uma chamada com dois-pontos ou passe o objeto você mesmo.
O que faz
Creates a full-width condition dropdown labeled title for the talent condition editors, forwards each selection to changed, and adds it to parent. The caller fills its choices later through the widget's configure function.
Argumentos
| Nome | Tipo | O que faz |
|---|---|---|
parent | table | Condition widget group the control is added to. |
title | string | Label shown above the dropdown. |
changed | function | Called with the selected key whenever the selection changes. |
Retornos
| 1 | RMConditionSelector | The dropdown, already added to parent. |
|---|
Edições
As funções auxiliares integradas são registradas em todas as edições. O que muda é a API do jogo que elas leem; quando uma está ausente, a função auxiliar recorre a uma alternativa ou retorna nil com um motivo.
Não lê nenhuma API do jogo diretamente.
Como o addon a chama
Conditions.talent.gridWidgettierPicker=dropdown(box,L["Tier"],function(selected)Conditions.talent.traitsWidgetspecPicker=dropdown(box,L["Specialization"],function(selected)Conditions.talent.treePickerlocal picker=dropdown(parent,L['Talent tree'],function(selected) value.tree=selected;update() end)Conditions.talent.treeWidgettreePicker=dropdown(box,L["Talent Tree"],function(selected)
Código-fonte
Conditions/talent.lua, linha 136. Somente leitura no jogo; Duplicar cria uma cópia editável.
Conditions.talent.dropdown(parent, title, changed)
local widget=addon:CreateConditionDropdown();widget:SetFullWidth(true);widget:SetLabel(title)
widget:SetCallback("OnValueChanged",function(_,_,value) changed(value) end);parent:AddChild(widget)
return widget