From 4e5670c560117daae531ecc8b5cc1693c15b6e2f Mon Sep 17 00:00:00 2001 From: Darthpred Date: Fri, 9 Nov 2012 18:40:35 +0400 Subject: [PATCH] Hiding for pet battles convertion (see notes) This still needs to be tested, not fully sure this actually works. My tests say it works, will run more tests on clean install after i finish with all this stuff --- ElvUI_SLE/modules/backgrounds/backgrounds.lua | 34 ++++++++----------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/ElvUI_SLE/modules/backgrounds/backgrounds.lua b/ElvUI_SLE/modules/backgrounds/backgrounds.lua index f921824..b0ff229 100644 --- a/ElvUI_SLE/modules/backgrounds/backgrounds.lua +++ b/ElvUI_SLE/modules/backgrounds/backgrounds.lua @@ -7,10 +7,10 @@ local BGr = CreateFrame('Frame', "RightBG", E.UIParent); local BGa = CreateFrame('Frame', "ActionBG", E.UIParent); local Fr = { - b = {BGb,"bottom"}, - l = {BGl,"left"}, - r = {BGr,"right"}, - a = {BGa,"action"}, + BottomBG = {BGb,"bottom"}, + LeftBG = {BGl,"left"}, + RightBG = {BGr,"right"}, + ActionBG = {BGa,"action"}, } --Frames setup @@ -83,25 +83,13 @@ function BG:UpdateFrames() end function BG:RegisterHide() - if E.db.sle.backgrounds.bottom.pethide then - E.FrameLocks['BottomBG'] = true - else - E.FrameLocks['BottomBG'] = nil - end - if E.db.sle.backgrounds.left.pethide then - E.FrameLocks['LeftBG'] = true - else - E.FrameLocks['LeftBG'] = nil - end - if E.db.sle.backgrounds.right.pethide then - E.FrameLocks['RightBG'] = true - else - E.FrameLocks['RightBG'] = nil - end - if E.db.sle.backgrounds.action.pethide then - E.FrameLocks['ActionBG'] = true - else - E.FrameLocks['ActionBG'] = nil + local db = E.db.sle.backgrounds + for k,v in pairs(Fr) do + if db[v[2]].pethide then + E.FrameLocks[k] = true + else + E.FrameLocks[k] = nil + end end end -- 1.7.9.5