View Single Post
11-14-15, 01:58 PM   #13
Soulcleaver
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 65
Originally Posted by Fizzlemizz View Post
If all you want is for your panel colour to change to the same as the healthbar colour whenever it changes then Phanx's method is the way to go.

It assumes the healthbar is a StatusBar widget and you know the name of it, which you should be able to get with /fstack, and that STUF is loaded before your panels OnLoad fires.

IF the name of the healthbar is say STUF_TargetHealth then in your panels OnLoad (delete the RegisterEvent and all the OnEvent code you have) and add:

Code:
    hooksecurefunc(STUF_TargetHealth, "SetStatusBarColor", function(self, ...)
         self.bg:SetVertexColor(...)
    end)
Every time the healthbar changes it will also change your panel colour.

You might need something additional depending on what you want to do when the target goes out-of-range.
Im really thankfull for all you guys help! I tried this but this gave me an error!

what did i do wrong now :P?

http://i.imgur.com/RbI9tSB.jpg
  Reply With Quote