View Single Post
12-04-08, 10:58 AM   #282
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by ObbleYeah View Post
I've been working on cleaning my code up for a while and my health update is the final bit to do :P

Tried it but getting the error: bad argument #1 to 'unpack' (table expected, got number)
wups, forgot how UnitSelectionColor returned

Code:
local color
if(UnitIsPlayer(unit)) then
	local localized, english = UnitClass(unit)
	color = self.colors.class[english]
else
	color = {UnitSelectionColor(unit)}
end

self.Health.bg:SetVertexColor(unpack(color))

if(self.Portraitglosst) then
	self.Portraitglosst:SetVertexColor(unpack(color))
end