public
Description: WoW Addon - Simple item compare tooltips
Homepage: http://www.tekkub.net/
Clone URL: git://github.com/tekkub/tekkompare.git
Click here to lend your support to: tekkompare and make a donation at www.pledgie.com !
tekkompare / tekKompare.lua
100644 30 lines (24 sloc) 1.073 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
local orig1 = GameTooltip:GetScript("OnTooltipSetItem")
GameTooltip:SetScript("OnTooltipSetItem", function(self, ...)
if not ShoppingTooltip1:IsVisible() and not self:IsEquippedItem() then GameTooltip_ShowCompareItem(self, 1) end
if orig1 then return orig1(self, ...) end
end)
 
 
local orig2 = ItemRefTooltip:GetScript("OnTooltipSetItem")
ItemRefTooltip:SetScript("OnTooltipSetItem", function(self, ...)
GameTooltip_ShowCompareItem(self, 1)
self.comparing = true
if orig2 then return orig2(self, ...) end
end)
 
 
-- Don't let ItemRefTooltip fuck with the compare tips
ItemRefTooltip:SetScript("OnEnter", nil)
ItemRefTooltip:SetScript("OnLeave", nil)
ItemRefTooltip:SetScript("OnDragStart", function(self)
ItemRefShoppingTooltip1:Hide(); ItemRefShoppingTooltip2:Hide(); ItemRefShoppingTooltip3:Hide()
self:StartMoving()
end)
ItemRefTooltip:SetScript("OnDragStop", function(self)
self:StopMovingOrSizing()
ValidateFramePosition(self)
local _, link = self:GetItem()
SetTips(link, self, ItemRefShoppingTooltip1, ItemRefShoppingTooltip2, ItemRefShoppingTooltip3)
end)