Quantcast

Added an option to select background for character window. For now only default space and custom. need MOAR pictures

Darthpred [03-02-14 - 08:42]
Added an option to select background for character window. For now only default space and custom. need MOAR pictures
Filename
ElvUI_SLE/modules/characterframe/characterframe.lua
ElvUI_SLE/modules/characterframe/options.lua
diff --git a/ElvUI_SLE/modules/characterframe/characterframe.lua b/ElvUI_SLE/modules/characterframe/characterframe.lua
index 7fdb0c0..8a98c15 100755
--- a/ElvUI_SLE/modules/characterframe/characterframe.lua
+++ b/ElvUI_SLE/modules/characterframe/characterframe.lua
@@ -4,6 +4,9 @@ local LSM = LibStub("LibSharedMedia-3.0")

 local f = CreateFrame('Frame', 'KnightArmory', PaperDollFrame)
 local C = SLArmoryConstants
+local backgrounds = {
+	["SPACE"] = "Space",
+}

 local function GemSocket_OnClick(self, button)
 	self = self:GetParent()
@@ -206,6 +209,7 @@ end

 function CFO:ArmoryFrame_DataSetting()
 	if not f:IsVisible() then return end
+	local BGdrop = E.db.sle.characterframeoptions.image.dropdown

 	-- Get Player Profession
 	local Prof1, Prof2 = GetProfessions()
@@ -492,7 +496,11 @@ function CFO:ArmoryFrame_DataSetting()
 	end

 	if E.db.sle.characterframeoptions.showimage ~= false then
-		f.BG:SetTexture('Interface\\AddOns\\ElvUI_SLE\\media\\textures\\Space.tga')
+		if BGdrop ~= "CUSTOM" then
+			f.BG:SetTexture('Interface\\AddOns\\ElvUI_SLE\\media\\textures\\'..backgrounds[BGdrop])
+		else
+			f.BG:SetTexture(E.db.sle.characterframeoptions.image.custom)
+		end
 	else
 		f.BG:SetTexture(nil);
 	end
diff --git a/ElvUI_SLE/modules/characterframe/options.lua b/ElvUI_SLE/modules/characterframe/options.lua
index 5268d52..c3ffd7d 100755
--- a/ElvUI_SLE/modules/characterframe/options.lua
+++ b/ElvUI_SLE/modules/characterframe/options.lua
@@ -53,10 +53,36 @@ local function configTable()
 						order = 3,
 						type = 'toggle',
 						name = L["Show Background Image"],
-						--desc = L["Highlights equipment slot if an error has been found."],
 						get = function(info) return E.db.sle.characterframeoptions.showimage end,
 						set = function(info, value) E.db.sle.characterframeoptions.showimage = value; CFO:ArmoryFrame_DataSetting(); end,
 					},
+					dropdown = {
+						type = 'select',
+						name = L['Background picture'],
+						order = 4,
+						disabled = function() return not E.db.sle.characterframeoptions.showimage end,
+						values = {
+							['SPACE'] = 'Space',
+							['CUSTOM'] = L["Custom"],
+						},
+						get = function() return E.db.sle.characterframeoptions.image.dropdown end,
+						set = function(_, value)
+							E.db.sle.characterframeoptions.image.dropdown = value; CFO:ArmoryFrame_DataSetting();
+						end,
+
+					},
+					custom = {
+						order = 5,
+						type = 'input',
+						width = 'full',
+						name = L["Texture"],
+						desc = L["Set the texture to use in this frame. Requirements are the same as the chat textures."],
+						disabled = function() return E.db.sle.characterframeoptions.image.dropdown ~= "CUSTOM" and not E.db.sle.characterframeoptions.showimage end,
+						set = function(info, value)
+							E.db.sle.characterframeoptions.image.custom = value;
+							CFO:ArmoryFrame_DataSetting();
+						end,
+					},
 				},
 			},
 			itemlevel = {