Как вызывать
Conditions.talent.dropdown(parent, title, changed)
Запишите зависимость Conditions.talent.dropdown и вызывайте её по этому имени. Вызов через пространство имён не передаёт self: используйте вызов через двоеточие или передайте объект сами.
Что делает
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.
Аргументы
| Имя | Тип | Что делает |
|---|---|---|
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. |
Возвращает
| 1 | RMConditionSelector | The dropdown, already added to parent. |
|---|
Издания
Встроенные помощники регистрируются во всех изданиях. Различается игровой API, который они читают; если нужного API нет, помощник использует запасной вариант или возвращает nil с причиной.
Не читает игровой API напрямую.
Как его вызывает аддон
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)
Исходный код
Conditions/talent.lua, строка 136. В игре только для чтения; «Дублировать» создаёт редактируемую копию.
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