HideUIPanel(ItemRefTooltip);
GameTooltip_OnLoad(self); self:SetPadding(16); self:RegisterForDrag("LeftButton"); self.shoppingTooltips = { ItemRefShoppingTooltip1, ItemRefShoppingTooltip2, ItemRefShoppingTooltip3 }; self.UpdateTooltip = function(self) if ( not self.comparing and IsModifiedClick("COMPAREITEMS")) then GameTooltip_ShowCompareItem(self); self.comparing = true; elseif ( self.comparing and not IsModifiedClick("COMPAREITEMS")) then for _, frame in pairs(self.shoppingTooltips) do frame:Hide(); end self.comparing = false; end end
if ( IsModifiedClick("COMPAREITEMS") and self:IsMouseOver()) then GameTooltip_ShowCompareItem(self, 1); self.comparing = true; end
self:StartMoving();
self:StopMovingOrSizing(); ValidateFramePosition(self); if ( IsModifiedClick("COMPAREITEMS") ) then --We do this to choose where the comparison is shown GameTooltip_ShowCompareItem(self, 1); self.comparing = true; end
self:SetScript("OnUpdate", self.UpdateTooltip);
for _, frame in pairs(self.shoppingTooltips) do frame:Hide(); end self.comparing = false; self:SetScript("OnUpdate", nil);
GameTooltip_OnHide(self); --While it is true that OnUpdate won't fire while the frame is hidden, we don't want to have to check-and-unregister when we show it self:SetScript("OnUpdate", nil);