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:AddLine(" ")
local buffmask = GetRaidBuffInfo() or 0
local mask = 1
for i = 1, NUM_LE_RAID_BUFF_TYPES do
local name, rank, texture, duration, expiration, spellId, slot = GetRaidBuffTrayAuraInfo(i)
local c
@ -131,7 +133,11 @@ local BrokerConsolidatedBuffs = LDB:NewDataObject("Broker_ConsolidatedBuffs", {
if name then
c = "FF00FF00"
else
if bit.band(buffmask, mask) > 0 then
c = "FFFF0000"
else
c = "FF888888"
end
end
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(" "..list)
mask = bit.lshift(mask, 1)
end
tooltip:SmartAnchorTo(self)
@ -164,11 +172,14 @@ local BrokerConsolidatedBuffs = LDB:NewDataObject("Broker_ConsolidatedBuffs", {
OnClick = function(button)
local missing = ""
local buffmask = GetRaidBuffInfo() or 0
local mask = 1
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] ..", "
end
mask = bit.lshift(mask, 1)
end
if missing ~= "" then
@ -195,8 +206,10 @@ local function updateBuffs(self, event, unitID)
end
end
BrokerConsolidatedBuffs.text = c.."/"..NUM_LE_RAID_BUFF_TYPES
BrokerConsolidatedBuffs.value = c.."/"..NUM_LE_RAID_BUFF_TYPES -- for ElvUI datatexts
local buffcount = select(2, GetRaidBuffInfo())
BrokerConsolidatedBuffs.text = c.."/"..max(c, buffcount)
BrokerConsolidatedBuffs.value = c.."/"..max(c, buffcount) -- for ElvUI datatexts
end
end