From 07dfc091aad2753d73d58134ed79d44d8b9bcdee Mon Sep 17 00:00:00 2001 From: Emmanuel AYME Date: Sun, 7 Sep 2025 18:50:12 +0200 Subject: [PATCH] Add Unreal Engine re-enabling. Add fix informations --- Cronos The New Dawn/dllmain.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Cronos The New Dawn/dllmain.cpp b/Cronos The New Dawn/dllmain.cpp index 0277a6b..4aadd90 100644 --- a/Cronos The New Dawn/dllmain.cpp +++ b/Cronos The New Dawn/dllmain.cpp @@ -5,12 +5,20 @@ #include #include #include +#include #include +// Screen informations +static int screenWidth = GetSystemMetrics(SM_CXSCREEN); +static int screenHeight = GetSystemMetrics(SM_CYSCREEN); +static float aspectRatio = (float)screenWidth / screenHeight; + // Core game dll functions declarations typedef void (*SetBoolFn)(bool, bool); typedef void (*SetIntFn)(int); typedef float (*GetFloatFn)(); +typedef bool (*GetBoolFn)(); +typedef void (*SetUEConsole)(); static HMODULE fixLib = nullptr; static SetBoolFn SetFixEnabled = nullptr; @@ -25,6 +33,8 @@ static SetIntFn SetFOV = nullptr; static GetFloatFn GetFOVIn = nullptr; static GetFloatFn GetCompensadedFOV = nullptr; static GetFloatFn GetFOVOut = nullptr; +static GetBoolFn GetConsoleEnabled = nullptr; +static SetUEConsole SetConsole = nullptr; // Plugin variables for checkboxes and sliders static bool fov_fix_enabled = false; @@ -97,7 +107,9 @@ static void LoadFixDLL() SetFOV = (SetIntFn)GetProcAddress(fixLib, "SetFOV"); GetFOVIn = (GetFloatFn)GetProcAddress(fixLib, "GetFOVIn"); GetCompensadedFOV = (GetFloatFn)GetProcAddress(fixLib, "GetCompensatedFOV"); - GetFOVOut = (GetFloatFn)GetProcAddress(fixLib, "GetFOVOut");; + GetFOVOut = (GetFloatFn)GetProcAddress(fixLib, "GetFOVOut"); + SetConsole = (SetUEConsole)GetProcAddress(fixLib, "SetConsole"); + GetConsoleEnabled = (GetBoolFn)GetProcAddress(fixLib, "GetConsoleEnabled"); // Apply initial values loaded from settings if (SetFOV) SetFOV(worldFOVvalue); @@ -107,6 +119,7 @@ static void LoadFixDLL() if (SetVignettingFixEnabled) SetVignettingFixEnabled(Vignetting_fix_enabled, true); if (SetFogFixEnabled) SetFogFixEnabled(Fog_fix_enabled, true); if (SetFixEnabled) SetFixEnabled(fix_enabled, true); + if (SetConsole) SetConsole(); } } @@ -286,11 +299,17 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Fix status ImGui::SetCursorPos(ImVec2(10, 240)); - ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true); + ImGui::BeginChild("INFOSHeader", ImVec2(480, 85), true); if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::Text("Screen infos width: %d, height: %d, aspect ratio: %.2f", screenWidth, screenHeight, aspectRatio); + ImGui::SetCursorPos(ImVec2(5, 45)); + if (GetConsoleEnabled && GetConsoleEnabled()) + ImGui::Text("Console enabled and binded to key Tilde"); + ImGui::SetCursorPos(ImVec2(5, 60)); if (GetFOVIn && GetCompensadedFOV && GetFOVOut) // Test functions in case Core dll is not ready when called - ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut()); + ImGui::TextColored(ImColor(48, 179, 25), "FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut()); + //ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut()); } ImGui::EndChild(); }