Inverted health
I am trying to learn - let's start off with that.
Now .colorHealth (and all others) seem only applicable to self.Health. But I would like to have self.Health have a set color (yes, dark as everyone else :P) and have self.Health.bg have the .colorHealth, .colorSmooth (etc). I tried in the simplest form obviously, but - no. I thought about doing it by changing the color tables and trying to get it right by using the multiplier on the background. But I am not sure if this is indeed the way to go. I am not looking for the straight answer, just a pointer so I can "discover" it. (It helps me understand.) @Phanx, I love your code, but it's way too advanced for me - the color part. Spent an hour trying to make sense of it, and it's just not getting in there :P |
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:
Quote:
|
Quote:
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:
or Lua Code:
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. |
I'd go with
Code:
local hp = CreateFrame("StatusBar", nil, self) |
To help with the inverted hp idea, Phanx suggestion would work like this.
Code:
self.Health.colorClass = true -- let oUF color the health bar Code:
local function HealthPostUpdate(health, unit, min, max) |
I honestly can't -- why didn't I actually consider that Override .... Simple as - well everything.
I -- have no excuse. Really... Thank you guys and girl . (I literally had this face btw without the fur though ;)) |
Quote:
|
Quote:
Code:
self:CreateStatusbar(nil, 'Frame') Code:
local hpbar = CreateFrame("StatusBar", nil, self) |
All times are GMT -6. The time now is 05:47 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI