feat(whoa): implement the ability to shut down the client gracefully, saving CVars upon exit

This commit is contained in:
phaneron 2025-04-15 20:00:50 -04:00
parent 17ccf2a8bb
commit 0105c72da0
11 changed files with 186 additions and 25 deletions

View file

@ -97,8 +97,6 @@ void ClientRegisterConsoleCommands() {
ConsoleCommandRegister("reloadUI", CCommand_ReloadUI, GRAPHICS, nullptr);
ConsoleCommandRegister("perf", CCommand_Perf, DEBUG, nullptr);
const auto game = CATEGORY::GAME;
Client::g_accountNameVar = CVar::Register(
"accountName",
"Saved account name",
@ -180,7 +178,6 @@ void ClientPostClose(int32_t a1) {
int32_t DestroyEngineCallback(const void* a1, void* a2) {
// TODO
return 1;
}
@ -625,6 +622,17 @@ int32_t InitializeGlobal() {
return 1;
}
void DestroyGlobal() {
// TODO
OsTimeShutdown();
EventDestroy();
ConsoleDeviceDestroy();
CVar::Destroy();
// TODO
}
void CommonMain() {
StormInitialize();
@ -659,7 +667,7 @@ void CommonMain() {
if (InitializeGlobal()) {
EventDoMessageLoop();
// TODO: DestroyGlobal();
DestroyGlobal();
}
// TODO: