Skip to content

Commit

Permalink
show spellId on macros
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Jul 7, 2024
1 parent 38de14d commit aa152a9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions idTip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit aa152a9

Please sign in to comment.