Commit e5cd4e4b authored by Benik's avatar Benik

Added custom visibility option for the Custom Panels

parent f20ae9ee
......@@ -39,6 +39,7 @@ L['Click to show the Addon List'] = "Klicken um die AddOn-Liste zu zeigen"
L['Create'] = "Erstelle"
L["Type a unique name for the new panel. \n|cff00c0faNote: 'BenikUI_' will be added at the beginning, to ensure uniqueness|r"] = "Gib einen einzigartigen Namen für das neue Panel ein. \n|cff00c0faHinweis: 'BenikUI_' wird am Anfang hinzugefügt um die Einzigarigkeit zu gewährleisten|r"
L["The Custom Panel name |cff00c0fa%s|r already exists. Please choose another one."] = "Der Name |cff00c0fa%s|r von einem Benutzerdefiniertem Panel existiert bereits. Bitte wähle einen anderen."
L["This works like a macro, you can run different situations to get the panel to show/hide differently.\n Example: '[combat] show;hide'"] = true
L["Hide in Pet Battle"] = "Verstecke in Haustiefkämpfen"
L["Hide In Combat"] = "Verstecke im Kampf"
L["Name Tooltip"] = "Namenstooltip"
......
......@@ -40,6 +40,7 @@ L['Click to show the Addon List'] = true
L['Create'] = true
L["Type a unique name for the new panel. \n|cff00c0faNote: 'BenikUI_' will be added at the beginning, to ensure uniqueness|r"] = true
L["The Custom Panel name |cff00c0fa%s|r already exists. Please choose another one."] = true
L["This works like a macro, you can run different situations to get the panel to show/hide differently.\n Example: '[combat] show;hide'"] = true
L["Hide in Pet Battle"] = true
L["Hide In Combat"] = true
L["Name Tooltip"] = true
......
......@@ -39,6 +39,7 @@ L['Click to show the Addon List'] = true
L['Create'] = true
L["Type a unique name for the new panel. \n|cff00c0faNote: 'BenikUI_' will be added at the beginning, to ensure uniqueness|r"] = true
L["The Custom Panel name |cff00c0fa%s|r already exists. Please choose another one."] = true
L["This works like a macro, you can run different situations to get the panel to show/hide differently.\n Example: '[combat] show;hide'"] = true
L["Hide in Pet Battle"] = true
L["Hide In Combat"] = true
L["Name Tooltip"] = true
......
......@@ -39,6 +39,7 @@ L['Click to show the Addon List'] = true
L['Create'] = true
L["Type a unique name for the new panel. \n|cff00c0faNote: 'BenikUI_' will be added at the beginning, to ensure uniqueness|r"] = true
L["The Custom Panel name |cff00c0fa%s|r already exists. Please choose another one."] = true
L["This works like a macro, you can run different situations to get the panel to show/hide differently.\n Example: '[combat] show;hide'"] = true
L["Hide in Pet Battle"] = true
L["Hide In Combat"] = true
L["Name Tooltip"] = true
......
......@@ -39,6 +39,7 @@ L['Click to show the Addon List'] = true
L['Create'] = true
L["Type a unique name for the new panel. \n|cff00c0faNote: 'BenikUI_' will be added at the beginning, to ensure uniqueness|r"] = true
L["The Custom Panel name |cff00c0fa%s|r already exists. Please choose another one."] = true
L["This works like a macro, you can run different situations to get the panel to show/hide differently.\n Example: '[combat] show;hide'"] = true
L["Hide in Pet Battle"] = true
L["Hide In Combat"] = true
L["Name Tooltip"] = true
......
......@@ -39,6 +39,7 @@ L['Click to show the Addon List'] = true
L['Create'] = true
L["Type a unique name for the new panel. \n|cff00c0faNote: 'BenikUI_' will be added at the beginning, to ensure uniqueness|r"] = true
L["The Custom Panel name |cff00c0fa%s|r already exists. Please choose another one."] = true
L["This works like a macro, you can run different situations to get the panel to show/hide differently.\n Example: '[combat] show;hide'"] = true
L["Hide in Pet Battle"] = true
L["Hide In Combat"] = true
L["Name Tooltip"] = true
......
......@@ -39,6 +39,7 @@ L['Click to show the Addon List'] = true
L['Create'] = true
L["Type a unique name for the new panel. \n|cff00c0faNote: 'BenikUI_' will be added at the beginning, to ensure uniqueness|r"] = true
L["The Custom Panel name |cff00c0fa%s|r already exists. Please choose another one."] = true
L["This works like a macro, you can run different situations to get the panel to show/hide differently.\n Example: '[combat] show;hide'"] = true
L["Hide in Pet Battle"] = true
L["Hide In Combat"] = true
L["Name Tooltip"] = true
......
......@@ -39,6 +39,7 @@ L['Click to show the Addon List'] = true
L['Create'] = true
L["Type a unique name for the new panel. \n|cff00c0faNote: 'BenikUI_' will be added at the beginning, to ensure uniqueness|r"] = true
L["The Custom Panel name |cff00c0fa%s|r already exists. Please choose another one."] = true
L["This works like a macro, you can run different situations to get the panel to show/hide differently.\n Example: '[combat] show;hide'"] = true
L["Hide in Pet Battle"] = true
L["Hide In Combat"] = true
L["Name Tooltip"] = true
......
......@@ -39,6 +39,7 @@ L['Click to show the Addon List'] = true
L['Create'] = true
L["Type a unique name for the new panel. \n|cff00c0faNote: 'BenikUI_' will be added at the beginning, to ensure uniqueness|r"] = true
L["The Custom Panel name |cff00c0fa%s|r already exists. Please choose another one."] = true
L["This works like a macro, you can run different situations to get the panel to show/hide differently.\n Example: '[combat] show;hide'"] = true
L["Hide in Pet Battle"] = true
L["Hide In Combat"] = true
L["Name Tooltip"] = true
......
......@@ -39,6 +39,7 @@ L['Click to show the Addon List'] = true
L['Create'] = true
L["Type a unique name for the new panel. \n|cff00c0faNote: 'BenikUI_' will be added at the beginning, to ensure uniqueness|r"] = true
L["The Custom Panel name |cff00c0fa%s|r already exists. Please choose another one."] = true
L["This works like a macro, you can run different situations to get the panel to show/hide differently.\n Example: '[combat] show;hide'"] = true
L["Hide in Pet Battle"] = true
L["Hide In Combat"] = true
L["Name Tooltip"] = true
......
......@@ -16,6 +16,7 @@ local PanelDefault = {
['petHide'] = true,
['vehicleHide'] = true,
['tooltip'] = true,
['visibility'] = "",
}
local function OnEnter(self)
......@@ -80,12 +81,20 @@ function mod:SetupPanels()
for name in pairs(E.db.benikui.panels) do
if name then
local db = E.db.benikui.panels[name]
local visibility = db.visibility
if visibility and visibility:match('[\n\r]') then
visibility = visibility:gsub('[\n\r]','')
end
if db.enable then
_G[name]:Show()
E:EnableMover(_G[name].mover:GetName())
RegisterStateDriver(_G[name], "visibility", visibility)
else
_G[name]:Hide()
E:DisableMover(_G[name].mover:GetName())
UnregisterStateDriver(_G[name], "visibility")
end
if not E.db.benikui.panels[name].hide then
......
......@@ -186,6 +186,23 @@ local function panelsTable()
get = function() return E.db.benikui.panels[panelname].vehicleHide end,
set = function(info, value) E.db.benikui.panels[panelname].vehicleHide = value; end,
},
visibility = {
type = 'input',
order = 24,
name = L["Visibility State"],
desc = L["This works like a macro, you can run different situations to get the panel to show/hide differently.\n Example: '[combat] show;hide'"],
width = 'full',
disabled = function() return not E.db.benikui.panels[panelname].enable end,
multiline = true,
get = function() return E.db.benikui.panels[panelname].visibility end,
set = function(info, value)
if value and value:match('[\n\r]') then
value = value:gsub('[\n\r]','')
end
E.db.benikui.panels[panelname].visibility = value;
BP:SetupPanels()
end,
},
spacer3 = {
order = 30,
type = 'description',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment