From 1961a08adce16e9e9dc486378d207ddf6cdb769c Mon Sep 17 00:00:00 2001 From: Emmanuel AYME Date: Tue, 23 Dec 2025 15:43:36 +0100 Subject: [PATCH] Add world time dilation fix shortcut --- The Callisto Protocol/dllmain.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/The Callisto Protocol/dllmain.cpp b/The Callisto Protocol/dllmain.cpp index 15a6b5e..7fb40a3 100644 --- a/The Callisto Protocol/dllmain.cpp +++ b/The Callisto Protocol/dllmain.cpp @@ -38,6 +38,7 @@ static bool CA_fix_enabled = false; static bool Vignetting_fix_enabled = false; static bool Fog_fix_enabled = false; static bool World_Time_Dilation_fix_enabled = false; +static bool prev_WorldTimeDilation = World_Time_Dilation_fix_enabled; static bool fix_enabled = false; static bool console = true; static int worldFOVValue = 0; @@ -257,9 +258,11 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) ImGui::EndTooltip(); } - if (ImGui::Checkbox("World time dilation", &World_Time_Dilation_fix_enabled)) { - if (SetFixesEnabled) SetFixesEnabled(GameFixes::WorldTimeDilation, World_Time_Dilation_fix_enabled); - SaveSettings(); + ImGui::Checkbox("World time dilation", &World_Time_Dilation_fix_enabled); + if (ImGui::IsItemHovered()) { + ImGui::BeginTooltip(); + ImGui::Text("Use ALT + F1 shortcut to de/activate."); + ImGui::EndTooltip(); } if (ImGui::Checkbox("HUD scaling", &HUD_fix_enabled)) { @@ -345,6 +348,19 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) } } +static void on_reshade_present(reshade::api::effect_runtime* runtime) { + if (runtime->is_key_pressed(VK_F1) && runtime->is_key_down(VK_MENU)) + World_Time_Dilation_fix_enabled = !World_Time_Dilation_fix_enabled; + + if (prev_WorldTimeDilation != World_Time_Dilation_fix_enabled) { + if (SetFixesEnabled) + SetFixesEnabled(GameFixes::WorldTimeDilation, World_Time_Dilation_fix_enabled); + + SaveSettings(); + prev_WorldTimeDilation = World_Time_Dilation_fix_enabled; + } +} + // Main dll intrance BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD ul_reason_for_call, LPVOID) { @@ -360,8 +376,10 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD ul_reason_for_call, LPVOID) [](reshade::api::effect_runtime* runtime) { LoadFixDLL(); }); + reshade::register_event(&on_reshade_present); break; case DLL_PROCESS_DETACH: + reshade::unregister_event(&on_reshade_present); reshade::unregister_addon(hinstDLL); break; }