View Single Post
04/04/14, 06:47 PM   #2
Dio
 
Dio's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 29
Originally Posted by Froali View Post
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"
  Reply With Quote