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) 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. |
I wanted the same thing once. I don't think I've come to a conclusion, I presumed handlers are called in the order they're registered, but as you have problems, it probably doesn't work that way.
If you can't find any better solution, I suggest a cheat: - OptionallyDepend on the required addon (assuming it registers the event in its EVENT_ADD_ON_LOADED) - unregister the event, register your own, and call the addon's function from yours -- obviously impossible if that addon's handler is local; and here you made me thinking why am I always making handlers local :D |
The function of that other addon is local, as it should be. Too bad :-)
|
All times are GMT -6. The time now is 08:14 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI