Originally Posted by Froali
Hi there,
I'm fairly new to the ESO Ui API and stumbled upon the ZO_PreHook function to take action before some function is processed. Is there an similiar function to take action after some function is finished? I was looking for something like ZO_PostHook, but didn't find anything using zGoo.
Some hints or workarounds would be nice
Froali
|
I think you just have to make your own postHook. Only tested this in the Lua emulator..
Code:
foo = function()
print("Foo")
end
local bar = function()
print("Bar")
end
local postHook = function(funcName, callback)
local tmp = _G[funcName]
_G[funcName] = function()
tmp()
callback()
end
end
postHook("foo", bar)
foo() -- Prints "Foo\nBar"