Skip to content

Commit 4e3c810

Browse files
2.5.5 (66567)
1 parent 634f6a1 commit 4e3c810

File tree

14 files changed

+183
-13
lines changed

14 files changed

+183
-13
lines changed

Interface/AddOns/Blizzard_APIDocumentationGenerated/SecureTransferDocumentation.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@ local SecureTransfer =
66

77
Functions =
88
{
9+
{
10+
Name = "GetTradePartner",
11+
Type = "Function",
12+
HasRestrictions = true,
13+
14+
Returns =
15+
{
16+
{ Name = "name", Type = "cstring", Nilable = true },
17+
},
18+
},
19+
{
20+
Name = "ShouldShowTradeOfferWarning",
21+
Type = "Function",
22+
HasRestrictions = true,
23+
24+
Returns =
25+
{
26+
{ Name = "shouldShow", Type = "bool", Nilable = false },
27+
},
28+
},
929
},
1030

1131
Events =

Interface/AddOns/Blizzard_APIDocumentationGenerated/TradeInfoDocumentation.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ local TradeInfo =
3333
{ Name = "amount", Type = "WOWMONEY", Nilable = false },
3434
},
3535
},
36+
{
37+
Name = "ShouldShowTradeOfferWarning",
38+
Type = "Function",
39+
40+
Returns =
41+
{
42+
{ Name = "shouldShow", Type = "bool", Nilable = false },
43+
},
44+
},
3645
},
3746

3847
Events =
@@ -113,6 +122,11 @@ local TradeInfo =
113122
Type = "Event",
114123
LiteralName = "TRADE_UPDATE",
115124
},
125+
{
126+
Name = "TradeUpdateWarnings",
127+
Type = "Event",
128+
LiteralName = "TRADE_UPDATE_WARNINGS",
129+
},
116130
},
117131

118132
Tables =

Interface/AddOns/Blizzard_ActionBar/Classic/ActionButtonTemplate.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@
6060
<Layer level="OVERLAY" textureSubLevel="1">
6161
<Texture parentKey="NewActionTexture" atlas="UI-HUD-ActionBar-IconFrame-Mouseover" useAtlasSize="true" hidden="true">
6262
<Anchors>
63-
<Anchor point="TOPLEFT"/>
63+
<Anchor point="CENTER"/>
6464
</Anchors>
6565
</Texture>
6666
<Texture parentKey="SpellHighlightTexture" atlas="UI-HUD-ActionBar-IconFrame-Mouseover" alphaMode="ADD" alpha="0.4" useAtlasSize="true" hidden="true">
6767
<Anchors>
68-
<Anchor point="TOPLEFT"/>
68+
<Anchor point="CENTER"/>
6969
</Anchors>
7070
</Texture>
7171
<Texture parentKey="LevelLinkLockIcon" atlas="QuestSharing-Padlock" useAtlasSize="true" hidden="true">

Interface/AddOns/Blizzard_SecureTransferUI/Blizzard_SecureTransferUI.lua

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ function GetSecureMoneyString(money, separateThousands)
6262
return moneyString;
6363
end
6464

65+
function GetSecureTradeWarningString()
66+
if (C_SecureTransfer.ShouldShowTradeOfferWarning()) then
67+
local otherPlayer = C_SecureTransfer.GetTradePartner() or PLAYER; -- Probably should never hit this fallback case, but adding it just to be safe. Would rather show PLAYER than not show the warning at all.
68+
return string.format(TRADE_WARNING_CHANGED_OFFER, otherPlayer);
69+
end
70+
71+
return nil;
72+
end
73+
6574
function SecureTransferDialog_DelayedAccept(self)
6675
self.Button1:Disable();
6776
C_Timer.After(1, function()
@@ -89,7 +98,8 @@ end
8998
local SECURE_TRANSFER_DIALOGS = {
9099
["CONFIRM_TRADE"] = {
91100
text = TRADE_ACCEPT_CONFIRMATION,
92-
onShow = SecureTransferDialog_DelayedAccept,
101+
acceptWarning = GetSecureTradeWarningString,
102+
onShow = SecureTransferDialog_TimerOnAccept,
93103
onAccept = function()
94104
C_SecureTransfer.AcceptTrade();
95105
end,
@@ -140,6 +150,14 @@ function SecureTransferDialog_Show(which, ...)
140150
else
141151
SecureTransferDialog.MoneyLabel:Hide();
142152
end
153+
154+
if (currentDialog.acceptWarning) then
155+
SecureTransferDialog.WarningText:SetText(currentDialog.acceptWarning());
156+
height = height + SecureTransferDialog.WarningText:GetHeight();
157+
else
158+
SecureTransferDialog.WarningText:Hide();
159+
end
160+
143161
SecureTransferDialog:SetHeight(height);
144162
SecureTransferDialog:Show();
145163
end

Interface/AddOns/Blizzard_SecureTransferUI/Blizzard_SecureTransferUI.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,16 @@
108108
<Anchor point="TOP" relativeKey="$parent.Text" relativePoint="BOTTOM" x="0" y="-8"/>
109109
</Anchors>
110110
</FontString>
111+
<FontString parentKey="WarningText" inherits="GameFontRed">
112+
<Size x="320" y="0"/>
113+
<Anchors>
114+
<Anchor point="TOP" relativeKey="$parent.MoneyLabel" relativePoint="BOTTOM" x="0" y="-8"/>
115+
</Anchors>
116+
</FontString>
111117
</Layer>
112118
</Layers>
113119
<Frames>
114-
<Frame parentKey="Border" inherits="SecureDialogBorderTemplate"/>
120+
<Frame parentKey="Border" inherits="SecureDialogBorderNoCenterTemplate"/>
115121
<Button parentKey="Button1" inherits="SecureTransferButtonTemplate" text="OKAY" id="1">
116122
<Size x="120" y="22"/>
117123
<Anchors>
@@ -139,4 +145,4 @@
139145
</Scripts>
140146
</Frame>
141147
</ScopedModifier>
142-
</Ui>
148+
</Ui>

Interface/AddOns/Blizzard_SharedXML/SecureUIPanelTemplates.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ UI.xsd">
306306
-->
307307
<Frame name="SecureDialogBorderNoCenterTemplate" frameLevel="500" setAllPoints="true" useParentLevel="true" virtual="true">
308308
<Layers>
309-
<Layer level="BACKGROUND">
309+
<Layer level="BORDER">
310310
<Texture parentKey="TopLeftCorner" atlas="UI-Frame-DiamondMetal-CornerTopLeft" useAtlasSize="true">
311311
<Anchors>
312312
<Anchor point="TOPLEFT"/>

Interface/AddOns/Blizzard_UIPanels_Game/Classic/TradeFrame.lua

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ function TradeFrame_OnLoad(self)
1111
self:RegisterEvent("TRADE_ACCEPT_UPDATE");
1212
self:RegisterEvent("TRADE_POTENTIAL_BIND_ENCHANT");
1313
self:RegisterEvent("GET_ITEM_INFO_RECEIVED");
14+
self:RegisterEvent("TRADE_UPDATE_WARNINGS");
1415
TradeFrameInset:SetPoint("TOPLEFT", 4, -440);
1516
TradeRecipientItemsInsetBg:SetAlpha(0.1);
1617
TradeRecipientMoneyInsetBg:SetAlpha(0);
@@ -58,6 +59,8 @@ function TradeFrame_OnEvent(self, event, ...)
5859
end
5960
elseif ( event == "TRADE_POTENTIAL_REMOVE_TRANSMOG" ) then
6061
StaticPopup_Show("TRADE_POTENTIAL_REMOVE_TRANSMOG", arg1, nil, arg2);
62+
elseif ( event == "TRADE_UPDATE_WARNINGS" ) then
63+
TradeFrame_UpdateWarnings();
6164
end
6265
end
6366

@@ -74,10 +77,23 @@ function TradeFrame_Update()
7477
TradeHighlightPlayer:Hide();
7578
TradeHighlightPlayerEnchant:Hide();
7679
TradeHighlightRecipientEnchant:Hide();
80+
81+
TradeFrame_UpdateWarnings();
82+
end
83+
84+
function TradeFrame_UpdateWarnings()
85+
if (C_TradeInfo.ShouldShowTradeOfferWarning()) then
86+
local otherPlayer = GetUnitName("NPC") or PLAYER; -- Probably should never hit this fallback case, but adding it just to be safe. Would rather show PLAYER than not show the warning at all.
87+
TradeFrameTradeButton.warningTooltip = string.format(TRADE_WARNING_CHANGED_OFFER, otherPlayer);
88+
TradeFrameTradeButton.WarningIcon:Show();
89+
else
90+
TradeFrameTradeButton.warningTooltip = nil;
91+
TradeFrameTradeButton.WarningIcon:Hide();
92+
end
7793
end
7894

7995
function TradeFrame_UpdatePlayerItem(id)
80-
local name, texture, numItems, quality, enchantment, canLoseTransmog = GetTradePlayerItemInfo(id);
96+
local name, texture, numItems, quality, enchantment, canLoseTransmog, isBound, itemID = GetTradePlayerItemInfo(id);
8197
local buttonText = _G["TradePlayerItem"..id.."Name"];
8298

8399
-- See if its the enchant slot
@@ -115,12 +131,15 @@ function TradeFrame_UpdatePlayerItem(id)
115131
local _, dialog = StaticPopup_Visible("TRADE_POTENTIAL_REMOVE_TRANSMOG");
116132
if ( dialog and dialog.data == id and not canLoseTransmog ) then
117133
StaticPopup_Hide("TRADE_POTENTIAL_REMOVE_TRANSMOG");
118-
end
134+
end
135+
136+
TradeFrame_AlertItemIfChanged(tradeItemButton, itemID, name, numItems, enchantment);
119137
end
120138

121139
function TradeFrame_UpdateTargetItem(id)
122-
local name, texture, numItems, quality, isUsable, enchantment = GetTradeTargetItemInfo(id);
140+
local name, texture, numItems, quality, isUsable, enchantment, itemID = GetTradeTargetItemInfo(id);
123141
local buttonText = _G["TradeRecipientItem"..id.."Name"];
142+
124143
-- See if its the enchant slot
125144
if ( id == TRADE_ENCHANT_SLOT ) then
126145
if ( name ) then
@@ -154,6 +173,22 @@ function TradeFrame_UpdateTargetItem(id)
154173
GameTooltip:Hide();
155174
end
156175
SetItemButtonQuality(tradeItemButton, quality, GetTradeTargetItemLink(id));
176+
177+
TradeFrame_AlertItemIfChanged(tradeItemButton, itemID, name, numItems, enchantment);
178+
end
179+
180+
function TradeFrame_AlertItemIfChanged(tradeItemButton, itemID, name, numItems, enchantment)
181+
-- Play alert if anything about this item slot changed. (We don't alert the first time an item is placed in the slot, though.)
182+
local alertFrame = tradeItemButton.Alert;
183+
local oldItemKey = alertFrame.itemKey;
184+
local newItemKey = { id = itemID, name = name, quantity = numItems, enchantmentID = enchantment };
185+
if (oldItemKey and not tCompare(oldItemKey, newItemKey)) then
186+
alertFrame.ItemIconAlertAnim:Restart();
187+
end
188+
if (oldItemKey or itemID > 0) then
189+
-- Update our key to the new item, except in the case where we didn't start with a key (fresh trade) and this isn't actually an item yet.
190+
alertFrame.itemKey = newItemKey;
191+
end
157192
end
158193

159194
function TradeFrame_SetAcceptState(playerState, targetState)
@@ -254,3 +289,27 @@ function TradeFrameTradeButton_SetToEnabledState()
254289
end
255290
end
256291

292+
TradeFrameTradeButtonMixin = {};
293+
294+
function TradeFrameTradeButtonMixin:OnLoad()
295+
self.Text:SetText(TRADE); -- Note: Doing this here so that we can anchor the WarningIcon to self.Text and have it be positioned appropriately.
296+
self.warningTooltip = nil;
297+
end
298+
299+
function TradeFrameTradeButtonMixin:OnEnter()
300+
if (self.warningTooltip) then
301+
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
302+
GameTooltip_AddErrorLine(GameTooltip, self.warningTooltip);
303+
GameTooltip:Show();
304+
end
305+
end
306+
307+
TradeItemAlertTemplateMixin = {};
308+
309+
function TradeItemAlertTemplateMixin:OnShow()
310+
self.itemKey = nil; -- Used to track when this itemSlot changes in a way that should trigger an alert.
311+
end
312+
313+
function TradeItemAlertTemplateMixin:OnHide()
314+
self.ItemIconAlertAnim:Stop();
315+
end

Interface/AddOns/Blizzard_UIPanels_Game/Classic/TradeFrame.xml

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,41 @@
5555
</Layer>
5656
</Layers>
5757
</Frame>
58+
<Frame name="TradeItemAlertTemplate" mixin="TradeItemAlertTemplateMixin" virtual="true">
59+
<Size x="64" y="64"/>
60+
<Layers>
61+
<Layer level="ARTWORK">
62+
<Texture parentKey="LoopFlipbook" atlas="UI-HUD-ActionBar-Proc-Loop-Flipbook" setAllPoints="true" alpha="0"/>
63+
</Layer>
64+
</Layers>
65+
<Animations>
66+
<AnimationGroup parentKey="ItemIconAlertAnim" setToFinalAlpha="true">
67+
<Alpha childKey="LoopFlipbook" duration=".2" order="1" fromAlpha="0" toAlpha="1"/>
68+
<FlipBook childKey="LoopFlipbook" duration="1.0" order="1" flipBookRows="6" flipBookColumns="5" flipBookFrames="30" flipBookFrameWidth="0" flipBookFrameHeight="0"/>
69+
<FlipBook childKey="LoopFlipbook" duration="1.0" order="2" flipBookRows="6" flipBookColumns="5" flipBookFrames="30" flipBookFrameWidth="0" flipBookFrameHeight="0"/>
70+
<FlipBook childKey="LoopFlipbook" duration="1.0" order="3" flipBookRows="6" flipBookColumns="5" flipBookFrames="30" flipBookFrameWidth="0" flipBookFrameHeight="0"/>
71+
<FlipBook childKey="LoopFlipbook" duration="1.0" order="4" flipBookRows="6" flipBookColumns="5" flipBookFrames="30" flipBookFrameWidth="0" flipBookFrameHeight="0"/>
72+
<Alpha childKey="LoopFlipbook" duration=".5" order="4" fromAlpha="1" toAlpha="0"/>
73+
</AnimationGroup>
74+
</Animations>
75+
<Scripts>
76+
<OnShow method="OnShow"/>
77+
<OnHide method="OnHide"/>
78+
</Scripts>
79+
</Frame>
5880
<Frame name="RecipientTradeItemTemplate" inherits="TradeItemTemplate" virtual="true">
5981
<Frames>
6082
<Button name="$parentItemButton" inherits="ItemButtonTemplate">
6183
<Anchors>
6284
<Anchor point="TOPLEFT" relativeTo="$parent"/>
6385
</Anchors>
86+
<Frames>
87+
<Frame parentKey="Alert" inherits="TradeItemAlertTemplate">
88+
<Anchors>
89+
<Anchor point="CENTER"/>
90+
</Anchors>
91+
</Frame>
92+
</Frames>
6493
<Scripts>
6594
<OnLoad>
6695
RaiseFrameLevelByTwo(self);
@@ -104,6 +133,13 @@
104133
<Anchors>
105134
<Anchor point="TOPLEFT" relativeTo="$parent"/>
106135
</Anchors>
136+
<Frames>
137+
<Frame parentKey="Alert" inherits="TradeItemAlertTemplate">
138+
<Anchors>
139+
<Anchor point="CENTER"/>
140+
</Anchors>
141+
</Frame>
142+
</Frames>
107143
<Scripts>
108144
<OnClick>
109145
if ( IsModifiedClick() ) then
@@ -374,15 +410,27 @@
374410
<OnLeave function="GameTooltip_Hide"/>
375411
</Scripts>
376412
</Frame>
377-
<Button name="TradeFrameTradeButton" inherits="UIPanelButtonTemplate" text="TRADE">
413+
<Button name="TradeFrameTradeButton" inherits="UIPanelButtonTemplate" mixin="TradeFrameTradeButtonMixin">
378414
<Size x="85" y="22"/>
379415
<Anchors>
380416
<Anchor point="BOTTOMRIGHT" relativeTo="TradeFrame" relativePoint="BOTTOMRIGHT" x="-85" y="5"/>
381417
</Anchors>
418+
<Layers>
419+
<Layer level="ARTWORK">
420+
<Texture parentKey="WarningIcon" file="Interface\DialogFrame\UI-Dialog-Icon-AlertNew" hidden="true">
421+
<Size x="18" y="18"/>
422+
<Anchors>
423+
<Anchor point="RIGHT" relativeKey="$parent.Text" relativePoint="LEFT" x="-1" y="-1"/>
424+
</Anchors>
425+
</Texture>
426+
</Layer>
427+
</Layers>
382428
<Scripts>
429+
<OnLoad method="OnLoad"/>
383430
<OnClick function="AcceptTrade"/>
431+
<OnEnter method="OnEnter"/>
432+
<OnLeave function="GameTooltip_Hide"/>
384433
</Scripts>
385-
<ButtonText text="TRADE"/>
386434
<NormalFont style="GameFontNormal"/>
387435
<HighlightFont style="GameFontHighlight"/>
388436
<DisabledFont style="GameFontDisable"/>
@@ -463,4 +511,4 @@
463511
<OnMouseUp function="TradeFrame_OnMouseUp"/>
464512
</Scripts>
465513
</Frame>
466-
</Ui>
514+
</Ui>

Interface/AddOns/Blizzard_UIParent/Cata/UIParent.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,7 @@ function ToggleGameMenu()
14181418
Commentator:SetFrameLock(false);
14191419
elseif ( ModelPreviewFrame:IsShown() ) then
14201420
ModelPreviewFrame:Hide();
1421+
elseif ( CatalogShopInboundInterface.EscapePressed and CatalogShopInboundInterface.EscapePressed() ) then
14211422
elseif ( StoreFrame_EscapePressed and StoreFrame_EscapePressed() ) then
14221423
elseif ( WowTokenRedemptionFrame_EscapePressed and WowTokenRedemptionFrame_EscapePressed() ) then
14231424
elseif ( securecall("StaticPopup_EscapePressed") ) then

Interface/AddOns/Blizzard_UIParent/Mists/UIParent.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,7 @@ function ToggleGameMenu()
14251425
Commentator:SetFrameLock(false);
14261426
elseif ( ModelPreviewFrame:IsShown() ) then
14271427
ModelPreviewFrame:Hide();
1428+
elseif ( CatalogShopInboundInterface.EscapePressed and CatalogShopInboundInterface.EscapePressed() ) then
14281429
elseif ( StoreFrame_EscapePressed and StoreFrame_EscapePressed() ) then
14291430
elseif ( WowTokenRedemptionFrame_EscapePressed and WowTokenRedemptionFrame_EscapePressed() ) then
14301431
elseif ( securecall("StaticPopup_EscapePressed") ) then

0 commit comments

Comments
 (0)