Reference › Function reference › Conditions

Conditions.talent.icon

dependency

Call as

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

Record the dependency Conditions.talent.icon, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.

What it does

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

NameTypeWhat it does
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.

Returns

1RMConditionIconThe icon widget, already added to parent.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

  • Not available on that edition (the reason is in the tooltip)
  • Only while Blizzard's deprecation fallbacks are on
Game APIClassic EraTBC AnniversaryClassic progressionForeverRetail
GameTooltipClassic EraTBC AnniversaryClassic progressionForeverRetail

How the addon calls it

Dependencies

Source

Conditions/talent.lua, line 167. Read only in game; Duplicate makes an editable copy.

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

Back to Function reference