View Single Post
05/12/14, 12:11 PM   #53
Aiiane
 
Aiiane's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 19
Originally Posted by CatoTheElder View Post
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.

Last edited by Aiiane : 05/12/14 at 12:18 PM.
  Reply With Quote