Thread: Inverted health
View Single Post
12-10-14, 08:37 PM   #3
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
Originally Posted by Phanx View Post
If you want anything other than the coloring oUF provides, you have to do it yourself in a PostUpdate or Override function. Based on your description:



The simplest way to achieve that would be to let oUF do its thing, and then just re-color the health bar (but not its background) yourself in your PostUpdate function.
I seem to have my blonde days, don't I?

I kept on trying though, but got lost in all of it. I actually made the booboo of trying to read about 15 layouts and making sense of it. It's bad.

I think I'll just scratch what I currently have and start again properly. (Seems to be a trend, doesn't it?)

Is there actually a recommended way-to-go?
I mix declaring a local as frame and then register with oUF and using the oUF "globals".

eg (drycode btw)
Lua Code:
  1. local hpbar = self:CreateStatusbar(nil, 'Frame')
  2. self.Health = hpbar

or

Lua Code:
  1. self.Health = self:CreateStatusbar(nil, 'Frame')

I assumed less code is less CPU cycles, but localising everything has more advantages - so I keep feeling rather torn between them. Since I pull the entire oUF namespace into a local; I kinda figured it was ok, but I could be wrong - easily.
__________________
  Reply With Quote