From 4d0be42233b65534629c9b9a81d27eae9bde2d8e Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 20 Jan 2019 16:11:42 +0100 Subject: [PATCH] ui-widgets: prevent duplicate question dialogs --- api/ui-widgets.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/ui-widgets.lua b/api/ui-widgets.lua index ba2ed868..ebeb9147 100644 --- a/api/ui-widgets.lua +++ b/api/ui-widgets.lua @@ -579,9 +579,9 @@ end -- accessed with "GetParent().input". function pfUI.api.CreateQuestionDialog(text, yes, no, editbox) -- do not allow multiple instances of question dialogs - if pfQuestionDialog and pfQuestionDialog:IsShown() then - pfQuestionDialog:Hide() - pfQuestionDialog = nil + if _G["pfQuestionDialog"] and _G["pfQuestionDialog"]:IsShown() then + _G["pfQuestionDialog"]:Hide() + _G["pfQuestionDialog"] = nil return end @@ -783,4 +783,4 @@ function pfUI.api.CreateInfoBox(text, time, parent, height) infobox:SetFrameStrata("FULLSCREEN_DIALOG") infobox:Show() -end +end \ No newline at end of file