From 81ef8987ec6af13707599d73367c5958ff4a1c7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20H=C3=BCskes?= Date: Thu, 6 Oct 2022 18:40:38 +0200 Subject: [PATCH] Rewrite Onclick Settings to not open/close in combat --- Libs/zzLDB/zzLDB.lua | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Libs/zzLDB/zzLDB.lua b/Libs/zzLDB/zzLDB.lua index 0dbbc16..8c8cada 100755 --- a/Libs/zzLDB/zzLDB.lua +++ b/Libs/zzLDB/zzLDB.lua @@ -1,4 +1,4 @@ -local lib = LibStub:NewLibrary("zzLDB", 4) +local lib = LibStub:NewLibrary("zzLDB", 5) if not lib then return end local ldb = LibStub:GetLibrary("LibDataBroker-1.1") local ldbicon = LibStub:GetLibrary("LibDBIcon-1.0") @@ -22,11 +22,21 @@ function lib:DefaultOnClick(_, button, addon, childName) end end else - 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 end end