Rewrite Onclick Settings to not open/close in combat
This commit is contained in:
parent
fc6ba406b4
commit
81ef8987ec
|
@ -1,4 +1,4 @@
|
||||||
local lib = LibStub:NewLibrary("zzLDB", 4)
|
local lib = LibStub:NewLibrary("zzLDB", 5)
|
||||||
if not lib then return end
|
if not lib then return end
|
||||||
local ldb = LibStub:GetLibrary("LibDataBroker-1.1")
|
local ldb = LibStub:GetLibrary("LibDataBroker-1.1")
|
||||||
local ldbicon = LibStub:GetLibrary("LibDBIcon-1.0")
|
local ldbicon = LibStub:GetLibrary("LibDBIcon-1.0")
|
||||||
|
@ -22,7 +22,15 @@ function lib:DefaultOnClick(_, button, addon, childName)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if(InterfaceOptionsFrame:IsVisible() and not InCombatLockdown()) then
|
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()
|
InterfaceOptionsFrame:Hide()
|
||||||
else
|
else
|
||||||
InterfaceOptionsFrame_OpenToCategory(childName)
|
InterfaceOptionsFrame_OpenToCategory(childName)
|
||||||
|
@ -30,6 +38,8 @@ function lib:DefaultOnClick(_, button, addon, childName)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
function lib:DefaultOnText(objname, message)
|
function lib:DefaultOnText(objname, message)
|
||||||
local ldbobj = lib:GetLDB(objname)
|
local ldbobj = lib:GetLDB(objname)
|
||||||
if(ldbobj['text'] ~= message) then
|
if(ldbobj['text'] ~= message) then
|
||||||
|
|
Loading…
Reference in New Issue