bar.aura = aura |
|
-- Configure |
bar:SetMinMaxValues(0, aura.duration) |
bar:SetValue(aura.expirationTime - GetTime()) |
if bar.aura.noTime then |
bar:SetMinMaxValues(0, 1) |
bar:SetValue(1) |
else |
if self.AuraBars.scaleTime then |
local maxvalue = math.min(self.AuraBars.scaleTime, bar.aura.duration) |
bar:SetMinMaxValues(0, maxvalue) |
bar:SetWidth( |
( maxvalue / self.AuraBars.scaleTime ) * |
( ( self.AuraBars.auraBarWidth or self.AuraBars:GetWidth() ) - |
( bar:GetHeight() + self.AuraBars.gap or 0 ) ) ) -- icon size + gap |
else |
bar:SetMinMaxValues(0, bar.aura.duration) |
end |
bar:SetValue(bar.aura.expirationTime - GetTime()) |
end |
|
bar.icon:SetTexture(aura.icon) |
bar.icon:SetTexture(bar.aura.icon) |
|
local spellText |
if(aura.count > 1) then |
spellText = string.format("%s [%d]", ShortenedSpellName(aura.name,20), aura.count) |
if(bar.aura.count > 1) then |
spellText = string.format("%s [%d]", ShortenedSpellName(aura.name,20), bar.aura.count) |
else |
spellText = ShortenedSpellName(aura.name,20) |
spellText = ShortenedSpellName(bar.aura.name,20) |
end |
|
bar.spellname:SetText(spellText) |
bar.spelltime:SetText(FormatTime(aura.expirationTime-GetTime())) |
bar.spelltime:SetText(FormatTime(bar.aura.expirationTime-GetTime())) |
|
-- Colour bars |
local r, g, b = 0.2, 0.6, 1.0 -- Colour for buffs (This is Magic Blue) |
local bgMod = 0.5 |
if(helpOrHarm == "HARMFUL") then |
local debuffType = aura.debuffType and aura.debuffType or "none" |
local debuffType = bar.aura.debuffType and bar.aura.debuffType or "none" |
r, g, b = DebuffTypeColor[debuffType].r, DebuffTypeColor[debuffType].g, DebuffTypeColor[debuffType].b |
end |
bar:SetStatusBarColor(r, g, b) |