Originally Posted by Lùinwë
I would like to add reaction color on health bars for units of the other faction of the player. I tried different things like UnitFactionGroup or UnitCanAttack to do that but nothing works fine. I use Caellian actually.
How can I include this function in the code please ?
PS : Sorry for my poor english
|
I believe you're looking for something like this:
Code:
if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) or not UnitIsConnected(unit)) or not (unit == 'target') then
self:SetBackdropColor(0, 0, 0, .8)
else
local r, g, b = UnitSelectionColor(unit)
self:SetBackdropColor(r, g, b, .5)
end
I use this to set the backdrop of my frame to that color, though you could do it to other frames. I believe that was originally written by Haste, or something like it.