Chiamala come
Conditions.bossmod.idEditor(parent, label, current, changed)
Registra la dipendenza Conditions.bossmod.idEditor, 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 a full-width edit box for an optional boss-mod ID (such as the encounter ID) and adds it to parent. On Enter it passes the typed number to changed only when validID accepts it, otherwise nil, and rewrites the box to the accepted ID or blank.
Argomenti
| Nome | Tipo | Cosa fa |
|---|---|---|
parent | table | Condition widget group the control is added to. |
label | string | Label shown above the edit box. |
current | number | nil | Saved ID to display; nil shows an empty box. |
changed | function | Called with the accepted positive whole-number ID, or nil when the text is blank or invalid. |
Valori restituiti
| 1 | RMConditionInput | The edit box, already added to parent. |
|---|
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
- Scontro del boss mod (widget)
idEditor(parent, L["Encounter ID (blank for any)"], value.encounter, function(id) value.encounter = id; update() end) - Timer del boss mod (widget)
idEditor(parent, L["Boss ability spell ID"], value.spell, function(id)
Dipendenze
validID→Conditions.bossmod.validID
Sorgente
Conditions/bossmod.lua, riga 70. Nel gioco è in sola lettura; Duplica crea una copia modificabile.
Conditions.bossmod.idEditor(parent, label, current, changed)
local edit = addon:CreateConditionEditBox()
edit:SetFullWidth(true)
edit:SetLabel(label)
edit:SetText(current and tostring(current) or "")
edit:SetCallback("OnEnterPressed", function(_, _, text)
local id = tonumber(text)
changed(validID(id) and id or nil)
edit:SetText(validID(id) and tostring(id) or "")
end)
parent:AddChild(edit)
return edit