Skip to content

Commit cdb515e

Browse files
committed
Remove third compare tooltip support
Drop legacy third shopping tooltip handling from GameTooltip_ShowCompareItem. Unpack only two shoppingTooltips, remove unused item3/shoppingTooltip3 variables and commented code, and simplify anchor/owner logic for the two-compare layout. GAP/backdrop spacing calculation is preserved.
1 parent d55613e commit cdb515e

1 file changed

Lines changed: 4 additions & 42 deletions

File tree

AddOns/!!!ClassicAPI/Util/GameTooltip.lua

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,21 @@ function GameTooltip_ShowCompareItem(self, shift)
1414
return;
1515
end
1616

17-
local shoppingTooltip1, shoppingTooltip2, shoppingTooltip3 = unpack(self.shoppingTooltips or { ShoppingTooltip1, ShoppingTooltip2 });
17+
local shoppingTooltip1, shoppingTooltip2 = unpack(self.shoppingTooltips or { ShoppingTooltip1, ShoppingTooltip2 });
1818

19-
-- Horizontal gap between the main tooltip and the compare tooltips.
20-
-- The backdrop's edge texture is drawn straddling the frame rect, so it
21-
-- extends ~edgeSize/2 past each frame's edge; two frames anchored edge
22-
-- to edge therefore overlap by ~edgeSize. Derive the offset from the
23-
-- live backdrop (skins resize the border) — one full edgeSize clears
24-
-- both borders — plus a small visible margin. No magic number.
2519
local SEPARATION = 6;
2620
local backdrop = shoppingTooltip1.GetBackdrop and shoppingTooltip1:GetBackdrop();
2721
local GAP = SEPARATION + ((type(backdrop) == "table" and backdrop.edgeSize) or 0);
2822

2923
local item1 = nil;
3024
local item2 = nil;
31-
local item3 = nil;
3225
local side = "left";
3326
if ( shoppingTooltip1:SetHyperlinkCompareItem(link, 1, shift, self) ) then
3427
item1 = true;
3528
end
3629
if ( shoppingTooltip2:SetHyperlinkCompareItem(link, 2, shift, self) ) then
3730
item2 = true;
3831
end
39-
-- if ( shoppingTooltip3:SetHyperlinkCompareItem(link, 3, shift, self) ) then
40-
-- item3 = true;
41-
-- end
4232

4333
-- find correct side
4434
local rightDist = 0;
@@ -68,9 +58,6 @@ function GameTooltip_ShowCompareItem(self, shift)
6858
if ( item2 ) then
6959
totalWidth = totalWidth + shoppingTooltip2:GetWidth();
7060
end
71-
-- if ( item3 ) then
72-
-- totalWidth = totalWidth + shoppingTooltip3:GetWidth();
73-
-- end
7461

7562
if ( (side == "left") and (totalWidth > leftPos) ) then
7663
self:SetAnchorType(self:GetAnchorType(), (totalWidth - leftPos), 0);
@@ -79,38 +66,13 @@ function GameTooltip_ShowCompareItem(self, shift)
7966
end
8067
end
8168

82-
-- anchor the compare tooltips
83-
-- if ( item3 ) then
84-
-- shoppingTooltip3:SetOwner(self, "ANCHOR_NONE");
85-
-- shoppingTooltip3:ClearAllPoints();
86-
-- if ( side and side == "left" ) then
87-
-- shoppingTooltip3:SetPoint("TOPRIGHT", self, "TOPLEFT", 0, -10);
88-
-- else
89-
-- shoppingTooltip3:SetPoint("TOPLEFT", self, "TOPRIGHT", 0, -10);
90-
-- end
91-
-- shoppingTooltip3:SetHyperlinkCompareItem(link, 3, shift, self);
92-
-- shoppingTooltip3:Show();
93-
-- end
94-
9569
if ( item1 ) then
96-
if( item3 ) then
97-
shoppingTooltip1:SetOwner(shoppingTooltip3, "ANCHOR_NONE");
98-
else
99-
shoppingTooltip1:SetOwner(self, "ANCHOR_NONE");
100-
end
70+
shoppingTooltip1:SetOwner(self, "ANCHOR_NONE");
10171
shoppingTooltip1:ClearAllPoints();
10272
if ( side and side == "left" ) then
103-
if( item3 ) then
104-
shoppingTooltip1:SetPoint("TOPRIGHT", shoppingTooltip3, "TOPLEFT", 0, 0);
105-
else
106-
shoppingTooltip1:SetPoint("TOPRIGHT", self, "TOPLEFT", -GAP, -10);
107-
end
73+
shoppingTooltip1:SetPoint("TOPRIGHT", self, "TOPLEFT", -GAP, -10);
10874
else
109-
if( item3 ) then
110-
shoppingTooltip1:SetPoint("TOPLEFT", shoppingTooltip3, "TOPRIGHT", 0, 0);
111-
else
112-
shoppingTooltip1:SetPoint("TOPLEFT", self, "TOPRIGHT", GAP, -10);
113-
end
75+
shoppingTooltip1:SetPoint("TOPLEFT", self, "TOPRIGHT", GAP, -10);
11476
end
11577
shoppingTooltip1:SetHyperlinkCompareItem(link, 1, shift, self);
11678
shoppingTooltip1:Show();

0 commit comments

Comments
 (0)