Referencia › Referencia de funciones › Conditions

Conditions.bossmod.idEditor

dependencia

Llamar como

Conditions.bossmod.idEditor(parent, label, current, changed)

Registra la dependencia Conditions.bossmod.idEditor y luego llámala con ese nombre. Una llamada con espacio de nombres no pasa self: usa una llamada con dos puntos o pasa tú mismo el objeto.

Qué hace

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.

Argumentos

NombreTipoQué hace
parenttableCondition widget group the control is added to.
labelstringLabel shown above the edit box.
currentnumber | nilSaved ID to display; nil shows an empty box.
changedfunctionCalled with the accepted positive whole-number ID, or nil when the text is blank or invalid.

Retornos

1RMConditionInputThe edit box, already added to parent.

Ediciones

Las funciones auxiliares integradas se registran en todas las ediciones. Lo que cambia es la API del juego que leen; donde falta alguna, la función auxiliar recurre a una alternativa o devuelve nil con un motivo.

No lee directamente ninguna API del juego.

Cómo la llama el addon

Dependencias

Código fuente

Conditions/bossmod.lua, línea 70. Solo lectura en el juego; Duplicar crea una copia editable.

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

Volver a Referencia de funciones