Quantcast

RL, ML, Assist announce

Darthpred [03-04-13 - 10:43]
RL, ML, Assist announce
Filename
ElvUI_SLE/modules/loot/loot.lua
ElvUI_SLE/modules/loot/options.lua
diff --git a/ElvUI_SLE/modules/loot/loot.lua b/ElvUI_SLE/modules/loot/loot.lua
index f656230..f821a65 100644
--- a/ElvUI_SLE/modules/loot/loot.lua
+++ b/ElvUI_SLE/modules/loot/loot.lua
@@ -5,6 +5,22 @@ local check = false
 local t = 0
 local loottemp = {}

+function LT:Check()
+	local name, rank, isML
+	for x = 1, GetNumGroupMembers() do
+		name, rank, _, _, _, _, _, _, _, _, isML = GetRaidRosterInfo(x)
+		print(name, rank, isML)
+		if name == UnitName("player") and isML then
+			return true
+		elseif name == UnitName("player") and rank == 1 then
+			return true
+		elseif name == UnitName("player") and rank == 2 then
+			return true
+		end
+	end
+	return false
+end
+
 function LT:Announce()
 	local name = {}
 	local loot = {}
@@ -15,8 +31,7 @@ function LT:Announce()
 	local inGroup, inRaid, inPartyLFG = IsInGroup(), IsInRaid(), IsPartyLFG()
 	local p, chat
 	if not inGroup then return end -- not in group, exit.
-	local masterlooterRaidID = select(3, GetLootMethod())
-	if (masterlooterRaidID ~= nil and UnitName("raid"..masterlooterRaidID) == UnitName("player") and E.db.sle.loot.auto) or (IsLeftControlKeyDown() and (IsInGroup() or IsInRaid())) then
+	if (LT:Check() and E.db.sle.loot.auto) or (IsLeftControlKeyDown() and (IsInGroup() or IsInRaid())) then
 		for i = 1, GetNumLootItems() do
 			if GetLootSlotType(i) == 1 then
 				for j = 1, t do
diff --git a/ElvUI_SLE/modules/loot/options.lua b/ElvUI_SLE/modules/loot/options.lua
index 39f1594..0a9994d 100644
--- a/ElvUI_SLE/modules/loot/options.lua
+++ b/ElvUI_SLE/modules/loot/options.lua
@@ -30,6 +30,7 @@ E.Options.args.sle.args.loot = {
 			type = "toggle",
 			name = L["Auto Announce"],
 			desc = L["Automatically announce when loot window opens (Master Looter Only)."],
+			disabled = function() return not E.private.sle.loot.enable end,
 			get = function(info) return E.db.sle.loot.auto end,
 			set = function(info, value) E.db.sle.loot.auto = value; end
 		},