Created
January 12, 2011 10:12
-
-
Save Emmo/775968 to your computer and use it in GitHub Desktop.
idTip (by silverwind)http://www.wowinterface.com/downloads/fileinfo.php?id=17033#info
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local select, UnitBuff, UnitDebuff, UnitAura, tonumber, strfind, hooksecurefunc = | |
select, UnitBuff, UnitDebuff, UnitAura, tonumber, strfind, hooksecurefunc | |
local function addLine(self,id,isItem) | |
if isItem then | |
self:AddDoubleLine("ItemID:","|cffffffff"..id) | |
else | |
self:AddDoubleLine("SpellID:","|cffffffff"..id) | |
end | |
self:Show() | |
end | |
-- Spell Hooks ---------------------------------------------------------------- | |
hooksecurefunc(GameTooltip, "SetUnitBuff", function(self,...) | |
local id = select(11,UnitBuff(...)) | |
if id then addLine(self,id) end | |
end) | |
hooksecurefunc(GameTooltip, "SetUnitDebuff", function(self,...) | |
local id = select(11,UnitDebuff(...)) | |
if id then addLine(self,id) end | |
end) | |
hooksecurefunc(GameTooltip, "SetUnitAura", function(self,...) | |
local id = select(11,UnitAura(...)) | |
if id then addLine(self,id) end | |
end) | |
GameTooltip:HookScript("OnTooltipSetSpell", function(self) | |
local id = select(3,self:GetSpell()) | |
if id then addLine(self,id) end | |
end) | |
-- Item Hooks ----------------------------------------------------------------- | |
hooksecurefunc("SetItemRef", function(link, ...) | |
local id = tonumber(link:match("spell:(%d+)")) | |
if id then addLine(ItemRefTooltip,id) end | |
end) | |
local function attachItemTooltip(self) | |
local link = select(2,self:GetItem()) | |
if not link then return end | |
local id = select(3,strfind(link, "^|%x+|Hitem:(%-?%d+):(%d+):(%d+):(%d+):(%d+):(%d+):(%-?%d+):(%-?%d+)")) | |
if id then addLine(self,id,true) end | |
end | |
GameTooltip:HookScript("OnTooltipSetItem", attachItemTooltip) | |
ItemRefTooltip:HookScript("OnTooltipSetItem", attachItemTooltip) | |
ItemRefShoppingTooltip1:HookScript("OnTooltipSetItem", attachItemTooltip) | |
ItemRefShoppingTooltip2:HookScript("OnTooltipSetItem", attachItemTooltip) | |
ItemRefShoppingTooltip3:HookScript("OnTooltipSetItem", attachItemTooltip) | |
ShoppingTooltip1:HookScript("OnTooltipSetItem", attachItemTooltip) | |
ShoppingTooltip2:HookScript("OnTooltipSetItem", attachItemTooltip) | |
ShoppingTooltip3:HookScript("OnTooltipSetItem", attachItemTooltip) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment