View Single Post
11-15-15, 02:25 AM   #20
Soulcleaver
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 65
Originally Posted by Phanx View Post
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".
gave me an error..

Code:
Message: [string "Targetbottom_OnLoad"]:1: hooksecurefunc(): SetVertexColor is not a function
Time: 11/15/15 09:25:16
Count: 4
Stack: [C]: in function `hooksecurefunc'
[string "Targetbottom_OnLoad"]:1: in function `y'
Interface\AddOns\kgPanels\kgPanels.lua:1115: in function `SetupScript'
Interface\AddOns\kgPanelsConfig\PanelHelper.lua:1330: in function <Interface\AddOns\kgPanelsConfig\PanelHelper.lua:1327>
(tail call): ?
[C]: ?
[string "safecall Dispatcher[2]"]:9: in function <[string "safecall Dispatcher[2]"]:5>
(tail call): ?
...nfig-3.0\AceConfigDialog-3.0\AceConfigDialog-3.0.lua:799: in function <...nfig-3.0\AceConfigDialog-3.0\AceConfigDialog-3.0.lua:614>
(tail call): ?
[C]: ?
[string "safecall Dispatcher[3]"]:9: in function <[string "safecall Dispatcher[3]"]:5>
(tail call): ?
...terface\AddOns\Masque\Libs\AceGUI-3.0\AceGUI-3.0.lua:314: in function `Fire'
...AceGUI-3.0\widgets\AceGUIWidget-MultiLineEditBox.lua:67: in function <...AceGUI-3.0\widgets\AceGUIWidget-MultiLineEditBox.lua:64>

Locals: <none>
  Reply With Quote