Rewrite Onclick Settings to not open/close in combat

This commit is contained in:
Robin Hüskes 2022-10-06 18:41:17 +02:00
parent 94f0276604
commit ee082d2568
1 changed files with 13 additions and 11 deletions

View File

@ -23,17 +23,19 @@ function lib:DefaultOnClick(_, button, addon, childName)
end end
else else
if(not InCombatLockdown()) then if(not InCombatLockdown()) then
if(SettingsPanel and SettingsPanel.CloseButton:IsVisible()) then if(SettingsPanel) then
SettingsPanel:Hide() if(SettingsPanel:IsVisible()) then
elseif(InterfaceOptionsFrame and InterfaceOptionsFrame:IsVisible()) then SettingsPanel:Hide()
InterfaceOptionsFrame:Hide() else
end Settings.OpenToCategory(childName)
else end
if(Settings and Settings.OpenToCategory) then elseif(InterfaceOptionsFrame) then
Settings.OpenToCategory(childName) if(InterfaceOptionsFrame:IsVisible()) then
else InterfaceOptionsFrame:Hide()
InterfaceOptionsFrame_OpenToCategory(childName) else
InterfaceOptionsFrame_OpenToCategory(childName) -- Twice because of a bug in InterfaceOptionsFrame_OpenToCategory InterfaceOptionsFrame_OpenToCategory(childName)
InterfaceOptionsFrame_OpenToCategory(childName) -- Twice because of a bug in InterfaceOptionsFrame_OpenToCategory
end
end end
end end
end end