From 609d9b1dd2dfadf1a8bf825eecb1b9f357ca8cb9 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Sat, 20 Aug 2016 19:38:42 +0300 Subject: [PATCH] More visibility state. This closes #287 again --- CHANGELOG.txt | 2 +- ElvUI_SLE/defaults/profile.lua | 4 ++++ ElvUI_SLE/modules/backgrounds.lua | 2 ++ ElvUI_SLE/options/backgrounds_c.lua | 8 ++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index de60344..0963e7c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,7 +6,7 @@ Additions: - Quick action option for UI Buttons' addon section received some love = more variants - Added an option to show only numbers in instance indicator - Location panel menu now contains challenge mode teleports -- UI BUttons now have visibility state option. Works like actionbar visibility. +- UI BUttons and Background panels now have visibility state option. Works like actionbar visibility. - Added an option to select background template for vehicle bar. Fixes: - Attempted to fix error with S&L guild dt when one of guild members happen to be in the middle of actual nowhere diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua index 6c7ea34..75ea8a4 100644 --- a/ElvUI_SLE/defaults/profile.lua +++ b/ElvUI_SLE/defaults/profile.lua @@ -28,6 +28,7 @@ P["sle"] = { ["template"] = "Default", ["alpha"] = 1, ["clickthrough"] = true, + ["visibility"] = "show", }, ["bg2"] = { ["enabled"] = false, @@ -41,6 +42,7 @@ P["sle"] = { ["template"] = "Default", ["alpha"] = 1, ["clickthrough"] = false, + ["visibility"] = "show", }, ["bg3"] = { ["enabled"] = false, @@ -54,6 +56,7 @@ P["sle"] = { ["template"] = "Default", ["alpha"] = 1, ["clickthrough"] = false, + ["visibility"] = "show", }, ["bg4"] = { ["enabled"] = false, @@ -67,6 +70,7 @@ P["sle"] = { ["template"] = "Default", ["alpha"] = 1, ["clickthrough"] = true, + ["visibility"] = "show", }, }, --Bags diff --git a/ElvUI_SLE/modules/backgrounds.lua b/ElvUI_SLE/modules/backgrounds.lua index 4c95999..5d74ff3 100644 --- a/ElvUI_SLE/modules/backgrounds.lua +++ b/ElvUI_SLE/modules/backgrounds.lua @@ -53,9 +53,11 @@ function BG:FramesVisibility(i) if BG.db["bg"..i].enabled then BG["Frame_"..i]:Show() E:EnableMover(BG["Frame_"..i].mover:GetName()) + RegisterStateDriver(BG["Frame_"..i], "visibility", BG.db["bg"..i].visibility) else BG["Frame_"..i]:Hide() E:DisableMover(BG["Frame_"..i].mover:GetName()) + UnregisterStateDriver(BG["Frame_"..i], "visibility") end end diff --git a/ElvUI_SLE/options/backgrounds_c.lua b/ElvUI_SLE/options/backgrounds_c.lua index fc0dd78..df04015 100644 --- a/ElvUI_SLE/options/backgrounds_c.lua +++ b/ElvUI_SLE/options/backgrounds_c.lua @@ -90,6 +90,14 @@ local function configTable() get = function(info) return E.db.sle.backgrounds["bg"..i].alpha end, set = function(info, value) E.db.sle.backgrounds["bg"..i].alpha = value; BG:Alpha(i) end, }, + visibility = { + order = 13, + type = 'input', + width = 'full', + name = L["Visibility State"], + get = function(info) return E.db.sle.backgrounds["bg"..i].visibility end, + set = function(info, value) E.db.sle.backgrounds["bg"..i].visibility = value; BG:FramesVisibility(i) end, + }, }, } return config -- 1.7.9.5