View Single Post
07-01-10, 01:23 AM   #26
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
@Monolit
Easy one. Haste renamed some functions. Please read oUF/elements/health.lua
Search for "post" and you will find "PostUpdate(unit, min, max)"

So you can do
Code:
--lib.lua
      lib.PostUpdateHealth = function(s, unit, min, max)
        local r, g, b = oUF.ColorGradient(min/max, 1,0,0, .7,.41,.44, .3,.3,.3)
        s:SetStatusBarColor(r, g, b)
      end
Now you have 2 options. Edit the PostUpdateHealth function only to some units or to all of them.

If it should only be applied to some units then go to core.lua and add this to the style functions of the units you want to adjust.
Code:
--core.lua
self.Health.PostUpdate = lib.PostUpdateHealth
If you want that function in ANY unit you can even change the "lib.gen_hpbar"-function. Find:
Code:
    b:SetAllPoints(s)
    f.Health = s
and change that to
Code:
    b:SetAllPoints(s)
    s.PostUpdate = lib.PostUpdateHealth 
    f.Health = s
"s" is your health statusbar and gets handed over later to the self object which is represented by the variable "f" in the function, so f.Health is the same as self.Health.

~~~~~~~~~~~~

@vlakarados
SetManyAttributes is gone since 1.4
Just look at any lately released oUF 1.4 compatible layouts how they implement raid groups.
There is a new SpawnHeader() afaik.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 07-01-10 at 01:40 AM.
  Reply With Quote