From aa152a9ccec7600dc28988b1dad51131b2719cd4 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 7 Jul 2024 17:03:19 +0200 Subject: [PATCH] show spellId on macros --- idTip.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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()