Referência › Referência de funções › Conditions

Conditions.talent.icon

dependência

Chame como

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

Registre a dependência Conditions.talent.icon e depois chame-a por esse nome. Uma chamada com namespace não passa self: use uma chamada com dois-pontos ou passe o objeto você mesmo.

O que faz

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.

Argumentos

NomeTipoO que faz
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.

Retornos

1RMConditionIconThe icon widget, already added to parent.

Edições

As funções auxiliares integradas são registradas em todas as edições. O que muda é a API do jogo que elas leem; quando uma está ausente, a função auxiliar recorre a uma alternativa ou retorna nil com um motivo.

  • Indisponível nessa edição (o motivo está na dica)
  • Só enquanto as alternativas da Blizzard para APIs obsoletas estiverem ativas
API do jogoClassic EraTBC AnniversaryClassic ProgressionForeverRetail
GameTooltipClassic EraTBC AnniversaryClassic ProgressionForeverRetail

Como o addon a chama

Dependências

Código-fonte

Conditions/talent.lua, linha 167. Somente leitura no jogo; Duplicar cria uma cópia editável.

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

Voltar para Referência de funções