View Single Post
09-15-09, 08:11 PM   #1177
Waverian
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 188
You'd only need to use PostUpdateHealth for the health bar background. For everything else you don't need (and shouldn't use) PostUpdateHealth.

Code:
self.Health.colorTapping
self.Power.colorPower
For class colored names just use a tag function, and use :SetFont on your fontstring to take care of the outline.

Code:
-- drycode
oUF.TagEvents['[mylayoutname]'] = oUF.TagEvents['[name]']
oUF.Tags['[mylayoutname]'] = function(unit)
	local c = RAID_CLASS_COLORS[select(2, UnitClass(unit))]
	return format('|cff%02x%02x%02x%s', c.r * 255, c.g * 255, c.b * 255, UnitName(unit))
end

edit: PostUpdateHealth would probably be overkill for the class colored background as well, since you don't need it to be called extraneously after health updates. It's a much cleaner solution to register your own event, imo... Not that it's significant either way.

Last edited by Waverian : 09-15-09 at 08:13 PM.