Référence › Référence des fonctions › Conditions

Conditions.talent.icon

dépendance

Appel

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

Enregistrez la dépendance Conditions.talent.icon, puis appelez-la sous ce nom. Un appel par espace de noms ne transmet pas self : utilisez un appel avec deux-points ou passez l'objet vous-même.

Ce qu'elle fait

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.

Arguments

NomTypeCe qu'elle fait
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.

Retours

1RMConditionIconThe icon widget, already added to parent.

Éditions

Les fonctions utilitaires intégrées sont enregistrées sur toutes les éditions. Ce qui diffère, c'est l'API du jeu qu'elles lisent ; quand l'une manque, la fonction utilitaire se rabat sur une alternative ou renvoie nil avec une raison.

  • Indisponible sur cette édition (la raison figure dans l'infobulle)
  • Uniquement tant que les solutions de repli de Blizzard pour les fonctions obsolètes sont actives
API du jeuClassic EraTBC AnniversaryClassic ProgressionForeverRetail
GameTooltipClassic EraTBC AnniversaryClassic ProgressionForeverRetail

Comment l'addon l'appelle

Dépendances

Source

Conditions/talent.lua, ligne 167. En lecture seule dans le jeu ; Dupliquer crée une copie modifiable.

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

Retour à Référence des fonctions