M4: Added console command to set boonsville time for triggering events

This commit is contained in:
Paul Gilbert 2024-02-24 12:05:11 -08:00
parent 41d87f2178
commit f36f388791
2 changed files with 14 additions and 0 deletions

View File

@ -29,6 +29,7 @@ namespace Burger {
Console::Console() : M4::Console() {
registerCmd("global", WRAP_METHOD(Console, cmdGlobal));
registerCmd("test", WRAP_METHOD(Console, cmdTest));
registerCmd("time", WRAP_METHOD(Console, cmdTime));
}
bool Console::cmdGlobal(int argc, const char **argv) {
@ -58,5 +59,17 @@ bool Console::cmdTest(int argc, const char **argv) {
return true;
}
bool Console::cmdTime(int argc, const char **argv) {
if (argc == 2) {
int newTime = atol(argv[1]);
_G(flags).set_boonsville_time(newTime - 1);
return false;
} else {
debugPrintf("Current time is %d\n", _G(flags)[kBoonsvilleTime]);
return true;
}
}
} // End of namespace Burger
} // End of namespace M4

View File

@ -32,6 +32,7 @@ class Console : public M4::Console {
private:
bool cmdTest(int argc, const char **argv);
bool cmdGlobal(int argc, const char **argv);
bool cmdTime(int argc, const char **argv);
public:
Console();