View Single Post
03-27-13, 02:04 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Code:
ItemRefTooltip:SetScript("OnTooltipSetItem", function(self, ...)
	if IsShiftKeyDown() then
		GameTooltip_ShowCompareItem(self, 1)
		self.comparing = true
	else
		self.comparing = nil
	end
end)
According to the code in tekKompare, you also need to have some extra hooks to prevent issues, since the ItemRefTooltip isn't really designed to work with compare tooltips:

Code:
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)
	if self.comparing then
		GameTooltip_ShowCompareItem(self, 1)
	end
end)
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote