View Single Post
10-11-20, 10:14 AM   #4
DahkCeles
A Cliff Giant
 
DahkCeles's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2020
Posts: 73
Although not applicable here since you found an event that works.... this is an alternative solution you could use when its necessary to defer an update:

Lua Code:
  1. local function doSomething()
  2.     -- do something
  3. end
  4.  
  5. local f = CreateFrame("Frame")
  6. f:RegisterEvent("SOME_EVENT")
  7. f:HookScript("OnEvent", function()
  8.     C_Timer.After(0, doSomething)  -- wait until the next frame to do something
  9. end)
  Reply With Quote