Event
Some checks failed
Build Dusk / run-tests (push) Failing after 1m44s
Build Dusk / build-linux (push) Successful in 1m50s
Build Dusk / build-psp (push) Failing after 1m53s

This commit is contained in:
2026-01-27 10:41:32 -06:00
parent c7b9a53535
commit 9b73f1717f
6 changed files with 227 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "script/scriptcontext.h"
#include "time/time.h"
int moduleTimeGetDelta(lua_State *L) {
assertNotNull(L, "Lua state cannot be NULL");
lua_pushnumber(L, TIME.delta);
return 1;
}
int moduleTimeGetTime(lua_State *L) {
assertNotNull(L, "Lua state cannot be NULL");
lua_pushnumber(L, TIME.time);
return 1;
}
void moduleTime(scriptcontext_t *ctx) {
assertNotNull(ctx, "Script context cannot be NULL");
scriptContextRegFunc(ctx, "timeGetDelta", moduleTimeGetDelta);
scriptContextRegFunc(ctx, "timeGetTime", moduleTimeGetTime);
}