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.
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"
Any chance you could give a code example of it in use in the game?
Like, any way to hook the mouse menu that appears when you right click an item in your inventory, or a way to see what 'command' is executed when you select any of those menu options?
Tried to dig through it in Zgoo but couldn't really get very far with it.