View Single Post
09/02/14, 12:20 PM   #1
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,188
Event post hook -> Start my event function after all other addons using an event?

Hi, I've found a thread about a post hook, where a funcion will be executed after another function call.

Code:
local postHook = function(funcName, callback)
  local tmp = _G[funcName]
  _G[funcName] = function(...)
    tmp(...)
    callback()
  end
end
Is it possible to do the same with events? I would like to fire my function from the event EVENT_INVENTORY_SINGLE_SLOT_UPDATE.
But I need to be sure all other, or at least 1, addon(s) have executed their code already before my function will be called. Otherwise some data is missing or wrong.

I tried to do it with a simple zo_callLater () function, giving it 2 seconds time, but this is not working and seems not to be the good way :-)

Is there any way I can achieve this?

Thanks for your help.
  Reply With Quote