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
| Nom | Type | Ce qu'elle fait |
|---|---|---|
parent | table | Condition widget group the control is added to. |
value | table | Saved TALENT condition settings the icon reflects. |
spec | number | nil | Specialization the editor is for; on progression clients a value from 1 to 4 also selects the talent group to read. |
Retours
| 1 | RMConditionIcon | The 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 jeu | |||||
|---|---|---|---|---|---|
GameTooltip |
Comment l'addon l'appelle
Conditions.talent.gridWidgetlocal talentIcon=icon(box,value,spec)Conditions.talent.traitsWidgettalentIcon=icon(box,value,spec)Conditions.talent.treeWidgettalentIcon=icon(box,value,spec)
Dépendances
PLACEHOLDER(builtin:Conditions/talent.lua:PLACEHOLDER)info→Conditions.talent.info
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




