View Single Post
02-21-09, 05:56 AM   #770
Dimpf
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jan 2009
Posts: 25
Originally Posted by Lùinwë View Post
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.