View Single Post
04-03-09, 09:42 AM   #964
Guardix
A Cyclonian
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 42
Originally Posted by nin View Post
hmm yeah that sounds right... any tip on how to solve that easy or would i need to recode a lot of stuff? :P

Guess i was using a lazy way to get all names classcolored but my target, it works as intended just annoying with that message.

gonna see how other people go about in their layouts, best way to learn ^^

thanks..
You can use the UnitIsPlayer() function to determine whether the unit is a player or not.

if unit=="target" then
self.Name:SetTextColor(1,1,1)

elseif UnitIsPlayer(unit) then
local _, class = UnitClass(unit)
color = self.colors.class[class]
self.Name:SetTextColor(color[1], color[2], color[3])
else
self.Name:SetTextColor(0,1,0) -- green
end