Skip to content

Commit 69dbe1a

Browse files
committed
hide dialog box when any buttons is pressed to avoid deleting wrong data
1 parent 1b127ea commit 69dbe1a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

BestTimesUI.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ function MPT:EnableEditBoxKeyboard(editbox)
195195
end)
196196
end
197197

198-
function MPT:CreatePBFrame()
199-
198+
function MPT:CreatePBFrame()
200199
if not self.PBInfoFrame then
201200
-- Main Frame
202201
self.BestTimeFrame = CreateFrame("Frame", nil, UIParent, "BackdropTemplate")
@@ -274,6 +273,8 @@ function MPT:CreatePBFrame()
274273
F.CloseButton:SetSize(24, 24)
275274
self:SetPoint(F.CloseButton, "TOPRIGHT", F, "TOPRIGHT", -8, -8)
276275
F.CloseButton:SetScript("OnClick", function(s)
276+
StaticPopup_Hide("MPT_DELETE_RUN") -- hide when literally any button is pressed because the parameters have changed
277+
StaticPopup_Hide("MPT_DELETE_CHARACTER") -- hide when literally any button is pressed because the parameters have changed
277278
F:Hide()
278279
end)
279280

@@ -362,6 +363,8 @@ end
362363
function MPT:HidePBButtons(level)
363364
local F = self.BestTimeFrame
364365
if level >= 1 then -- Clicking on Level/Character Button
366+
StaticPopup_Hide("MPT_DELETE_RUN") -- hide when literally any button is pressed because the parameters have changed
367+
StaticPopup_Hide("MPT_DELETE_CHARACTER") -- hide when literally any button is pressed because the parameters have changed
365368
if F.PBDataText then F.PBDataText:Hide() end
366369
if F.PBDataText2 then F.PBDataText2:Hide() end
367370
if F.DeleteButton then F.DeleteButton:Hide() end

0 commit comments

Comments
 (0)