From 731218faa7603950130f81835986fc628b4fd825 Mon Sep 17 00:00:00 2001 From: Emmanuel AYME Date: Fri, 25 Jul 2025 15:03:35 +0200 Subject: [PATCH] Added Starfield. Removed the need of ASI loader. --- Days Gone/dllmain.cpp | 13 +- Dead Space 2023/dllmain.cpp | 16 +- Empire Of The Ants/dllmain.cpp | 10 +- .../dllmain.cpp | 14 +- Metro Exodus/dllmain.cpp | 24 +- Mindseye/dllmain.cpp | 19 +- Reshade Plugins Addons.sln | 10 + Robocop UB/dllmain.cpp | 17 +- South Of Midnight/dllmain.cpp | 26 +- Spirit Of The North/dllmain.cpp | 17 +- Starfield/Starfield.vcxproj | 156 +++++++++ Starfield/dllmain.cpp | 328 ++++++++++++++++++ TLOU/dllmain.cpp | 22 +- TLOU2/dllmain.cpp | 28 +- Uncharted LOTC/dllmain.cpp | 20 +- 15 files changed, 623 insertions(+), 97 deletions(-) create mode 100644 Starfield/Starfield.vcxproj create mode 100644 Starfield/dllmain.cpp diff --git a/Days Gone/dllmain.cpp b/Days Gone/dllmain.cpp index 7c88624..7342a96 100644 --- a/Days Gone/dllmain.cpp +++ b/Days Gone/dllmain.cpp @@ -5,7 +5,6 @@ #include #include #include -#include // Core game dll functions declarations typedef void (*SetBoolFn)(bool, bool); @@ -47,17 +46,18 @@ const char* HUD_LEFT_SETTING = "HUDLeft="; const char* HUD_RIGHT_SETTING = "HUDRight="; const char* FIX_VERSION = "1.0.4"; const char* FIX_INFORMATIONS = "This fix will allow to:\r\n -Modify FOV in game (acts as an additional FOV).\r\n -Set HUD safe zone (21/9,16/9 ...)."; -const char* DONATION_URL = "https://www.paypal.com/donate/?business=W92C47N3WZZZG&no_recurring=0¤cy_code=EUR"; +const char* DONATION_URL = "https://buymeacoffee.com/k4sh44"; // Load and unload game core dll functions /!\ necessary static void LoadFixDLL() { if (fixLib) return; - fixLib = GetModuleHandleA("DaysGoneCore.asi"); // ou EmpireOfTheAntsCore.dll si tu gardes le .dll + fixLib = LoadLibraryA("DaysGoneCore.dll"); // ou EmpireOfTheAntsCore.dll si tu gardes le .dll if (!fixLib) { MessageBoxA(nullptr, "Impossible to load game core dll", "Erreur", MB_OK); return; } + SetFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFixEnabled"); SetFOVFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFOVFixEnabled"); SetHUDFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetHUDFixEnabled"); @@ -268,9 +268,12 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Fix status ImGui::SetCursorPos(ImVec2(10, 360)); - ImGui::Text("=============== Fix informations ==============="); - if (GetFOVIn && GetFOVOut) + ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true); // true = border + if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::Text("FOV In: %.2f, Out : %.2f", GetFOVIn(), GetFOVOut()); + } + ImGui::EndChild(); } // Main dll intrance diff --git a/Dead Space 2023/dllmain.cpp b/Dead Space 2023/dllmain.cpp index 44854dd..8e0fd4d 100644 --- a/Dead Space 2023/dllmain.cpp +++ b/Dead Space 2023/dllmain.cpp @@ -5,9 +5,6 @@ #include #include #include -#include -#include -#include // Core game dll functions declarations typedef void (*SetBoolFn)(bool,bool); @@ -35,18 +32,19 @@ const char* WORLD_FOV_FIX_SETTING = "WorldFOVFIX="; const char* WORLD_FOV_SETTING = "WorldFOV="; const char* FIX_VERSION = "1.0.2"; const char* FIX_INFORMATIONS = "This fix allows to :\r\n- Change FOV in game.\r\nThis will not affect inventory,store or bench tool."; -const char* DONATION_URL = "https://www.paypal.com/donate/?business=W92C47N3WZZZG&no_recurring=0¤cy_code=EUR"; +const char* DONATION_URL = "https://buymeacoffee.com/k4sh44"; // Load and unload game core dll functions /!\ necessary static void LoadFixDLL() { if (fixLib) return; - fixLib = GetModuleHandleA("DeadSpace2023Core.asi"); // ou EmpireOfTheAntsCore.dll si tu gardes le .dll + fixLib = LoadLibraryA("DeadSpace2023Core.dll"); // ou EmpireOfTheAntsCore.dll si tu gardes le .dll if (!fixLib) { // Optionnel: message d'erreur ou fallback MessageBoxA(nullptr, "Impossible to load game core dll", "Erreur", MB_OK); return; } + SetFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFixEnabled"); SetFOVFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFOVFixEnabled"); SetFOV = (SetIntFn)GetProcAddress(fixLib, "SetFOV"); @@ -170,8 +168,12 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Fix status ImGui::SetCursorPos(ImVec2(10, 200)); - ImGui::Text("=============== Fix informations ==============="); - ImGui::Text("FOV In: %.2f, Out : %.2f", GetFOVIn(), GetFOVOut()); + ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true); // true = border + if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::Text("FOV In: %.2f, Out : %.2f", GetFOVIn(), GetFOVOut()); + } + ImGui::EndChild(); } // Main dll intrance diff --git a/Empire Of The Ants/dllmain.cpp b/Empire Of The Ants/dllmain.cpp index 1466b5b..6724b7d 100644 --- a/Empire Of The Ants/dllmain.cpp +++ b/Empire Of The Ants/dllmain.cpp @@ -45,7 +45,7 @@ const char* DONATION_URL = "https://www.paypal.com/donate/?business=W92C47N3WZZZ static void LoadFixDLL() { if (fixLib) return; - fixLib = GetModuleHandleA("EmpireOfTheAntsCore.asi"); // ou EmpireOfTheAntsCore.dll si tu gardes le .dll + fixLib = LoadLibraryA("EmpireOfTheAntsCore.dll"); // ou EmpireOfTheAntsCore.dll si tu gardes le .dll if (!fixLib) { // Optionnel: message d'erreur ou fallback @@ -205,8 +205,12 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Fix status ImGui::SetCursorPos(ImVec2(10, 200)); - ImGui::Text("=============== Fix informations ==============="); - ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut()); + ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true); // true = border + if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut()); + } + ImGui::EndChild(); } // Main dll intrance diff --git a/Indiana Jones And The Great Circle/dllmain.cpp b/Indiana Jones And The Great Circle/dllmain.cpp index c48b7f9..c92ab05 100644 --- a/Indiana Jones And The Great Circle/dllmain.cpp +++ b/Indiana Jones And The Great Circle/dllmain.cpp @@ -46,13 +46,13 @@ const char* WORLD_FOV_SETTING = "WorldFOV="; const char* CINEMATICS_FOV_SETTING = "CinematicsFOV="; const char* FIX_VERSION = "1.0.3"; const char* FIX_INFORMATIONS = "This fix allows to:\r\n - Modify FOV in game\r\n - Modify Cinematics FOV.\r\n - Disable depth of field in cutscenes.\r\n - Unlock cinematics frametime.\r\n - Enable frame generation with cutscenes.\r\n\r\nThe game has a narrow FOV in cinematics for displays with a ratio above 21/9.\r\nCinematics FOV will be compensated for ultrawide displays.\r\nCinematics FOV won't affect world or menus FOVs.\r\nDepth of field fix should affect all the game."; -const char* DONATION_URL = "https://www.paypal.com/donate/?business=W92C47N3WZZZG&no_recurring=0¤cy_code=EUR"; +const char* DONATION_URL = "https://buymeacoffee.com/k4sh44"; // Load and unload game core dll functions /!\ necessary static void LoadFixDLL() { if (fixLib) return; - fixLib = GetModuleHandleA("IndianaJonesTGCCore.asi"); + fixLib = LoadLibraryA("IndianaJonesTGCCore.dll"); if (!fixLib) { MessageBoxA(nullptr, "Impossible to load game core dll", "Erreur", MB_OK); @@ -230,9 +230,13 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Fix status ImGui::SetCursorPos(ImVec2(10, 240)); - ImGui::Text("=============== Fix informations ==============="); - ImGui::Text("FOV In: %.2f, Out : %.2f", GetFOVIn(), GetFOVOut()); - ImGui::Text("Cinematics FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetCinematicsFOVIn(), GetCinematicsCompensadedFOV(), GetCinematicsFOVOut()); + ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true); + if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::Text("FOV In: %.2f, Out : %.2f", GetFOVIn(), GetFOVOut()); + ImGui::Text("Cinematics FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetCinematicsFOVIn(), GetCinematicsCompensadedFOV(), GetCinematicsFOVOut()); + } + ImGui::EndChild(); } // Main dll intrance diff --git a/Metro Exodus/dllmain.cpp b/Metro Exodus/dllmain.cpp index 561d2a2..48ad2eb 100644 --- a/Metro Exodus/dllmain.cpp +++ b/Metro Exodus/dllmain.cpp @@ -5,7 +5,6 @@ #include #include #include -#include // Core game dll functions declarations typedef void (*SetBoolFn)(bool, bool); @@ -47,10 +46,9 @@ const char* DONATION_URL = "https://buymeacoffee.com/k4sh44"; static void LoadFixDLL() { if (fixLib) return; - fixLib = GetModuleHandleA("MetroExodusCore.asi"); // ou EmpireOfTheAntsCore.dll si tu gardes le .dll + fixLib = LoadLibraryA("MetroExodusCore.dll"); if (!fixLib) { - // Optionnel: message d'erreur ou fallback MessageBoxA(nullptr, "Impossible to load game core dll", "Erreur", MB_OK); return; } @@ -63,9 +61,9 @@ static void LoadFixDLL() GetFOVIn = (GetFloatFn)GetProcAddress(fixLib, "GetFOVIn"); GetFOVOut = (GetFloatFn)GetProcAddress(fixLib, "GetFOVOut");; - // Appliquer les valeurs initiales chargées + // Apply initial values loaded from ini if (SetFOV) SetFOV(worldFOVvalue); - if (SetCutscenesFOV) SetFOV(cutscenesFOVvalue); + if (SetCutscenesFOV) SetCutscenesFOV(cutscenesFOVvalue); if (SetFOVFixEnabled) SetFOVFixEnabled(fov_fix_enabled, true); if (SetCutscenesFOVFixEnabled) SetCutscenesFOVFixEnabled(cutscenes_fov_fix_enabled, true); if (SetAspectRatioFixEnabled) SetAspectRatioFixEnabled(aspect_ratio_fix_enabled, true); @@ -160,7 +158,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Generic fix ImGui::SetCursorPos(ImVec2(10, 60)); - ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = border if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("Fix enabled", &fix_enabled)) { @@ -172,7 +170,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // FOV adjustment ImGui::SetCursorPos(ImVec2(10, 120)); - ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::SetNextItemWidth(150.0f); @@ -185,7 +183,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) ImGui::EndChild(); ImGui::SetCursorPos(ImVec2(10, 180)); - ImGui::BeginChild("CutscenesHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("CutscenesHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("Cutscenes additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::SetNextItemWidth(150.0f); @@ -199,7 +197,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Individual fixes ImGui::SetCursorPos(ImVec2(240, 60)); - ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); // true = bordure + ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("FOV Fix", &fov_fix_enabled)) { @@ -223,8 +221,12 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Fix status ImGui::SetCursorPos(ImVec2(10, 240)); - ImGui::Text("=============== Fix informations ==============="); - ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetFOVOut()); + ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true); // true = border + if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::Text("FOV In: %.2f, Out : %.2f", GetFOVIn(), GetFOVOut()); + } + ImGui::EndChild(); } // Main dll intrance diff --git a/Mindseye/dllmain.cpp b/Mindseye/dllmain.cpp index 2b5170c..e003a4d 100644 --- a/Mindseye/dllmain.cpp +++ b/Mindseye/dllmain.cpp @@ -5,7 +5,6 @@ #include #include #include -#include // Core game dll functions declarations typedef void (*SetBoolFn)(bool, bool); @@ -45,7 +44,7 @@ const char* DONATION_URL = "https://buymeacoffee.com/k4sh44"; static void LoadFixDLL() { if (fixLib) return; - fixLib = GetModuleHandleA("MindseyeCore.asi"); // ou EmpireOfTheAntsCore.dll si tu gardes le .dll + fixLib = LoadLibraryA("MindseyeCore.dll"); if (!fixLib) { // Optionnel: message d'erreur ou fallback @@ -61,7 +60,7 @@ static void LoadFixDLL() GetCompensadedFOV = (GetFloatFn)GetProcAddress(fixLib, "GetCompensatedFOV"); GetFOVOut = (GetFloatFn)GetProcAddress(fixLib, "GetFOVOut");; - // Appliquer les valeurs initiales chargées + // Apply initial values load from ini if (SetFOV) SetFOV(worldFOVvalue); if (SetFOVFixEnabled) SetFOVFixEnabled(fov_fix_enabled, true); if (SetAspectRatioFixEnabled) SetAspectRatioFixEnabled(aspect_ratio_fix_enabled, true); @@ -154,7 +153,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Generic fix ImGui::SetCursorPos(ImVec2(10, 60)); - ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = border if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("Fix enabled", &fix_enabled)) { @@ -166,7 +165,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // FOV adjustment ImGui::SetCursorPos(ImVec2(10, 120)); - ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::SetNextItemWidth(150.0f); @@ -180,7 +179,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Individual fixes ImGui::SetCursorPos(ImVec2(240, 60)); - ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); // true = bordure + ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("Enable FOV Fix", &fov_fix_enabled)) { @@ -204,8 +203,12 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Fix status ImGui::SetCursorPos(ImVec2(10, 200)); - ImGui::Text("=============== Fix informations ==============="); - ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut()); + ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true); // true = border + if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut()); + } + ImGui::EndChild(); } // Main dll intrance diff --git a/Reshade Plugins Addons.sln b/Reshade Plugins Addons.sln index 4e811f4..c519b15 100644 --- a/Reshade Plugins Addons.sln +++ b/Reshade Plugins Addons.sln @@ -29,6 +29,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Robocop UB", "Robocop UB\Ro EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TLOU", "TLOU\TLOU.vcxproj", "{01175866-A908-4941-B4EE-2ECDD7AF075C}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Starfield", "Starfield\Starfield.vcxproj", "{762480CC-C755-4AB5-A8EE-FBF7050E4DFE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -133,6 +135,14 @@ Global {01175866-A908-4941-B4EE-2ECDD7AF075C}.Release|x64.Build.0 = Release|x64 {01175866-A908-4941-B4EE-2ECDD7AF075C}.Release|x86.ActiveCfg = Release|Win32 {01175866-A908-4941-B4EE-2ECDD7AF075C}.Release|x86.Build.0 = Release|Win32 + {762480CC-C755-4AB5-A8EE-FBF7050E4DFE}.Debug|x64.ActiveCfg = Debug|x64 + {762480CC-C755-4AB5-A8EE-FBF7050E4DFE}.Debug|x64.Build.0 = Debug|x64 + {762480CC-C755-4AB5-A8EE-FBF7050E4DFE}.Debug|x86.ActiveCfg = Debug|Win32 + {762480CC-C755-4AB5-A8EE-FBF7050E4DFE}.Debug|x86.Build.0 = Debug|Win32 + {762480CC-C755-4AB5-A8EE-FBF7050E4DFE}.Release|x64.ActiveCfg = Release|x64 + {762480CC-C755-4AB5-A8EE-FBF7050E4DFE}.Release|x64.Build.0 = Release|x64 + {762480CC-C755-4AB5-A8EE-FBF7050E4DFE}.Release|x86.ActiveCfg = Release|Win32 + {762480CC-C755-4AB5-A8EE-FBF7050E4DFE}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Robocop UB/dllmain.cpp b/Robocop UB/dllmain.cpp index 808a72f..48b8fd1 100644 --- a/Robocop UB/dllmain.cpp +++ b/Robocop UB/dllmain.cpp @@ -5,7 +5,6 @@ #include #include #include -#include // Core game dll functions declarations typedef void (*SetBoolFn)(bool, bool); @@ -45,7 +44,7 @@ const char* DONATION_URL = "https://buymeacoffee.com/k4sh44"; static void LoadFixDLL() { if (fixLib) return; - fixLib = GetModuleHandleA("RobocopUBCore.asi"); + fixLib = LoadLibraryA("RobocopUBCore.dll"); if (!fixLib) { // Optionnel: message d'erreur ou fallback @@ -154,7 +153,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Generic fix ImGui::SetCursorPos(ImVec2(10, 60)); - ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = border if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("Fix enabled", &fix_enabled)) { @@ -166,7 +165,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // FOV adjustment ImGui::SetCursorPos(ImVec2(10, 120)); - ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::SetNextItemWidth(150.0f); @@ -180,7 +179,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Individual fixes ImGui::SetCursorPos(ImVec2(240, 60)); - ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); // true = bordure + ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("Enable FOV Fix", &fov_fix_enabled)) { @@ -204,8 +203,12 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Fix status ImGui::SetCursorPos(ImVec2(10, 200)); - ImGui::Text("=============== Fix informations ==============="); - ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut()); + ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true); // true = border + if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut()); + } + ImGui::EndChild(); } // Main dll intrance diff --git a/South Of Midnight/dllmain.cpp b/South Of Midnight/dllmain.cpp index 4b5d34d..8508ce5 100644 --- a/South Of Midnight/dllmain.cpp +++ b/South Of Midnight/dllmain.cpp @@ -36,19 +36,18 @@ const char* ASPECT_FIX_SETTING = "AspectFIX="; const char* WORLD_FOV_SETTING = "WorldFOV="; const char* FIX_VERSION = "1.0.1"; const char* FIX_INFORMATIONS = "This fix allows to:\n - Control in game FOV.\n - Force aspect ratio.\r\nFOV will be compensated when aspect fix is checked."; -const char* DONATION_URL = "https://www.paypal.com/donate/?business=W92C47N3WZZZG&no_recurring=0¤cy_code=EUR"; -const char* DONATION_URL2 = "https://buymeacoffee.com/k4sh44"; +const char* DONATION_URL = "https://buymeacoffee.com/k4sh44"; // Load and unload game core dll functions /!\ necessary static void LoadFixDLL() { if (fixLib) return; - fixLib = GetModuleHandleA("SouthOfMidnightCore.asi"); // ou EmpireOfTheAntsCore.dll si tu gardes le .dll + fixLib = LoadLibraryA("SouthOfMidnightCore.dll"); if (!fixLib) { - // Optionnel: message d'erreur ou fallback MessageBoxA(nullptr, "Impossible to load game core dll", "Erreur", MB_OK); return; } + SetFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFixEnabled"); SetFOVFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFOVFixEnabled"); SetAspectRatioFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetAspectRatioFixEnabled"); @@ -57,7 +56,7 @@ static void LoadFixDLL() GetCompensadedFOV = (GetFloatFn)GetProcAddress(fixLib, "GetCompensatedFOV"); GetFOVOut = (GetFloatFn)GetProcAddress(fixLib, "GetFOVOut");; - // Appliquer les valeurs initiales chargées + // Apply initial values loaded from ini if (SetFOV) SetFOV(worldFOVvalue); if (SetFOVFixEnabled) SetFOVFixEnabled(fov_fix_enabled, true); if (SetAspectRatioFixEnabled) SetAspectRatioFixEnabled(aspect_ratio_fix_enabled, true); @@ -130,8 +129,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) ImGui::SetCursorPos(ImVec2(130, 33)); if (ImGui::Button("consider donation")) { - //ShellExecuteA(NULL, "open", DONATION_URL, NULL, NULL, SW_SHOWNORMAL); - ShellExecuteA(NULL, "open", DONATION_URL2, NULL, NULL, SW_SHOWNORMAL); + ShellExecuteA(NULL, "open", DONATION_URL, NULL, NULL, SW_SHOWNORMAL); } // Fix informations @@ -144,7 +142,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Generic fix ImGui::SetCursorPos(ImVec2(10, 60)); - ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = border if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("Fix enabled", &fix_enabled)) { @@ -156,7 +154,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // FOV adjustment ImGui::SetCursorPos(ImVec2(10, 120)); - ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::SetNextItemWidth(150.0f); @@ -170,7 +168,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Individual fixes ImGui::SetCursorPos(ImVec2(240, 60)); - ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); // true = bordure + ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("Enable FOV Fix", &fov_fix_enabled)) { @@ -188,8 +186,12 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Fix status ImGui::SetCursorPos(ImVec2(10, 200)); - ImGui::Text("=============== Fix informations ==============="); - ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut()); + ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true); + if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut()); + } + ImGui::EndChild(); } // Main dll intrance diff --git a/Spirit Of The North/dllmain.cpp b/Spirit Of The North/dllmain.cpp index c7b37ae..bd5191e 100644 --- a/Spirit Of The North/dllmain.cpp +++ b/Spirit Of The North/dllmain.cpp @@ -5,7 +5,6 @@ #include #include #include -#include // Core game dll functions declarations typedef void (*SetBoolFn)(bool, bool); @@ -45,7 +44,7 @@ const char* DONATION_URL = "https://buymeacoffee.com/k4sh44"; static void LoadFixDLL() { if (fixLib) return; - fixLib = GetModuleHandleA("SpiritOfTheNorthCore.asi"); // ou EmpireOfTheAntsCore.dll si tu gardes le .dll + fixLib = LoadLibraryA("SpiritOfTheNorthCore.dll"); if (!fixLib) { // Optionnel: message d'erreur ou fallback @@ -154,7 +153,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Generic fix ImGui::SetCursorPos(ImVec2(10, 60)); - ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = border if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("Fix enabled", &fix_enabled)) { @@ -166,7 +165,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // FOV adjustment ImGui::SetCursorPos(ImVec2(10, 120)); - ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::SetNextItemWidth(150.0f); @@ -180,7 +179,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Individual fixes ImGui::SetCursorPos(ImVec2(240, 60)); - ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); // true = bordure + ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("Enable FOV Fix", &fov_fix_enabled)) { @@ -204,8 +203,12 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Fix status ImGui::SetCursorPos(ImVec2(10, 200)); - ImGui::Text("=============== Fix informations ==============="); - ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut()); + ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true); + if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut()); + } + ImGui::EndChild(); } // Main dll intrance diff --git a/Starfield/Starfield.vcxproj b/Starfield/Starfield.vcxproj new file mode 100644 index 0000000..0a8a31f --- /dev/null +++ b/Starfield/Starfield.vcxproj @@ -0,0 +1,156 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {762480CC-C755-4AB5-A8EE-FBF7050E4DFE} + Starfield + 10.0 + Starfield + + + + DynamicLibrary + true + v143 + Unicode + + + DynamicLibrary + false + v143 + true + Unicode + + + DynamicLibrary + true + v143 + Unicode + + + DynamicLibrary + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + .addon + + + .addon + + + .addon + + + .addon + + + + Level3 + true + WIN32;_DEBUG;TLOU2_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + $(SolutionDir)external\reshade\include;$(SolutionDir)external\reshade\deps\imgui + MultiThreadedDLL + + + Windows + true + false + + + + + Level3 + true + true + true + WIN32;NDEBUG;TLOU2_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + $(SolutionDir)external\reshade\include;$(SolutionDir)external\reshade\deps\imgui + MultiThreadedDLL + + + Windows + true + false + + + + + Level3 + true + _DEBUG;TLOU2_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + $(SolutionDir)external\reshade\include;$(SolutionDir)external\reshade\deps\imgui + MultiThreadedDLL + + + Windows + true + false + + + + + Level3 + true + true + true + NDEBUG;TLOU2_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + $(SolutionDir)external\reshade\include;$(SolutionDir)external\reshade\deps\imgui + MultiThreadedDLL + + + Windows + true + false + + + + + + + + + \ No newline at end of file diff --git a/Starfield/dllmain.cpp b/Starfield/dllmain.cpp new file mode 100644 index 0000000..2d97a44 --- /dev/null +++ b/Starfield/dllmain.cpp @@ -0,0 +1,328 @@ +#define IMGUI_DISABLE_INCLUDE_IMCONFIG_H +#define IMGUI_HAS_DOCK 1 + +#include +#include +#include +#include + +// Core game dll functions declarations +typedef void (*SetBoolFn)(bool,bool); +typedef void (*SetIntFn)(int); +typedef void (*SetFloatFn)(float); +typedef float (*GetFloatFn)(); + +static HMODULE fixLib = nullptr; +static SetBoolFn SetFixEnabled = nullptr; +static SetBoolFn SetDialogFOVFixEnabled = nullptr; +static SetBoolFn SetWeaponFOVFixEnabled = nullptr; +static SetBoolFn SetHUDFixEnabled = nullptr; +static SetBoolFn SetPhotoModeFixEnabled = nullptr; +static SetIntFn SetDialogFOV = nullptr; +static SetIntFn SetWeaponFOV = nullptr; +static SetIntFn SetHUDX = nullptr; +static SetIntFn SetHUDY = nullptr; +static GetFloatFn GetDialogFOVIn = nullptr; +static GetFloatFn GetDialogFOVOut = nullptr; +static GetFloatFn GetWeaponFOVIn = nullptr; +static GetFloatFn GetWeaponFOVOut = nullptr; + +// Plugin variables for checkboxes and sliders +static bool fix_enabled = false; +static bool dialog_fov_fix_enabled = false; +static bool weapon_fov_fix_enabled = false; +static bool HUD_fix_enabled = false; +static bool Photomode_fix_enabled = false; +static int dialogFOVvalue = 0; +static int weaponFOVvalue = 0; +static int HUDXvalue = 0; +static int HUDYvalue = 0; +static bool popup_Informations = false; + +// Plugin settings +const char* SETTINGS_FILE = "PluginSettings.ini"; +const char* GENERAL_FIX_SETTING = "GeneralFIX="; +const char* DIALOG_FOV_FIX_SETTING = "DialogFOVFIX="; +const char* WEAPON_FOV_FIX_SETTING = "WeaponFOVFIX="; +const char* HUD_FIX_SETTING = "HUDFIX="; +const char* PHOTOMODE_FIX_SETTING = "PhotomodeFIX="; +const char* DIALOG_FOV_SETTING = "DialogFOV="; +const char* WEAPON_FOV_SETTING = "WeaponFOV="; +const char* HUDX_SETTING = "HUDX="; +const char* HUDY_SETTING = "HUDY="; +const char* FIX_VERSION = "1.0.1"; +const char* FIX_INFORMATIONS = "This fix allows to:\r\n - Control dialog and weapon FOV.\r\n - Control HUD safe zone.\r\n - Disable photomode black bars."; +const char* DONATION_URL = "https://buymeacoffee.com/k4sh44"; + +// Load and unload game core dll functions /!\ necessary +static void LoadFixDLL() +{ + if (fixLib) return; + fixLib = LoadLibraryA("StarfieldCore.dll"); + + if (!fixLib) { + MessageBoxA(nullptr, "Impossible to load game core dll", "Erreur", MB_OK); + return; + } + + SetFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFixEnabled"); + SetDialogFOVFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetDialogFOVFixEnabled"); + SetWeaponFOVFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetWeaponFOVFixEnabled"); + SetHUDFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetHUDFixEnabled"); + SetPhotoModeFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetPhotoModeFixEnabled"); + SetDialogFOV = (SetIntFn)GetProcAddress(fixLib, "SetDialogFOV"); + SetWeaponFOV = (SetIntFn)GetProcAddress(fixLib, "SetWeaponFOV"); + SetHUDX = (SetIntFn)GetProcAddress(fixLib, "SetHUDX"); + SetHUDY = (SetIntFn)GetProcAddress(fixLib, "SetHUDY"); + GetDialogFOVIn = (GetFloatFn)GetProcAddress(fixLib, "GetDialogFOVIn"); + GetDialogFOVOut = (GetFloatFn)GetProcAddress(fixLib, "GetDialogFOVOut"); + GetWeaponFOVIn = (GetFloatFn)GetProcAddress(fixLib, "GetWeaponFOVIn"); + GetWeaponFOVOut = (GetFloatFn)GetProcAddress(fixLib, "GetWeaponFOVOut"); + + // Apply initial settings loaded from ini file + if (SetDialogFOV) SetDialogFOV(dialogFOVvalue); + if (SetWeaponFOV) SetWeaponFOV(weaponFOVvalue); + if (SetHUDX) SetHUDX(HUDXvalue); + if (SetHUDY) SetHUDY(HUDYvalue); + if (SetDialogFOVFixEnabled) SetDialogFOVFixEnabled(dialog_fov_fix_enabled, true); + if (SetWeaponFOVFixEnabled) SetWeaponFOVFixEnabled(weapon_fov_fix_enabled, true); + if (SetHUDFixEnabled) SetHUDFixEnabled(HUD_fix_enabled, true); + if (SetPhotoModeFixEnabled) SetPhotoModeFixEnabled(Photomode_fix_enabled, true); + if (SetFixEnabled) SetFixEnabled(fix_enabled, true); +} + +// Addon functions +static void SaveSettings() +{ + std::ofstream file(SETTINGS_FILE); + if (file.is_open()) + { + file << GENERAL_FIX_SETTING << (fix_enabled ? "1" : "0") << "\n"; + file << DIALOG_FOV_FIX_SETTING << (dialog_fov_fix_enabled ? "1" : "0") << "\n"; + file << WEAPON_FOV_FIX_SETTING << (weapon_fov_fix_enabled ? "1" : "0") << "\n"; + file << HUD_FIX_SETTING << (HUD_fix_enabled ? "1" : "0") << "\n"; + file << PHOTOMODE_FIX_SETTING << (Photomode_fix_enabled ? "1" : "0") << "\n"; + file << DIALOG_FOV_SETTING << dialogFOVvalue << "\n"; + file << WEAPON_FOV_SETTING << weaponFOVvalue << "\n"; + file << HUDX_SETTING << HUDXvalue << "\n"; + file << HUDY_SETTING << HUDYvalue << "\n"; + + file.close(); + } +} + +static void LoadSettings() +{ + std::ifstream file(SETTINGS_FILE); + if (file.is_open()) + { + std::string line; + while (std::getline(file, line)) + { + if (line.find(GENERAL_FIX_SETTING) == 0) + { + std::string val = line.substr(strlen(GENERAL_FIX_SETTING)); + fix_enabled = (val == "1" || val == "true"); + } + else if (line.find(DIALOG_FOV_FIX_SETTING) == 0) + { + std::string val = line.substr(strlen(DIALOG_FOV_FIX_SETTING)); + dialog_fov_fix_enabled = (val == "1" || val == "true"); + } + else if (line.find(WEAPON_FOV_FIX_SETTING) == 0) + { + std::string val = line.substr(strlen(WEAPON_FOV_FIX_SETTING)); + weapon_fov_fix_enabled = (val == "1" || val == "true"); + } + else if (line.find(HUD_FIX_SETTING) == 0) + { + std::string val = line.substr(strlen(HUD_FIX_SETTING)); + HUD_fix_enabled = (val == "1" || val == "true"); + } + else if (line.find(PHOTOMODE_FIX_SETTING) == 0) + { + std::string val = line.substr(strlen(PHOTOMODE_FIX_SETTING)); + Photomode_fix_enabled = (val == "1" || val == "true"); + } + else if (line.find(DIALOG_FOV_SETTING) == 0) + dialogFOVvalue = std::stoi(line.substr(strlen(DIALOG_FOV_SETTING))); + else if (line.find(WEAPON_FOV_SETTING) == 0) + weaponFOVvalue = std::stoi(line.substr(strlen(DIALOG_FOV_SETTING))); + else if (line.find(HUDX_SETTING) == 0) + HUDXvalue = std::stof(line.substr(strlen(HUDX_SETTING))); + else if (line.find(HUDY_SETTING) == 0) + HUDYvalue = std::stof(line.substr(strlen(HUDY_SETTING))); + } + file.close(); + } +} + +static void displayFixInformations() { + // Fix version + ImGui::Begin("Informations", &popup_Informations); // + ImGui::SetCursorPos(ImVec2(10, 36)); + ImGui::Text("Version : %s", FIX_VERSION); + ImGui::SetCursorPos(ImVec2(10, 76)); + ImGui::Text(FIX_INFORMATIONS); + ImGui::End(); +} + +// Initialize ImGui widgets for Reshade +static void on_overlay_draw(reshade::api::effect_runtime* runtime) +{ + ImGui::SetNextWindowPos(ImVec2(100, 200), ImGuiCond_Once); + ImGui::SetNextWindowSize(ImVec2(350, 150), ImGuiCond_Once); + + // Donation ? + ImGui::SetCursorPos(ImVec2(10, 36)); + ImGui::Text("Like my work ?"); + ImGui::SetCursorPos(ImVec2(130, 33)); + if (ImGui::Button("consider donation")) + { + ShellExecuteA(NULL, "open", DONATION_URL, NULL, NULL, SW_SHOWNORMAL); + } + + // Fix informations + ImGui::SetCursorPos(ImVec2(270, 33)); + if (ImGui::Button("Fix informations")) + popup_Informations = true; + + if (popup_Informations) + displayFixInformations(); + + // Generic fix + ImGui::SetCursorPos(ImVec2(10, 60)); + ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = bordure + if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + if (ImGui::Checkbox("Fix enabled", &fix_enabled)) { + if (SetFixEnabled) SetFixEnabled(fix_enabled, false); + SaveSettings(); + } + } + ImGui::EndChild(); + + // Dialog FOV adjustment + ImGui::SetCursorPos(ImVec2(10, 120)); + ImGui::BeginChild("DialogFOVHeader", ImVec2(220, 0), false); // true = bordure + if (ImGui::CollapsingHeader("Dialog additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::SetNextItemWidth(150.0f); + if (ImGui::SliderInt("##DialogFOVSlider", &dialogFOVvalue, 0, 70)) {} + if (ImGui::IsItemDeactivatedAfterEdit()) { + if (SetDialogFOV) SetDialogFOV(dialogFOVvalue); + SaveSettings(); + } + } + ImGui::EndChild(); + + // Weapon FOV adjustment + ImGui::SetCursorPos(ImVec2(10, 180)); + ImGui::BeginChild("WeaponFOVHeader", ImVec2(220, 0), false); + if (ImGui::CollapsingHeader("Weapon additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::SetNextItemWidth(150.0f); + if (ImGui::SliderInt("##WeaponFOVSlider", &weaponFOVvalue, 0, 50)) {} + if (ImGui::IsItemDeactivatedAfterEdit()) { + if (SetWeaponFOV) SetWeaponFOV(weaponFOVvalue); + SaveSettings(); + } + } + + ImGui::EndChild(); + // Safe zone X axis + ImGui::SetCursorPos(ImVec2(10, 240)); + ImGui::BeginChild("HUDXHeader", ImVec2(220, 0), false); + if (ImGui::CollapsingHeader("HUD width scaling", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::SetNextItemWidth(150.0f); + if (ImGui::SliderInt("##HUDXSlider", &HUDXvalue, 0, 80)) {} + if (ImGui::IsItemDeactivatedAfterEdit()) { + if (SetHUDX) SetHUDX(HUDXvalue); + SaveSettings(); + } + } + ImGui::EndChild(); + + // Individual fixes + ImGui::SetCursorPos(ImVec2(240, 60)); + ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); // true = bordure + if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + if (ImGui::Checkbox("Dialog FOV Fix", &dialog_fov_fix_enabled)) { + if (SetDialogFOVFixEnabled) SetDialogFOVFixEnabled(dialog_fov_fix_enabled, false); + SaveSettings(); + } + + ImGui::SetCursorPos(ImVec2(5, 55)); + if (ImGui::Checkbox("Weapon FOV Fix", &weapon_fov_fix_enabled)) { + if (SetWeaponFOVFixEnabled) SetWeaponFOVFixEnabled(weapon_fov_fix_enabled, false); + SaveSettings(); + } + + ImGui::SetCursorPos(ImVec2(5, 80)); + if (ImGui::Checkbox("HUD safe zone fix", &HUD_fix_enabled)) { + if (SetHUDFixEnabled) SetHUDFixEnabled(HUD_fix_enabled, false); + SaveSettings(); + } + + ImGui::SetCursorPos(ImVec2(5, 105)); + if (ImGui::Checkbox("Photomode aspect fix", &Photomode_fix_enabled)) { + if (SetPhotoModeFixEnabled) SetPhotoModeFixEnabled(Photomode_fix_enabled, false); + SaveSettings(); + } + } + ImGui::EndChild(); + + // Safe zone Y axis + ImGui::SetCursorPos(ImVec2(240, 240)); + ImGui::BeginChild("HUDYHeader", ImVec2(220, 0), false); // true = border + if (ImGui::CollapsingHeader("HUD height scaling", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::SetNextItemWidth(150.0f); + if (ImGui::SliderInt("##HUDYSlider", &HUDYvalue, 0, 80)) {} + if (ImGui::IsItemDeactivatedAfterEdit()) { + if (SetHUDY) SetHUDY(HUDYvalue); + SaveSettings(); + } + } + ImGui::EndChild(); + + // Fix status + ImGui::SetCursorPos(ImVec2(10, 320)); + ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true); // true = border + if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::Text("Dialog FOV In: %.2f, Out : %.2f", GetDialogFOVIn(), GetDialogFOVOut()); + ImGui::Text("Weapon FOV In: %.2f, Out : %.2f", GetWeaponFOVIn(), GetWeaponFOVOut()); + } + ImGui::EndChild(); +} + +static void UnLoadFixDLL() { + MessageBoxA(nullptr, "Déchargement dll", "Erreur", MB_OK); +} + +// Main dll intrance +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD ul_reason_for_call, LPVOID) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + if (!reshade::register_addon(hinstDLL)) + return FALSE; + + LoadSettings(); + reshade::register_overlay("Starfield", &on_overlay_draw); + reshade::register_event( + [](reshade::api::effect_runtime* runtime) { + LoadFixDLL(); + }); + break; + case DLL_PROCESS_DETACH: + fixLib = nullptr; + reshade::unregister_addon(hinstDLL); + break; + } + return TRUE; +} \ No newline at end of file diff --git a/TLOU/dllmain.cpp b/TLOU/dllmain.cpp index 6195d4e..b3d581f 100644 --- a/TLOU/dllmain.cpp +++ b/TLOU/dllmain.cpp @@ -44,13 +44,13 @@ const char* CAMERA_SETTING = "Camera="; const char* SHARPNESS_SETTING = "Sharpness="; const char* FIX_VERSION = "1.0.1"; const char* FIX_INFORMATIONS = "This fix allows to:\r\n - Control in game FOV.\r\n - Control camera distance.\r\n - Control image sharpening.\n\nModifying FOV may affect performance.\r\nSharpening fix will override game's setting. A good range would be (0 - 1).\r\nSet the slider to 0 to completely deactivate it.\r\nCamera distance in settings is a scale between 0.9 - 1.1 (-5 to +5 slider)."; -const char* DONATION_URL = "https://www.paypal.com/donate/?business=W92C47N3WZZZG&no_recurring=0¤cy_code=EUR"; +const char* DONATION_URL = "https://buymeacoffee.com/k4sh44"; // Load and unload game core dll functions /!\ necessary static void LoadFixDLL() { if (fixLib) return; - fixLib = GetModuleHandleA("TLOUCore.asi"); + fixLib = LoadLibraryA("TLOUCore.dll"); if (!fixLib) { MessageBoxA(nullptr, "Impossible to laod game core dll", "Erreur", MB_OK); @@ -169,7 +169,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Generic fix ImGui::SetCursorPos(ImVec2(10, 60)); - ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = border if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("Fix enabled", &fix_enabled)) { @@ -181,7 +181,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // FOV adjustment ImGui::SetCursorPos(ImVec2(10, 120)); - ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::SetNextItemWidth(150.0f); @@ -195,7 +195,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Camera distance adjustment ImGui::SetCursorPos(ImVec2(10, 200)); - ImGui::BeginChild("CAMERAHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("CAMERAHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("Camera distance", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::SetNextItemWidth(150.0f); @@ -209,7 +209,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Sharpness adjustment ImGui::SetCursorPos(ImVec2(10, 280)); - ImGui::BeginChild("SHARPNESSHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("SHARPNESSHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("Sharpness", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::SetNextItemWidth(150.0f); @@ -223,7 +223,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Individual fixes ImGui::SetCursorPos(ImVec2(240, 60)); - ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); // true = bordure + ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); // true = border if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("Enable FOV Fix", &fov_fix_enabled)) { @@ -247,8 +247,12 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Fix status ImGui::SetCursorPos(ImVec2(10, 350)); - ImGui::Text("=============== Fix informations ==============="); - ImGui::Text("FOV In: %.2f, Out : %.2f", GetFOVIn(), GetFOVOut()); + ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true); + if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::Text("FOV In: %.2f, Out : %.2f", GetFOVIn(), GetFOVOut()); + } + ImGui::EndChild(); } // Main dll intrance diff --git a/TLOU2/dllmain.cpp b/TLOU2/dllmain.cpp index c5ff2e6..9ad1534 100644 --- a/TLOU2/dllmain.cpp +++ b/TLOU2/dllmain.cpp @@ -5,9 +5,6 @@ #include #include #include -#include -#include -#include // Core game dll functions declarations typedef void (*SetBoolFn)(bool,bool); @@ -47,16 +44,15 @@ const char* CAMERA_SETTING = "Camera="; const char* SHARPNESS_SETTING = "Sharpness="; const char* FIX_VERSION = "1.0.2"; const char* FIX_INFORMATIONS = "This fix allows to:\r\n - Control in game FOV.\r\n - Control camera distance.\r\n - Disable image sharpening.\r\n\r\nModifying FOV may affect performance.\r\nSharpening, when set to 0 in game still applies some slight effect to images.\r\nSet the slider to 0 to completely deactivate it.\r\nA good range result would be between 0-1.\r\nCamera distance in settings is a scale between 0.9 - 1.1 (-5 to +5 slider)."; -const char* DONATION_URL = "https://www.paypal.com/donate/?business=W92C47N3WZZZG&no_recurring=0¤cy_code=EUR"; +const char* DONATION_URL = "https://buymeacoffee.com/k4sh44"; // Load and unload game core dll functions /!\ necessary static void LoadFixDLL() { if (fixLib) return; - fixLib = GetModuleHandleA("TLOU2Core.asi"); // ou EmpireOfTheAntsCore.dll si tu gardes le .dll + fixLib = LoadLibraryA("TLOU2Core.dll"); if (!fixLib) { - // Optionnel: message d'erreur ou fallback MessageBoxA(nullptr, "Impossible to laod game core dll", "Erreur", MB_OK); return; } @@ -173,7 +169,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Generic fix ImGui::SetCursorPos(ImVec2(10, 60)); - ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = border if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("Fix enabled", &fix_enabled)) { @@ -185,7 +181,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // FOV adjustment ImGui::SetCursorPos(ImVec2(10, 120)); - ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::SetNextItemWidth(150.0f); @@ -199,7 +195,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Camera distance adjustment ImGui::SetCursorPos(ImVec2(10, 200)); - ImGui::BeginChild("CAMERAHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("CAMERAHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("Camera distance", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::SetNextItemWidth(150.0f); @@ -213,7 +209,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Sharpness adjustment ImGui::SetCursorPos(ImVec2(10, 280)); - ImGui::BeginChild("SHARPNESSHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("SHARPNESSHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("Sharpness", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::SetNextItemWidth(150.0f); @@ -227,7 +223,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Individual fixes ImGui::SetCursorPos(ImVec2(240, 60)); - ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); // true = bordure + ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("Enable FOV Fix", &fov_fix_enabled)) { @@ -251,8 +247,12 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Fix status ImGui::SetCursorPos(ImVec2(10, 350)); - ImGui::Text("=============== Fix informations ==============="); - ImGui::Text("FOV In: %.2f, Out : %.2f", GetFOVIn(), GetFOVOut()); + ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true); + if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); + ImGui::Text("FOV In: %.2f, Out : %.2f", GetFOVIn(), GetFOVOut()); + } + ImGui::EndChild(); } DWORD WINAPI MainThread(LPVOID) @@ -274,7 +274,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD ul_reason_for_call, LPVOID) return FALSE; LoadSettings(); - reshade::register_overlay("The Last Of Us : PArt II", &on_overlay_draw); + reshade::register_overlay("The Last Of Us : Part II", &on_overlay_draw); reshade::register_event( [](reshade::api::effect_runtime* runtime) { LoadFixDLL(); diff --git a/Uncharted LOTC/dllmain.cpp b/Uncharted LOTC/dllmain.cpp index 9008156..8118232 100644 --- a/Uncharted LOTC/dllmain.cpp +++ b/Uncharted LOTC/dllmain.cpp @@ -5,7 +5,6 @@ #include #include #include -#include // Core game dll functions declarations typedef void (*SetBoolFn)(bool,bool); @@ -67,7 +66,7 @@ const char* DONATION_URL = "https://buymeacoffee.com/k4sh44"; static void LoadFixDLL() { if (fixLib) return; - fixLib = GetModuleHandleA("UnchartedLOTCCore.asi"); + fixLib = LoadLibraryA("UnchartedLOTCCore.dll"); if (!fixLib) { MessageBoxA(nullptr, "Impossible to load game core dll", "Erreur", MB_OK); @@ -214,7 +213,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Generic fix ImGui::SetCursorPos(ImVec2(10, 60)); - ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = border if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::Checkbox("Fix enabled", &fix_enabled)) { @@ -226,7 +225,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // FOV adjustment ImGui::SetCursorPos(ImVec2(10, 120)); - ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::SetNextItemWidth(150.0f); @@ -239,7 +238,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) ImGui::EndChild(); ImGui::SetCursorPos(ImVec2(10, 180)); - ImGui::BeginChild("PhotoFOVHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("PhotoFOVHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("Photo mode additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::SetNextItemWidth(150.0f); @@ -252,7 +251,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) ImGui::EndChild(); ImGui::SetCursorPos(ImVec2(10, 240)); - ImGui::BeginChild("AspectHeader", ImVec2(220, 0), false); // true = bordure + ImGui::BeginChild("AspectHeader", ImVec2(220, 0), false); if (ImGui::CollapsingHeader("Game aspect ratio", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); if (ImGui::InputFloat("", &aspectRatiovalue, 0.0f, 0.0f, "% .2f")) { @@ -264,7 +263,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) ImGui::EndChild(); // Individual fixes ImGui::SetCursorPos(ImVec2(240, 60)); - ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); // true = bordure + ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false); if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) { ImGui::SetCursorPos(ImVec2(5, 30)); // FOV if (ImGui::Checkbox("Enable FOV fix", &fov_fix_enabled)) { @@ -306,9 +305,12 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) // Fix status ImGui::SetCursorPos(ImVec2(10, 300)); - ImGui::Text("=============== Fix informations ==============="); - if (GetFOVIn && GetFOVOut) + ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true); + if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) { + ImGui::SetCursorPos(ImVec2(5, 30)); ImGui::Text("FOV In: %.2f, Out : %.2f", GetFOVIn(), GetFOVOut()); + } + ImGui::EndChild(); } // Main dll intrance