Originally Posted by CatoTheElder
As for your question regarding OnUpdate() usage. This turns out to be a fairly common thing, which is quite difficult to implement. Usually, this is intentional, as it opens up a lot of potential abuse for botting. As long as zo_CallLater is available, that should be used. This will let the timing function be done in the engine, as a general rule of thumb, the more you can pass to the engine, the better.
|
FWIW, zo_callLater is just a wrapper around an OnUpdate check. The zo_callLater function is implemented in Lua as part of the base game's Lua UI modules.
Specifically, zo_callLater is a wrapper around a function that calls EVENT_MANAGER:RegisterForUpdate to register a function which then calls EVENT_MANAGER:UnregisterForUpdate the first time it runs. EVENT_MANAGER:RegisterForUpdate in turn is a wrapper around OnUpdate which checks to see if it's time to fire various callbacks after each frame.