View Single Post
09/07/14, 06:28 AM   #3
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Klingo, the snippet you posted looks ripped out of context, and unlike what you described. isCompleted is assigned exactly once, never changes value, so that loop is either done immediately, or runs forever

I'd slightly modify Wykkyd's method. In your event handler, check if an update func is registered - if yes, return immediately (or note that the whole process needs restarting; depends on what your addon does with the event), otherwise do required preparations and register for update. In update you can check elapsed time, call other functions when they're due, and after the last one is finished, unregister (or restart if there was another event).
  Reply With Quote