View Single Post
11-14-15, 08:03 PM   #19
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Rather than making the script dependent on your panel name, just use the "self" that's passed into your panel's script and rename the "self" parameter in the hook function something else, since it's not used anyway:

Code:
hooksecurefunc(Stuf.units.target.hpbar.bar, "SetVertexColor", function(bar, ...)
         self.bg:SetVertexColor(...)
    end)
^ Now "self.bg" should be fine, since "self" automatically refers to the panel the script is set on, and isn't overwritten by a different "self".
__________________
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