Quantcast

Need to add an or check still but darth is rushing me

Repooc [08-09-14 - 00:54]
Need to add an or check still but darth is rushing me
Filename
ElvUI_SLE/defaults/profile.lua
ElvUI_SLE/modules/loot.lua
ElvUI_SLE/options/loot_c.lua
diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua
index 2836e24..235d1f7 100644
--- a/ElvUI_SLE/defaults/profile.lua
+++ b/ElvUI_SLE/defaults/profile.lua
@@ -219,8 +219,9 @@ P['sle'] = {
 	['loot'] = {
 		['enable'] = false,
 		['autoconfirm'] = false,
-		['autogreed'] = false,
 		['autode'] = false,
+		['autogreed'] = false,
+		['autoqlty'] = 2,
 		['bylevel'] = false,
 		['level'] = 1,
 		['announcer'] = {
diff --git a/ElvUI_SLE/modules/loot.lua b/ElvUI_SLE/modules/loot.lua
index f44d484..5afa7c4 100644
--- a/ElvUI_SLE/modules/loot.lua
+++ b/ElvUI_SLE/modules/loot.lua
@@ -139,6 +139,7 @@ local function HandleRoll(event, id)

 	if IsXPUserDisabled() then MaxPlayerLevel = PlayerLevel end
 	if (db.bylevel and PlayerLevel < db.level) and PlayerLevel ~= MaxPlayerLevel then return end
+
 	if db.bylevel then
 		if IsEquippableItem(link) then
 			local _, _, _, ilvl, _, _, _, _, slot = GetItemInfo(link)
@@ -147,11 +148,12 @@ local function HandleRoll(event, id)
 			if quality ~= 7 and matchItemLevel < ilvl then return end
 		end
 	end
-	if quality == LE_ITEM_QUALITY_UNCOMMON then
+
+	if quality == db.autoqlty then --need to add check for 2 or 3 atm it will do one or the other
 		if db.autode and disenchant then
 			RollOnLoot(id, 3)
 		else
-			RollOnLoot(id, 2)
+			RollOnLoot(id, db.autoqlty)
 		end
 	end
 end
diff --git a/ElvUI_SLE/options/loot_c.lua b/ElvUI_SLE/options/loot_c.lua
index 6eb931a..bbd0595 100644
--- a/ElvUI_SLE/options/loot_c.lua
+++ b/ElvUI_SLE/options/loot_c.lua
@@ -28,8 +28,21 @@ local function configTable()
 				get = function(info) return E.db.sle.loot.autoconfirm end,
 				set = function(info, value) E.db.sle.loot.autoconfirm = value; end,
 			},
-			autogreed = {
+			autoqlty = {
 				order = 4,
+				type = "select",
+				name = "Auto Roll Quality",
+				desc = "Sets the auto greed/disenchant quality\n\nUncommon: Rolls on Uncommon only\nRare: Rolls on Rares & Uncommon",
+				disabled = function() return not E.db.sle.loot.enable end,
+				get = function(info) return E.db.sle.loot.autoqlty end,
+				set = function(info, value) E.db.sle.loot.autoqlty = value; end,
+				values = {
+					['2'] = "|cff1EFF00"..ITEM_QUALITY2_DESC.."|r",
+					['3'] = "|cff0070DD"..ITEM_QUALITY3_DESC.."|r",
+				},
+			},
+			autogreed = {
+				order = 5,
 				type = "toggle",
 				name = "Auto Greed",
 				desc = "Automatically greed uncommon (green) quality items at max level",
@@ -38,7 +51,7 @@ local function configTable()
 				set = function(info, value) E.db.sle.loot.autogreed = value; end,
 			},
 			autode = {
-				order = 5,
+				order = 6,
 				type = "toggle",
 				name = "Auto Disenchant",
 				desc = "Automatically disenchant uncommon (green) quality items at max level",
@@ -47,7 +60,7 @@ local function configTable()
 				set = function(info, value) E.db.sle.loot.autode = value; end,
 			},
 			bylevel = {
-				order = 6,
+				order = 7,
 				type = "toggle",
 				name = "Roll based on level.",
 				desc = "This will auto-roll if you are above the given level if: You cannot equip the item being rolled on, or the ilevel of your equipped item is higher than the item being rolled on or you have an heirloom equipped in that slot",
@@ -56,7 +69,7 @@ local function configTable()
 				set = function(info, value) E.db.sle.loot.bylevel = value; end,
 			},
 			level = {
-				order = 7,
+				order = 8,
 				type = "range",
 				name = "Level to start auto-rolling from",
 				desc = "Automatically disenchant uncommon (green) quality items at max level",
@@ -66,17 +79,17 @@ local function configTable()
 				set = function(info, value) E.db.sle.loot.level = value; end,
 			},
 			space2 = {
-				order = 8,
+				order = 9,
 				type = 'description',
 				name = "",
 			},
 			space3 = {
-				order = 8,
+				order = 9,
 				type = 'description',
 				name = "",
 			},
 			announcer = {
-				order = 9,
+				order = 15,
 				type = "group",
 				name = L["Loot Announcer"],
 				args = {
@@ -143,7 +156,7 @@ local function configTable()
 				},
 			},
 			history = {
-				order = 10,
+				order = 20,
 				type = "group",
 				name = L["Loot Roll History"],
 				args = {