feat: add OnUpdate frame script for per-frame addon callbacks

Frames can now set an OnUpdate script that fires every frame with
the elapsed time as an argument. This enables addon timers, polling,
and animations.

  local f = CreateFrame("Frame")
  f:SetScript("OnUpdate", function(self, elapsed)
      -- called every frame with deltaTime
  end)

OnUpdate only fires for visible frames (frame:Hide() pauses it).
Tracked in __WoweeOnUpdateFrames table, dispatched via
LuaEngine::dispatchOnUpdate() called from the Application main loop.
This commit is contained in:
Kelsi 2026-03-20 12:07:22 -07:00
parent c7e25beaf1
commit 1f8660f329
5 changed files with 66 additions and 0 deletions

View file

@ -1002,6 +1002,9 @@ void Application::update(float deltaTime) {
gameHandler->update(deltaTime);
}
});
if (addonManager_ && addonsLoaded_) {
addonManager_->update(deltaTime);
}
// Always unsheath on combat engage.
inGameStep = "auto-unsheathe";
updateCheckpoint = "in_game: auto-unsheathe";