mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
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:
parent
c7e25beaf1
commit
1f8660f329
5 changed files with 66 additions and 0 deletions
|
|
@ -32,6 +32,9 @@ public:
|
|||
// Try to dispatch a slash command via SlashCmdList. Returns true if handled.
|
||||
bool dispatchSlashCommand(const std::string& command, const std::string& args);
|
||||
|
||||
// Call OnUpdate scripts on all frames that have one.
|
||||
void dispatchOnUpdate(float elapsed);
|
||||
|
||||
lua_State* getState() { return L_; }
|
||||
bool isInitialized() const { return L_ != nullptr; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue