From 5e68cd980021aaf1a1b7b9cfa8b917be2f7915e9 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Sat, 6 Jan 2007 01:49:38 +0000 Subject: [PATCH] Added group conditions to the buff edit window, and ensured all conditions are being displayed --- PerfectRaid_Buffs.lua | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/PerfectRaid_Buffs.lua b/PerfectRaid_Buffs.lua index 952d7a0..0588fe0 100644 --- a/PerfectRaid_Buffs.lua +++ b/PerfectRaid_Buffs.lua @@ -44,6 +44,11 @@ end function Buffs:Enable() self:RegisterEvent("UNIT_AURA") + self:RegisterEvent("RAID_ROSTER_UPDATE") + if GetNumRaidMembers() > 0 then + self:RAID_ROSTER_UPDATE() + end + self:UpdateBuffTable() for unit in pairs(frames) do @@ -67,6 +72,20 @@ function Buffs:PERFECTRAID_TAB_CHANGED(old,new) end end +local raidLookup = {} +for i=1,40 do + raidLookup[i] = "raid"..i +end +function Buffs:RAID_ROSTER_UPDATE() + if GetNumRaidMembers() > 0 then + for i=1,GetNumRaidMembers() do + local group = select(3, GetRaidRosterInfo(i)) + local unit = raidLookup[i] + raidLookup[unit] = group + end + end +end + function Buffs:ConfigureButton(button) local font = button:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall") font:SetPoint("LEFT", button.rightbox, "LEFT", 3, 0) @@ -121,9 +140,10 @@ function Buffs:UNIT_AURA(event, unit) local class = select(2, UnitClass(unit)) local conds = self.conditions + local group = raidLookup[unit] if checkcond then for i,name in pairs(entry.cond) do - if conds[name] and conds[name](unit,class) then + if conds[name] and conds[name](unit,class,group) then if num and num > 1 then table.insert(work, entry.colortext .. "(" .. num .. ")") else -- 1.7.9.5