diff --git a/src/Components/Modules/Dvar.cpp b/src/Components/Modules/Dvar.cpp index e4f5ac53..c8625e68 100644 --- a/src/Components/Modules/Dvar.cpp +++ b/src/Components/Modules/Dvar.cpp @@ -310,9 +310,9 @@ namespace Components Utils::Hook::Call(0x4F52E0)(dvarName, value); } - void Dvar::Com_InitDvars_Hk() + void Dvar::CL_InitOnceForAllClients_Hk() { - Utils::Hook::Call(0x60AD10)(); + Utils::Hook::Call(0x404CA0)(); Dvar::RegistrationSignal(); } @@ -363,7 +363,7 @@ namespace Components Utils::Hook::Xor(0x42E398, Game::dvar_flag::DVAR_CHEAT | Game::dvar_flag::DVAR_ARCHIVE); //safeArea_horizontal Utils::Hook::Xor(0x42E3C4, Game::dvar_flag::DVAR_CHEAT | Game::dvar_flag::DVAR_ARCHIVE); //safeArea_vertical - Utils::Hook(0x60BB3A, Dvar::Com_InitDvars_Hk, HOOK_CALL).install()->quick(); + Utils::Hook(0x60BE5B, Dvar::CL_InitOnceForAllClients_Hk, HOOK_CALL).install()->quick(); // Don't allow setting cheat protected dvars via menus Utils::Hook(0x63C897, Dvar::SetFromStringByNameExternal, HOOK_CALL).install()->quick(); diff --git a/src/Components/Modules/Dvar.hpp b/src/Components/Modules/Dvar.hpp index 5080909c..95f2dd3e 100644 --- a/src/Components/Modules/Dvar.hpp +++ b/src/Components/Modules/Dvar.hpp @@ -65,7 +65,6 @@ namespace Components static void SaveArchiveDvar(const Game::dvar_t* var); static void DvarSetFromStringByNameStub(const char* dvarName, const char* value); - // Unable to do any earlier because SL system will not be active for string dvars - static void Com_InitDvars_Hk(); + static void CL_InitOnceForAllClients_Hk(); }; } diff --git a/src/Components/Modules/FastFiles.cpp b/src/Components/Modules/FastFiles.cpp index 39e5f31a..29bc4c66 100644 --- a/src/Components/Modules/FastFiles.cpp +++ b/src/Components/Modules/FastFiles.cpp @@ -574,7 +574,7 @@ namespace Components if (FastFiles::Current().empty() || !Dvar::Var("ui_zoneDebug").get()) return; auto* const font = Game::R_RegisterFont("fonts/consoleFont", 0); - float color[4] = { 1.0f, 1.0f, 1.0f, (Game::CL_IsCgameInitialized() ? 0.3f : 1.0f) }; + float color[4] = {1.0f, 1.0f, 1.0f, (Game::CL_IsCgameInitialized() ? 0.3f : 1.0f)}; auto FFTotalSize = *reinterpret_cast(0x10AA5D8); auto FFCurrentOffset = *reinterpret_cast(0x10AA608); diff --git a/src/Components/Modules/Friends.cpp b/src/Components/Modules/Friends.cpp index 23b965f0..f3ca5184 100644 --- a/src/Components/Modules/Friends.cpp +++ b/src/Components/Modules/Friends.cpp @@ -714,7 +714,7 @@ namespace Components } }); - Scheduler::Once([]() + Scheduler::OnGameInitialized([] { if (Steam::Proxy::SteamFriends) { diff --git a/src/Components/Modules/Node.cpp b/src/Components/Modules/Node.cpp index f7598642..c42c0044 100644 --- a/src/Components/Modules/Node.cpp +++ b/src/Components/Modules/Node.cpp @@ -342,7 +342,7 @@ namespace Components Scheduler::Loop([] { Node::StoreNodes(false); - }); + }, Scheduler::Pipeline::MAIN); Scheduler::Loop(Node::RunFrame, Scheduler::Pipeline::MAIN); @@ -360,11 +360,11 @@ namespace Components }; if (Monitor::IsEnabled()) Network::OnStart(loadNodes); - else Dvar::OnInit(loadNodes); + else Scheduler::OnGameInitialized(loadNodes, Scheduler::Pipeline::MAIN); - Network::OnStart([]() + Network::OnStart([] { - std::thread([]() + std::thread([] { Node::LoadNodeRemotePreset(); }).detach(); diff --git a/src/Components/Modules/Toast.cpp b/src/Components/Modules/Toast.cpp index 93f8409f..03276c06 100644 --- a/src/Components/Modules/Toast.cpp +++ b/src/Components/Modules/Toast.cpp @@ -150,10 +150,12 @@ namespace Components Scheduler::OnGameInitialized(Toast::Handler, Scheduler::Pipeline::RENDERER); +#ifdef _DEBUG Command::Add("testtoast", [](Command::Params*) { Toast::Show("cardicon_prestige10", "Test", "This is a test toast", 3000); }); +#endif } Toast::~Toast()