@@ -43,12 +43,16 @@ StaticPopupDialogs['AUCTION_HOUSE_CONFIRM_PURCHASE_AMOUNT'] = {
4343 text = ' You selected to buy %s %s, please confirm this.' ,
4444 button1 = ' Confirm' ,
4545 button2 = ' Cancel' ,
46+ --- @param popup StaticPopupTemplate
4647 OnShow = function (popup , data )
47- popup .button1 :Disable ()
48- MoneyFrame_Update (popup .moneyFrame , data .totalPrice )
48+ local button1 = popup .GetButtons and popup :GetButtons ()[1 ] or popup .button1
49+ local itemFrame = popup .GetItemFrame and popup :GetItemFrame () or popup .itemFrame
50+ local moneyFrame = popup .MoneyFrame or popup .moneyFrame
51+
52+ button1 :Disable ()
53+ MoneyFrame_Update (moneyFrame , data .totalPrice )
4954 C_AuctionHouse .StartCommoditiesPurchase (data .itemID , data .count , data .unitPrice );
5055
51- local itemFrame = popup .itemFrame
5256 itemFrame :ClearAllPoints ();
5357 itemFrame :SetPoint (' BOTTOM' , popup , ' BOTTOM' , - 60 , 80 )
5458 end ,
@@ -59,16 +63,21 @@ StaticPopupDialogs['AUCTION_HOUSE_CONFIRM_PURCHASE_AMOUNT'] = {
5963 editBox :GetParent ():Hide ()
6064 end ,
6165 EditBoxOnEnterPressed = function (editBox )
66+ --- @type StaticPopupTemplate
6267 local popup = editBox :GetParent ()
63- if popup .button1 :IsEnabled () then
68+ local button1 = popup .GetButtons and popup :GetButtons ()[1 ] or popup .button1
69+ if button1 :IsEnabled () then
6470 StaticPopup_OnClick (popup , 1 )
6571 end
6672 end ,
6773 EditBoxOnTextChanged = function (editBox , data )
74+ --- @type StaticPopupTemplate
75+ local popup = editBox :GetParent ()
76+ local button1 = popup .GetButtons and popup :GetButtons ()[1 ] or popup .button1
6877 if (editBox :GetText () == data .count .. ' ' ) then
69- editBox : GetParent (). button1 :Enable ()
78+ button1 :Enable ()
7079 else
71- editBox : GetParent (). button1 :Disable ()
80+ button1 :Disable ()
7281 end
7382 end ,
7483 hasItemFrame = true ,
0 commit comments