From 3c087d2d08b72d844fce99f2929b72180eb0b284 Mon Sep 17 00:00:00 2001 From: Emmanuel AYME Date: Sat, 29 Nov 2025 22:09:41 +0100 Subject: [PATCH] Add console enabling option. Improved logs --- EternalStrands/dllmain.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/EternalStrands/dllmain.cpp b/EternalStrands/dllmain.cpp index 8a11782..23f816b 100644 --- a/EternalStrands/dllmain.cpp +++ b/EternalStrands/dllmain.cpp @@ -27,6 +27,7 @@ std::shared_ptr logger; // Plugin states static bool AOBScanDone = false; +static bool g_Console = false; static bool g_fix_enabled = false; static bool g_fov_fix_enabled = false; static bool g_ultrawide_fix_enabled = false; @@ -245,13 +246,13 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init) if (!init && Vignettingaddress) VignettingFixEnabled(); if (!init && Fogaddress) FogFixEnabled(); if (!init && VolumetricFogaddress) VolumetricFogFixEnabled(); - HUDFixEnabled(); + if (!init && GObjectsaddress && AppendStringaddress && ProcessEventaddress) EnableConsole(); } // Setters for Reshade addon call extern "C" __declspec(dllexport) void SetFixesEnabled(GameFixes fix, bool enabled) { // Set each fix individually - if (fix == GameFixes::DevConsole) EnableConsole(); + if (fix == GameFixes::DevConsole) { g_Console = enabled; EnableConsole(); }; if (fix == GameFixes::FOV) { g_fov_fix_enabled = enabled; FOVFixEnabled(); } if (fix == GameFixes::UltraWide) { g_ultrawide_fix_enabled = enabled; UltraWideFixEnabled(); } if (fix == GameFixes::Camera) { g_Camera_fix_enabled = enabled; CameraFixEnabled(); } @@ -457,20 +458,19 @@ static void VolumetricFogFixEnabled() { // UE Console creation static void EnableConsole() { - logger->info("-------------- Console re-enabling --------------"); - if (!GObjectsaddress || !AppendStringaddress || !ProcessEventaddress) { - //if (!GObjectsaddress || !GNamesaddress || !ProcessEventaddress) { - logger->warn("Could not re-enable console"); - logger->info("------------------ User inputs ------------------"); + if (g_Console_Enabled || !g_Console || !GObjectsaddress || !AppendStringaddress || !ProcessEventaddress) { + if (!g_Console && g_fix_enabled) + logger->info("------------------ User inputs ------------------"); return; } + logger->info("-------------- Console re-enabling --------------"); std::thread([&]() { auto start = std::chrono::high_resolution_clock::now(); // Measure the time to renable console UEngine* Engine = nullptr; - for (int i = 0; i < 100; ++i) { // gives 10 seconds to find UE Engine - std::this_thread::sleep_for(std::chrono::milliseconds(100)); + for (int i = 0; i < 10; ++i) { // gives 10 seconds to find UE Engine + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); Engine = UEngine::GetEngine(); if (Engine && Engine->ConsoleClass && Engine->GameViewport) break;