Drycoded, haven't tested anything...
Lua Code:
local IDs = {
[233490] = true,
[233496] = true,
[233497] = true,
[233498] = true,
[233499] = true,
}
local UAs = {}
local function UpdateDebuff(self)
self:ReleaseAll()
for i = 1, 40 do
local _, _, icon, count, _, duration, expires, _, _, _, spellID = UnitDebuff("target", i, "PLAYER")
-- if there's no spellID it means there's less than 40 auras
if not spellID then
break
end
-- search for UAs
if IDs[spellID] and duration and duration >= 0 then
UAs[#UAs + 1] = {
id = spellID,
icon = icon,
count = count or 1,
start = expires - duration,
duration = duration,
}
end
end
-- do something w/ present auras
local prevButton
for i = 1, #UAs do
local info = UAs[i]
local button = self:Acquire()
button.spellID = info.id
button.cd:SetCooldown(info.start, info.duration)
button.icon:SetTexture(info.icon)
button.count:SetText(info.count > 1 and info.count or "")
if prevButton then
button:SetPoint("LEFT", prevButton, "RIGHT", gap, 0)
else
button:SetPoint("LEFT")
end
button:Show()
prevButton = button
UAs[i] = nil
end
self:SetSize(self.numActiveObjects > 0 and ((size + gap) * self.numActiveObjects) - gap or 0, size)
end
Originally Posted by Layback_
(1) What if my spell doesn't get included within those 40 debuffs?
|
Highly unlikely O_o
Originally Posted by Layback_
(2) Would there be a variable that stores number of unit's (not only target's, but for others' as well) buff/debuff?
I mean something like BUFF_ACTUAL_DISPLAY/DEBUFF_ACTUAL_DISPLAY for player.
|
IIRC, nope...