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)