From f29f2b7720143b8ae7dc155633415db052064898 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Mon, 4 Mar 2013 14:43:31 +0400 Subject: [PATCH] RL, ML, Assist announce --- ElvUI_SLE/modules/loot/loot.lua | 19 +++++++++++++++++-- ElvUI_SLE/modules/loot/options.lua | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) 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 }, -- 1.7.9.5