Chiamala come
Conditions.talent.icon(parent, value, spec)
Registra la dipendenza Conditions.talent.icon, poi chiamala con quel nome. Una chiamata con spazio dei nomi non passa self: usa una chiamata con i due punti o passa tu l'oggetto.
Cosa fa
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.
Argomenti
| Nome | Tipo | Cosa fa |
|---|---|---|
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. |
Valori restituiti
| 1 | RMConditionIcon | The icon widget, already added to parent. |
|---|
Edizioni
Le funzioni di supporto integrate sono registrate su ogni edizione. Ciò che cambia è l'API di gioco che leggono; dove ne manca una, la funzione di supporto ripiega su un'alternativa o restituisce nil con un motivo.
- Non disponibile su quell'edizione (il motivo è nel suggerimento)
- Solo mentre sono attivi i ripieghi di Blizzard per le API deprecate
| API di gioco | |||||
|---|---|---|---|---|---|
GameTooltip |
Come la chiama l'addon
Conditions.talent.gridWidgetlocal talentIcon=icon(box,value,spec)Conditions.talent.traitsWidgettalentIcon=icon(box,value,spec)Conditions.talent.treeWidgettalentIcon=icon(box,value,spec)
Dipendenze
PLACEHOLDER(builtin:Conditions/talent.lua:PLACEHOLDER)info→Conditions.talent.info
Sorgente
Conditions/talent.lua, riga 167. Nel gioco è in sola lettura; Duplica crea una copia modificabile.
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




