From ad7b66e9920e08a125d4cc3fe4bf828da78edd15 Mon Sep 17 00:00:00 2001 From: Ahmil Jilani Date: Thu, 16 Oct 2014 18:12:36 -0400 Subject: [PATCH] Different name on button icon is now clickable again --- SuperDuperMacro/SuperDuperMacro_Frames.lua | 8 +++++++- SuperDuperMacro/SuperDuperMacro_Interface.lua | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/SuperDuperMacro/SuperDuperMacro_Frames.lua b/SuperDuperMacro/SuperDuperMacro_Frames.lua index e8add7e..8fb03ba 100644 --- a/SuperDuperMacro/SuperDuperMacro_Frames.lua +++ b/SuperDuperMacro/SuperDuperMacro_Frames.lua @@ -133,7 +133,13 @@ f:SetText("Change Name/Icon") f:SetWidth(140) f:SetHeight(22) f:SetPoint("RIGHT", sdm_usageButton, "LEFT") -f:SetScript("OnClick", function() sdm_changeIconFrame:Show() end) +f:SetScript("OnClick", function() + if MacroPopupFrame ~= nil and MacroPopupFrame:IsShown() then + print(sdm_printPrefix.."The change macro name/icon frame is already open.") + else + sdm_changeIconFrame:Show() + end +end) sdm_AddToExclusiveGroup(f, "centerwindows", true) f = CreateFrame("Button", "sdm_saveAsButton", sdm_mainFrame, "UIPanelButtonTemplate") diff --git a/SuperDuperMacro/SuperDuperMacro_Interface.lua b/SuperDuperMacro/SuperDuperMacro_Interface.lua index 5a93080..7727c77 100644 --- a/SuperDuperMacro/SuperDuperMacro_Interface.lua +++ b/SuperDuperMacro/SuperDuperMacro_Interface.lua @@ -628,7 +628,8 @@ function sdm_OnShow_changeIconFrame(f) f.prevpoints[i]={MacroPopupFrame:GetPoint(i)} end MacroPopupFrame:ClearAllPoints() - --MacroPopupFrame:SetParent(f) + f.prevParent = MacroPopupFrame:GetParent() + MacroPopupFrame:SetParent(f) MacroPopupFrame:SetPoint("TOP", f, "BOTTOM", 0,15) MacroPopupFrame:Show() _,_,_,_,f.fontstring = MacroPopupFrame:GetRegions() @@ -661,7 +662,7 @@ function sdm_OnHide_changeIconFrame(f) MacroPopupEditBox:SetAutoFocus(true) MacroPopupFrame.mode=f.prevmode MacroPopupFrame:ClearAllPoints() - --MacroPopupFrame:SetParent(UIParent) + MacroPopupFrame:SetParent(f.prevParent) for _,point in ipairs(f.prevpoints) do MacroPopupFrame:SetPoint(point[1], point[2], point[3], point[4], point[5]) end -- 1.7.9.5