From ef51914033ad78997dee635fe1792c311423e9ee Mon Sep 17 00:00:00 2001 From: Darthpred Date: Fri, 9 Nov 2012 18:00:53 +0400 Subject: [PATCH] Conversion of size option to use a table values instead of setting them every time --- ElvUI_SLE/modules/backgrounds/backgrounds.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ElvUI_SLE/modules/backgrounds/backgrounds.lua b/ElvUI_SLE/modules/backgrounds/backgrounds.lua index 00589f5..a921994 100644 --- a/ElvUI_SLE/modules/backgrounds/backgrounds.lua +++ b/ElvUI_SLE/modules/backgrounds/backgrounds.lua @@ -6,6 +6,13 @@ local BGl = CreateFrame('Frame', "LeftBG", E.UIParent); 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"}, +} + --Frames setup function BG:FramesCreate() --Bottom @@ -60,17 +67,10 @@ end --Frames Size function BG:FramesSize() local db = E.db.sle.backgrounds - BGb:SetWidth(db.bottom.width) - BGb:SetHeight(db.bottom.height) - - BGl:SetWidth(db.left.width) - BGl:SetHeight(db.left.height) - - BGr:SetWidth(db.right.width) - BGr:SetHeight(db.right.height) - - BGa:SetWidth(db.action.width) - BGa:SetHeight(db.action.height) + for k,v in pairs(Fr) do + v[1]:SetWidth(db[v[2]].width) + v[1]:SetHeight(db[v[2]].height) + end end --Frames points -- 1.7.9.5