From 8f4ef11fb576a5594c43ba5937727feb5ba309b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20H=C3=BCskes?= Date: Tue, 25 Oct 2022 16:05:19 +0200 Subject: [PATCH] Fix OnClick for Dragonflight --- broker.lua | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/broker.lua b/broker.lua index 15b17c1..a9ca641 100755 --- a/broker.lua +++ b/broker.lua @@ -65,11 +65,21 @@ local function updateainfo() end local function OnClick(self, button) if(button == 'RightButton') then - if(InterfaceOptionsFrame:IsVisible() and not InCombatLockdown()) then - InterfaceOptionsFrame:Hide() - else - InterfaceOptionsFrame_OpenToCategory(childName) - InterfaceOptionsFrame_OpenToCategory(childName) -- Twice because of a bug in InterfaceOptionsFrame_OpenToCategory + if(not InCombatLockdown()) then + if(SettingsPanel) then + if(SettingsPanel:IsVisible()) then + SettingsPanel:Hide() + else + Settings.OpenToCategory(childName) + end + elseif(InterfaceOptionsFrame) then + if(InterfaceOptionsFrame:IsVisible()) then + InterfaceOptionsFrame:Hide() + else + InterfaceOptionsFrame_OpenToCategory(childName) + InterfaceOptionsFrame_OpenToCategory(childName) -- Twice because of a bug in InterfaceOptionsFrame_OpenToCategory + end + end end elseif(button == 'MiddleButton') then local pCPU = C_CVar.GetCVarBool("scriptProfile")