Quantcast

Merge remote-tracking branch 'refs/remotes/origin/master'

Repooc [03-03-13 - 10:12]
Merge remote-tracking branch 'refs/remotes/origin/master'
Filename
ElvUI_SLE/config/profile.lua
ElvUI_SLE/config/sle_private.lua
ElvUI_SLE/modules/backgrounds/backgrounds.lua
ElvUI_SLE/modules/backgrounds/options.lua
diff --git a/ElvUI_SLE/config/profile.lua b/ElvUI_SLE/config/profile.lua
index d970f18..06c7ed8 100644
--- a/ElvUI_SLE/config/profile.lua
+++ b/ElvUI_SLE/config/profile.lua
@@ -19,6 +19,7 @@ P['sle'] = {
 			['xoffset'] = 0,
 			['yoffset'] = 0,
 			['pethide'] = true,
+			['template'] = "Default",
 		},
 		['left'] = {
 			['enabled'] = false,
@@ -29,6 +30,7 @@ P['sle'] = {
 			['xoffset'] = 0,
 			['yoffset'] = 0,
 			['pethide'] = true,
+			['template'] = "Default",
 		},
 		['right'] = {
 			['enabled'] = false,
@@ -39,6 +41,7 @@ P['sle'] = {
 			['xoffset'] = 0,
 			['yoffset'] = 0,
 			['pethide'] = true,
+			['template'] = "Default",
 		},
 		['action'] = {
 			['enabled'] = false,
@@ -49,6 +52,7 @@ P['sle'] = {
 			['xoffset'] = 0,
 			['yoffset'] = 0,
 			['pethide'] = true,
+			['template'] = "Default",
 		},
 	},

diff --git a/ElvUI_SLE/config/sle_private.lua b/ElvUI_SLE/config/sle_private.lua
index 08eca71..0f8a53f 100644
--- a/ElvUI_SLE/config/sle_private.lua
+++ b/ElvUI_SLE/config/sle_private.lua
@@ -7,22 +7,6 @@ V['sle'] = {
 		['size'] = 10,
 	},

-	--Backgrounds
-	['backgrounds'] = {
-		['bottom'] = {
-			['template'] = "Default",
-		},
-		['left'] = {
-			['template'] = "Default",
-		},
-		['right'] = {
-			['template'] = "Default",
-		},
-		['action'] = {
-			['template'] = "Default",
-		},
-	},
-
 	--Character Frame Options
 	['characterframeoptions'] = {
 		["enable"] = false,
diff --git a/ElvUI_SLE/modules/backgrounds/backgrounds.lua b/ElvUI_SLE/modules/backgrounds/backgrounds.lua
index cdaab76..e159367 100644
--- a/ElvUI_SLE/modules/backgrounds/backgrounds.lua
+++ b/ElvUI_SLE/modules/backgrounds/backgrounds.lua
@@ -15,10 +15,7 @@ local Fr = {

 --Frames setup
 function BG:FramesCreate()
-	local pr = E.private.sle.backgrounds
 	for _,v in pairs(Fr) do
-		v[1]:CreateBackdrop(pr[v[2]].template, true);
-		v[1].backdrop:SetAllPoints();
 		v[1]:SetFrameLevel(v[1]:GetFrameLevel() - 1)
 		v[1]:SetScript("OnShow", function() v[1]:SetFrameStrata('BACKGROUND') end)
 		v[1].tex = v[1]:CreateTexture(nil, 'OVERLAY')
@@ -76,6 +73,10 @@ function BG:FramesVisibility()
 end

 function BG:UpdateFrames()
+	local db = E.db.sle.backgrounds
+	for _,v in pairs(Fr) do
+				v[1]:SetTemplate(db[v[2]].template, true)
+	end
 	BG:FramesSize()
 	BG:FramesVisibility()
     BG:UpdateTex()
diff --git a/ElvUI_SLE/modules/backgrounds/options.lua b/ElvUI_SLE/modules/backgrounds/options.lua
index 3b751bd..b0d5f81 100644
--- a/ElvUI_SLE/modules/backgrounds/options.lua
+++ b/ElvUI_SLE/modules/backgrounds/options.lua
@@ -126,8 +126,8 @@ for k,v in pairs(drop) do
 				type = "select",
 				name = L["Backdrop Template"],
 				desc = L["Change the template used for this backdrop."],
-				get = function(info) return E.private.sle.backgrounds[v[1]].template end,
-				set = function(info, value) E.private.sle.backgrounds[v[1]].template = value; E:StaticPopup_Show("PRIVATE_RL") end,
+				get = function(info) return E.db.sle.backgrounds[v[1]].template end,
+				set = function(info, value) E.db.sle.backgrounds[v[1]].template = value; BG:UpdateFrames() end,
 				values = {
 					['Default'] = L["Default"],
 					['Transparent'] = L["Transparent"],