Commit c6e265c0 authored by Robin Schoonover's avatar Robin Schoonover

Show Item IDs for toys.

parent 8ce63cf6
Pipeline #195 passed with stage
......@@ -82,7 +82,24 @@ function addon:HookTip(method, hookfunc)
end
end
addon:HookTipScript("OnTooltipCleared", function(self)
self._alltheid = nil
local afterShowTips = {}
local function AfterShowHook()
for i, tip in ipairs(afterShowTips) do
if not tip._alltheid and tip._alltheid_type then
addon:AddIDLine(tip, tip._alltheid_type, tip._alltheid_id)
end
end
wipe(afterShowTips)
end
addon:HookTipScript("OnShow", function(tip)
tinsert(afterShowTips, tip)
C_Timer.After(0, AfterShowHook)
end)
addon:HookTipScript("OnTooltipCleared", function(tip)
tip._alltheid_type = nil
tip._alltheid_id = nil
tip._alltheid = nil
end)
......@@ -113,6 +113,14 @@ addon:HookTip("SetQuestLogCurrency", function(self, type, idx)
-- TODO GetQuestCurrencyInfo(type, idx) => name, texture, count
end)
addon:HookTip("SetToyByItemID", function(tip, itemid)
-- This won't cause the OnTooltipSetItem to be called, and the tooltip
-- won't actually be filled in during the same call either, so we need
-- to remember what item it was.
tip._alltheid_type = "Item"
tip._alltheid_id = itemid
end)
addon:HookTip("SetUnitAura", function(self, unit, index, filter)
local _,_,_,_,_,_,_,_,_,_, spellID = UnitAura(unit, index, filter)
addon:AddIDLine(self, "Spell", spellID)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment