look for updateAuraButton function
lua Code:
icon.overlay:SetTexture(.2,.2,.2)
if isDebuff then
local color = DebuffTypeColor[dtype] or { r=.1, g=.1, b=.1 }
icon.overlay:SetTexture(color.r, color.g, color.b)
end
icon.overlay:Show()
and a default UI DebuffTypeColor array
lua Code:
DebuffTypeColor = { };
DebuffTypeColor["none"] = { r = 0.80, g = 0, b = 0 };
DebuffTypeColor["Magic"] = { r = 0.20, g = 0.60, b = 1.00 };
DebuffTypeColor["Curse"] = { r = 0.60, g = 0.00, b = 1.00 };
DebuffTypeColor["Disease"] = { r = 0.60, g = 0.40, b = 0 };
DebuffTypeColor["Poison"] = { r = 0.00, g = 0.60, b = 0 };
DebuffTypeColor[""] = DebuffTypeColor["none"];
visibility: add that code to layout function, as i know we can change alpha in combat, so use it
lua Code:
self:SetScript('OnUpdate', function(self, elapsed)
if not self:IsShown() then return end
self.st = elapsed + (self.st or 0)
if self.st > .2 then
local h, mh = UnitHealth(self.unit) or 1, UnitMaxHealth(self.unit) or 100
local perc = h/(mh/100)
if perc < 100 or InCombatLockdown() or UnitAffectingCombat('player') then
self:SetAlpha(1)
else
self:SetAlpha(0)
end
self.st = 0
end
end)