Use GetRaidBuffInfo() to determine if a Buff is missing or not available

This commit is contained in:
Areko 2014-12-12 15:04:48 +01:00
parent 714393167f
commit 417a817f15
1 changed files with 39 additions and 26 deletions

View File

@ -124,6 +124,8 @@ local BrokerConsolidatedBuffs = LDB:NewDataObject("Broker_ConsolidatedBuffs", {
tooltip:AddSeparator() tooltip:AddSeparator()
--tooltip:AddLine(" ") --tooltip:AddLine(" ")
local buffmask = GetRaidBuffInfo() or 0
local mask = 1
for i = 1, NUM_LE_RAID_BUFF_TYPES do for i = 1, NUM_LE_RAID_BUFF_TYPES do
local name, rank, texture, duration, expiration, spellId, slot = GetRaidBuffTrayAuraInfo(i) local name, rank, texture, duration, expiration, spellId, slot = GetRaidBuffTrayAuraInfo(i)
local c local c
@ -131,7 +133,11 @@ local BrokerConsolidatedBuffs = LDB:NewDataObject("Broker_ConsolidatedBuffs", {
if name then if name then
c = "FF00FF00" c = "FF00FF00"
else else
c = "FFFF0000" if bit.band(buffmask, mask) > 0 then
c = "FFFF0000"
else
c = "FF888888"
end
end end
local classes = "" local classes = ""
@ -151,6 +157,8 @@ local BrokerConsolidatedBuffs = LDB:NewDataObject("Broker_ConsolidatedBuffs", {
--tooltip:AddLine("\124T"..defaults[i][1]..":0\124t \124c"..c.._G["RAID_BUFF_"..i].."\124r "..list) --tooltip:AddLine("\124T"..defaults[i][1]..":0\124t \124c"..c.._G["RAID_BUFF_"..i].."\124r "..list)
--tooltip:AddLine(" "..list) --tooltip:AddLine(" "..list)
mask = bit.lshift(mask, 1)
end end
tooltip:SmartAnchorTo(self) tooltip:SmartAnchorTo(self)
@ -164,11 +172,14 @@ local BrokerConsolidatedBuffs = LDB:NewDataObject("Broker_ConsolidatedBuffs", {
OnClick = function(button) OnClick = function(button)
local missing = "" local missing = ""
local buffmask = GetRaidBuffInfo() or 0
local mask = 1
for i = 1, NUM_LE_RAID_BUFF_TYPES do for i = 1, NUM_LE_RAID_BUFF_TYPES do
if not GetRaidBuffTrayAuraInfo(i) then if not GetRaidBuffTrayAuraInfo(i) and bit.band(buffmask, mask) > 0 then
missing = missing .. _G["RAID_BUFF_"..i] ..", " missing = missing .. _G["RAID_BUFF_"..i] ..", "
end end
mask = bit.lshift(mask, 1)
end end
if missing ~= "" then if missing ~= "" then
@ -195,8 +206,10 @@ local function updateBuffs(self, event, unitID)
end end
end end
BrokerConsolidatedBuffs.text = c.."/"..NUM_LE_RAID_BUFF_TYPES local buffcount = select(2, GetRaidBuffInfo())
BrokerConsolidatedBuffs.value = c.."/"..NUM_LE_RAID_BUFF_TYPES -- for ElvUI datatexts
BrokerConsolidatedBuffs.text = c.."/"..max(c, buffcount)
BrokerConsolidatedBuffs.value = c.."/"..max(c, buffcount) -- for ElvUI datatexts
end end
end end