This is a example of what I am using and it errors out. any help to understand what I am doing wrong would be greatly appreciated
-- Hooking WoW API
function ButtonMagic:OnEnable()
-- AceHook:SecureHook([object], method, [handler])
self:SecureHook( "ActionButton_OnUpdate" );
self:SecureHook( "ActionButton_Update", "ActionButton_Update", "ActionButton_UpdateUsable" );
self:SecureHook( "ActionButton_UpdateUsable" );
end
-- Custom API Handlers
function ButtonMagic:ActionButton_OnUpdate()
-code Here
end
function ButtonMagic:ActionButton_UpdateUsable()
-- Code here
end
resulting in this error
Message: ..\AddOns\ButtonMagic\ButtonMagic.lua line 201:
Usage: SecureHook([object], method, [handler]): 'handler' - Handler specified does not exist at self[handler]
The first argument shouldn't be passed. All you need is the name of the function and the name of your own handler method.
The first parameter is an object, like the docs say. It's used when the function you're hooking is itself a method of another object. For example, if I wanted my addon to securehook your code, I'd do something like
resulting in this error
The first argument shouldn't be passed. All you need is the name of the function and the name of your own handler method.
The first parameter is an object, like the docs say. It's used when the function you're hooking is itself a method of another object. For example, if I wanted my addon to securehook your code, I'd do something like
self:SecureHook (ButtonMagic, "OneOfYourMethods", "OneOfMyMethods")