Add Journal FOV fix. Add console disabling

This commit is contained in:
2025-11-12 10:41:49 +01:00
parent a6d132985c
commit ab365d1a70

View File

@@ -24,6 +24,7 @@ static LONG g_coreInitialized = 0;
static SetBoolFn SetFixEnabled = nullptr; static SetBoolFn SetFixEnabled = nullptr;
static SetFixesFn SetFixesEnabled = nullptr; static SetFixesFn SetFixesEnabled = nullptr;
static SetIntFn SetFOV = nullptr; static SetIntFn SetFOV = nullptr;
static SetIntFn SetJournalFOV = nullptr;
static SetIntFn SetHUD = nullptr; static SetIntFn SetHUD = nullptr;
static GetGameInfosStruct GetGameInfos = nullptr; static GetGameInfosStruct GetGameInfos = nullptr;
@@ -37,6 +38,7 @@ static bool HUD_fix_enabled = false;
static bool fix_enabled = false; static bool fix_enabled = false;
static bool console = true; static bool console = true;
static int worldFOVvalue = 0; static int worldFOVvalue = 0;
static int journalFOVvalue = 0;
static int HUDvalue = 0; static int HUDvalue = 0;
// Overlays popups // Overlays popups
@@ -47,7 +49,7 @@ static std::string log_content;
// Plugin settings // Plugin settings
const std::string SETTINGS_FILE = "./pluginsettings.ini"; const std::string SETTINGS_FILE = "./pluginsettings.ini";
const char* FIX_VERSION = "1.0.1"; const char* FIX_VERSION = "1.0.1";
const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV in game.\n - Disable depth of field.\n - Disable chromatic aberrations.\n - Disable vignetting.\n - Disable fog.\n - Control HUD safe zone.\n - Re enable dev console."; const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOVs in game.\n - Disable depth of field.\n - Disable chromatic aberrations.\n - Disable vignetting.\n - Disable fog.\n - Control HUD safe zone.\n - Re enable dev console.";
const char* DONATION_URL = "https://buymeacoffee.com/k4sh44"; const char* DONATION_URL = "https://buymeacoffee.com/k4sh44";
// Scaling factor based on screen resolution // Scaling factor based on screen resolution
@@ -70,11 +72,13 @@ static void LoadFixDLL()
SetFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFixEnabled"); SetFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFixEnabled");
SetFixesEnabled = (SetFixesFn)GetProcAddress(fixLib, "SetFixesEnabled"); SetFixesEnabled = (SetFixesFn)GetProcAddress(fixLib, "SetFixesEnabled");
SetFOV = (SetIntFn)GetProcAddress(fixLib, "SetFOV"); SetFOV = (SetIntFn)GetProcAddress(fixLib, "SetFOV");
SetJournalFOV = (SetIntFn)GetProcAddress(fixLib, "SetJournalFOV");
SetHUD = (SetIntFn)GetProcAddress(fixLib, "SetHUD"); SetHUD = (SetIntFn)GetProcAddress(fixLib, "SetHUD");
GetGameInfos = (GetGameInfosStruct)GetProcAddress(fixLib, "GetGameInfos"); GetGameInfos = (GetGameInfosStruct)GetProcAddress(fixLib, "GetGameInfos");
// Apply initial values loaded from settings // Apply initial values loaded from settings
if (SetFOV) SetFOV(worldFOVvalue); if (SetFOV) SetFOV(worldFOVvalue);
if (SetJournalFOV) SetJournalFOV(journalFOVvalue);
if (SetHUD) SetHUD(HUDvalue); if (SetHUD) SetHUD(HUDvalue);
if (SetFixEnabled) SetFixEnabled(fix_enabled, true); if (SetFixEnabled) SetFixEnabled(fix_enabled, true);
if (SetFixesEnabled) { if (SetFixesEnabled) {
@@ -84,7 +88,7 @@ static void LoadFixDLL()
SetFixesEnabled(GameFixes::Vignetting, Vignetting_fix_enabled); SetFixesEnabled(GameFixes::Vignetting, Vignetting_fix_enabled);
SetFixesEnabled(GameFixes::Fog, Fog_fix_enabled); SetFixesEnabled(GameFixes::Fog, Fog_fix_enabled);
SetFixesEnabled(GameFixes::HUD, HUD_fix_enabled); SetFixesEnabled(GameFixes::HUD, HUD_fix_enabled);
SetFixesEnabled(GameFixes::DevConsole, true); SetFixesEnabled(GameFixes::DevConsole, console);
} }
} }
} }
@@ -109,6 +113,7 @@ static void SaveSettings()
pluginIniFile["2#Individual fix"]["HUD"] = HUD_fix_enabled; pluginIniFile["2#Individual fix"]["HUD"] = HUD_fix_enabled;
pluginIniFile["3#Fixes tuning"].setComment("Individual fix fine tune"); pluginIniFile["3#Fixes tuning"].setComment("Individual fix fine tune");
pluginIniFile["3#Fixes tuning"]["World FOV"] = worldFOVvalue; pluginIniFile["3#Fixes tuning"]["World FOV"] = worldFOVvalue;
pluginIniFile["3#Fixes tuning"]["Journal FOV"] = journalFOVvalue;
pluginIniFile["3#Fixes tuning"]["HUD percent"] = HUDvalue; pluginIniFile["3#Fixes tuning"]["HUD percent"] = HUDvalue;
pluginIniFile.save(SETTINGS_FILE); pluginIniFile.save(SETTINGS_FILE);
@@ -128,6 +133,7 @@ static void LoadSettings()
Fog_fix_enabled = pluginIniFile["2#Individual fix"]["Fog"].as<bool>(); Fog_fix_enabled = pluginIniFile["2#Individual fix"]["Fog"].as<bool>();
HUD_fix_enabled = pluginIniFile["2#Individual fix"]["HUD"].as<bool>(); HUD_fix_enabled = pluginIniFile["2#Individual fix"]["HUD"].as<bool>();
worldFOVvalue = pluginIniFile["3#Fixes tuning"]["World FOV"].as<int>(); worldFOVvalue = pluginIniFile["3#Fixes tuning"]["World FOV"].as<int>();
journalFOVvalue = pluginIniFile["3#Fixes tuning"]["Journal FOV"].as<int>();
HUDvalue = pluginIniFile["3#Fixes tuning"]["HUD percent"].as<int>(); HUDvalue = pluginIniFile["3#Fixes tuning"]["HUD percent"].as<int>();
} }
catch (const std::exception& e) {} catch (const std::exception& e) {}
@@ -209,12 +215,22 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime)
if (SetFOV) SetFOV(worldFOVvalue); if (SetFOV) SetFOV(worldFOVvalue);
SaveSettings(); SaveSettings();
} }
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("This will change world FOV.");
ImGui::EndTooltip();
}
ImGui::SetNextItemWidth(180 * scale);
if (ImGui::SliderInt("##JournalFOVValue", &journalFOVvalue, -20, 40)) {
if (SetJournalFOV) SetJournalFOV(journalFOVvalue);
SaveSettings();
} }
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip(); ImGui::BeginTooltip();
ImGui::Text("This will affect in game FOV only."); ImGui::Text("This will change journal FOV.");
ImGui::EndTooltip(); ImGui::EndTooltip();
} }
}
if (ImGui::CollapsingHeader("HUD safe zone (*)", ImGuiTreeNodeFlags_DefaultOpen)) if (ImGui::CollapsingHeader("HUD safe zone (*)", ImGuiTreeNodeFlags_DefaultOpen))
{ {
@@ -239,7 +255,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime)
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
if (ImGui::Checkbox("FOV", &fov_fix_enabled)) { if (ImGui::Checkbox("FOVs", &fov_fix_enabled)) {
if (SetFixesEnabled) SetFixesEnabled(GameFixes::FOV, fov_fix_enabled); if (SetFixesEnabled) SetFixesEnabled(GameFixes::FOV, fov_fix_enabled);
SaveSettings(); SaveSettings();
} }