diff --git a/idTip.lua b/idTip.lua index 85d5001..0ebff12 100644 --- a/idTip.lua +++ b/idTip.lua @@ -83,17 +83,21 @@ local function addLine(tooltip, id, kind) tooltip:AddDoubleLine(left, right) - local iconId - if kind == kinds.spell then - iconId = GetSpellTexture(id) + if kind == kinds.spell and GetSpellTexture then + local iconId = GetSpellTexture(id) if iconId then addLine(tooltip, iconId, kinds.icon) end - elseif kind == kinds.item then - iconId = GetItemIconByID(id) + elseif kind == kinds.item and GetItemIconByID then + local iconId = GetItemIconByID(id) if iconId then addLine(tooltip, iconId, kinds.icon) end local spellId = select(2, GetItemSpell(id)) if spellId then addLine(tooltip, spellId, kinds.spell) end + elseif kind == kinds.macro and tooltip.GetPrimaryTooltipData then + data = tooltip:GetPrimaryTooltipData(); + if data and data.lines and data.lines[1] and data.lines[1].tooltipID then + addLine(tooltip, data.lines[1].tooltipID, kinds.spell) + end end tooltip:Show()