Quantcast

Added an option group under general for loot histroy

Darthpred [10-15-12 - 09:47]
Added an option group under general for loot histroy
Filename
ElvUI_SLE/ElvUI_SLE.lua
ElvUI_SLE/modules/options.lua
diff --git a/ElvUI_SLE/ElvUI_SLE.lua b/ElvUI_SLE/ElvUI_SLE.lua
index c19d9cc..82d8392 100644
--- a/ElvUI_SLE/ElvUI_SLE.lua
+++ b/ElvUI_SLE/ElvUI_SLE.lua
@@ -19,6 +19,7 @@ end

 function SLE:LootShow() --Needs to be run on PLAYER_ENTERING_WORLD event = loading screen ends. Also need a module assinged.
 	local inInstance, instanceType = IsInInstance()
+	LootHistoryFrame:SetAlpha(E.db.sle.lootalpha or 1)
 	--local isDungeon = (instanceType == "party")
 	if (inInstance and (instanceType == "party" or "raid") and E.db.sle.lootwin) then --in instance with option enabled
 		LootHistoryFrame:Show()
diff --git a/ElvUI_SLE/modules/options.lua b/ElvUI_SLE/modules/options.lua
index 2700b3e..214d9db 100644
--- a/ElvUI_SLE/modules/options.lua
+++ b/ElvUI_SLE/modules/options.lua
@@ -3,6 +3,7 @@ local UF = E:GetModule('UnitFrames')
 local AB = E:GetModule('ActionBars')
 local CH = E:GetModule('Chat')
 local A = E:GetModule('Auras')
+local SLE = E:GetModule('SLE')

 --Main options group
 E.Options.args.sle = {
@@ -34,13 +35,30 @@ E.Options.args.sle = {
 					get = function(info) return E.db.datatexts.lfrshow end,
 					set = function(info, value) E.db.datatexts.lfrshow = value; end
 				},
-				lootwindow = {
-					order = 4,
+			},
+		},
+		lootwindow = {
+			order = 4,
+			type = "group",
+			name = L["Loot History"],
+			guiInline = true,
+			args = {
+				window = {
+					order = 1,
 					type = "toggle",
-					name = "Autoloot",
-					desc = "Enable/Disable Autoloot window",
+					name = L["Auto show/hide"],
+					desc = L["Automaticaly show loot histroy frame when in instance and hide it when out"],
 					get = function(info) return E.db.sle.lootwin end,
-					set = function(info, value) E.db.sle.lootwin = value; end
+					set = function(info, value) E.db.sle.lootwin = value; SLE:LootShow() end
+				},
+				alpha = {
+					order = 2,
+					type = "range",
+					name = L['Alpha'],
+					desc = L["Sets alpha of loot histroy frame."],
+					min = 0.2, max = 1, step = 0.1,
+					get = function(info) return E.db.sle.lootalpha end,
+					set = function(info, value) E.db.sle.lootalpha = value; SLE:LootShow() end,
 				},
 			},
 		},