Referenz › Funktionsreferenz › Conditions

Conditions.bossmod.idEditor

Abhängigkeit

Aufruf als

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

Erfassen Sie die Abhängigkeit Conditions.bossmod.idEditor und rufen Sie sie dann unter diesem Namen auf. Ein Aufruf über den Namensraum übergibt kein self: Verwenden Sie einen Doppelpunkt-Aufruf oder übergeben Sie das Objekt selbst.

Was sie bewirkt

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.

Argumente

NameTypWas sie bewirkt
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.

Rückgabewerte

1RMConditionInputThe edit box, already added to parent.

Editionen

Integrierte Hilfsfunktionen werden auf jeder Edition registriert. Unterschiedlich ist die Spiel-API, die sie lesen; fehlt eine, weicht die Hilfsfunktion aus oder gibt nil mit einem Grund zurück.

Sie liest keine Spiel-API direkt.

Wie das Addon sie aufruft

  • Boss-Mod-Begegnung (widget)
    idEditor(parent, L["Encounter ID (blank for any)"], value.encounter, function(id) value.encounter = id; update() end)
  • Boss-Mod-Timer (widget)
    idEditor(parent, L["Boss ability spell ID"], value.spell, function(id)

Abhängigkeiten

Quelle

Conditions/bossmod.lua, Zeile 70. Im Spiel schreibgeschützt; Duplizieren erstellt eine bearbeitbare Kopie.

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

Zurück zu Funktionsreferenz