Referenz › Funktionsreferenz › Conditions

Conditions.talent.icon

Abhängigkeit

Aufruf als

Conditions.talent.icon(parent, value, spec)

Erfassen Sie die Abhängigkeit Conditions.talent.icon 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

Creates the 44-pixel talent icon for the TALENT editors, showing the referenced talent's icon and, on hover, its spell tooltip (or its name), and adds it to parent.

Argumente

NameTypWas sie bewirkt
parenttableCondition widget group the control is added to.
valuetableSaved TALENT condition settings the icon reflects.
specnumber | nilSpecialization the editor is for; on progression clients a value from 1 to 4 also selects the talent group to read.

Rückgabewerte

1RMConditionIconThe icon widget, 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.

  • Auf dieser Edition nicht verfügbar (den Grund nennt der Tooltip)
  • Nur, solange Blizzards Ersatz für veraltete Funktionen aktiv ist
Spiel-APIClassic EraTBC AnniversaryClassic ProgressionForeverRetail
GameTooltipClassic EraTBC AnniversaryClassic ProgressionForeverRetail

Wie das Addon sie aufruft

Abhängigkeiten

Quelle

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

Conditions.talent.icon(parent, value, spec)
    local widget=addon:CreateConditionIcon();widget:SetWidth(64);widget:SetImageSize(60,60)
    local current=info(value,spec);widget:SetImage(current and current.icon or PLACEHOLDER)
    widget:SetCallback("OnEnter",function()
        local observed=info(value,spec)
        if observed then
            GameTooltip:SetOwner(widget.frame,"ANCHOR_BOTTOMRIGHT",3)
            if observed.spellID then GameTooltip:SetHyperlink("spell:"..observed.spellID)
            else GameTooltip:SetText(observed.name) end
        end
    end)
    widget:SetCallback("OnLeave",function() if GameTooltip:IsOwned(widget.frame) then GameTooltip:Hide() end end)
    parent:AddChild(widget)
    return widget

Zurück zu Funktionsreferenz