View Single Post
09-16-09, 05:31 AM   #1179
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Originally Posted by Waverian View Post
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.
Thanks, that's exactly the info I was hoping for