View Single Post
11-14-15, 07:06 AM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If your goal is just "make this thing the same color as that other thing, always" then you shouldn't be rewriting tons of code -- just grab the color from "that other thing" and apply it to "this thing":

Lua Code:
  1. hooksecurefunc(ThatOtherThing, "SetStatusBarColor", function(self, ...)
  2.      ThisThing:SetVertexColor(...)
  3. end)

You should be able to put that in your OnLoad script, as long as "that other thing" already exists when your panel loads.

Also, the above code assumes that "that other thing" is actually a StatusBar object. If it's just a texture, you'd need to hook SetVertexColor instead of SetStatusBarColor.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote