Add HUD fix and cheats. Code refactoring
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
#define IMGUI_DISABLE_INCLUDE_IMCONFIG_H
|
#define IMGUI_DISABLE_INCLUDE_IMCONFIG_H
|
||||||
#define IMGUI_HAS_DOCK 1
|
#define IMGUI_HAS_DOCK 1
|
||||||
|
|
||||||
#include "GameInformations.h"
|
#include "CommonHeaders.h"
|
||||||
#include "GameFixes.h"
|
//#include "GameInformations.h"
|
||||||
#include "inicpp.h"
|
//#include "GameFixes.h"
|
||||||
#include <imgui.h>
|
//#include "inicpp.h"
|
||||||
#include <reshade.hpp>
|
//#include <imgui.h>
|
||||||
|
//#include <reshade.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
@@ -15,27 +16,38 @@ static int screenHeight = GetSystemMetrics(SM_CYSCREEN);
|
|||||||
static float aspectRatio = (float)screenWidth / screenHeight;
|
static float aspectRatio = (float)screenWidth / screenHeight;
|
||||||
|
|
||||||
// Core game dll functions declarations
|
// Core game dll functions declarations
|
||||||
|
//typedef void (*SetBoolFn)(bool, bool);
|
||||||
|
//typedef void (*SetFixesFn)(GameFixes ,bool);
|
||||||
|
//typedef void (*SetIntFn)(int);
|
||||||
typedef void (*SetBoolFn)(bool, bool);
|
typedef void (*SetBoolFn)(bool, bool);
|
||||||
typedef void (*SetFixesFn)(GameFixes ,bool);
|
typedef void (*SetFixesFn)(GameFixes, bool);
|
||||||
typedef void (*SetIntFn)(int);
|
typedef void (*SetFloatFn)(GameSetting, float);
|
||||||
|
|
||||||
static HMODULE fixLib = nullptr;
|
static HMODULE fixLib = nullptr;
|
||||||
static LONG g_coreInitialized = 0;
|
static LONG g_coreInitialized = 0;
|
||||||
static SetBoolFn SetFixEnabled = nullptr;
|
static SetBoolFn SetFixEnabled = nullptr;
|
||||||
static SetFixesFn SetFixesEnabled = nullptr;
|
static SetFixesFn SetFixes = nullptr;
|
||||||
static SetIntFn SetFOV = nullptr;
|
static SetFloatFn SetValues = nullptr;
|
||||||
|
void SetFixesEnabled(GameFixes fix, bool value) { if (SetFixes) SetFixes(fix, value); }
|
||||||
|
|
||||||
|
//static SetIntFn SetFOV = nullptr;
|
||||||
static GetGameInfosStruct GetGameInfos = nullptr;
|
static GetGameInfosStruct GetGameInfos = nullptr;
|
||||||
|
|
||||||
// Plugin variables for checkboxes and sliders
|
// Plugin variables for checkboxes and sliders
|
||||||
static bool fov_fix_enabled = false;
|
static bool fov_fix_enabled = false;
|
||||||
static bool ultrawide_fix_enabled = false;
|
static bool ultrawide_fix_enabled = false;
|
||||||
|
static bool HUD_fix_enabled = false;
|
||||||
static bool DOF_fix_enabled = false;
|
static bool DOF_fix_enabled = false;
|
||||||
static bool CA_fix_enabled = false;
|
static bool CA_fix_enabled = false;
|
||||||
static bool Vignetting_fix_enabled = false;
|
static bool Vignetting_fix_enabled = false;
|
||||||
static bool Fog_fix_enabled = false;
|
static bool Fog_fix_enabled = false;
|
||||||
static bool fix_enabled = false;
|
static bool fix_enabled = false;
|
||||||
|
static bool Time_Dilation_fix_enabled = false;
|
||||||
static bool console = true;
|
static bool console = true;
|
||||||
static int worldFOVvalue = 0;
|
static int worldFOVvalue = 0;
|
||||||
|
static int HUDOffsetValue = 0;
|
||||||
|
static float worldTimeDilationValue = 1.f;
|
||||||
|
static float AITimeDilationValue = 1.f;
|
||||||
|
|
||||||
// Overlays popups
|
// Overlays popups
|
||||||
static bool popup_Informations = false;
|
static bool popup_Informations = false;
|
||||||
@@ -44,12 +56,31 @@ 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.2";
|
||||||
const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV in game.\n - Enable ultrawide in custcenes.\n - Disable depth of field.\n - Disable chromatic aberrations.\n - Disable vignetting.\n - Disable fog.\n - Re enable dev console.";
|
const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV in game.\n - Enable ultrawide in custcenes.\n - Disable depth of field.\n - Disable chromatic aberrations.\n - Disable vignetting.\n - Disable fog.\n - Re enable dev console.\n - Enable cheats.";
|
||||||
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
|
||||||
float scale = 1.f;
|
float scale = (float)screenHeight / 1200;
|
||||||
|
|
||||||
|
// Prepare arrays of checkboxes for ImGui
|
||||||
|
static FixToggle individualFixes[] = {
|
||||||
|
{ "FOV", &fov_fix_enabled, GameFixes::FOV },
|
||||||
|
{ "Vignetting", &Vignetting_fix_enabled, GameFixes::Vignetting },
|
||||||
|
{ "Fog", &Fog_fix_enabled, GameFixes::Fog, "This fix will disable all fogs including volumetric fog."},
|
||||||
|
{ "Ultrawide", &ultrawide_fix_enabled, GameFixes::UltraWide },
|
||||||
|
{ "HUD scaling", &HUD_fix_enabled, GameFixes::HUD },
|
||||||
|
{ "Depth of field", &DOF_fix_enabled, GameFixes::DOF },
|
||||||
|
{ "Chromatic aberrations", &CA_fix_enabled, GameFixes::ChromaticAberrations }
|
||||||
|
};
|
||||||
|
|
||||||
|
static FixToggle cheatFixes[] = {
|
||||||
|
{ "Time dilation", &Time_Dilation_fix_enabled, GameFixes::TimeDilation, "ALT + 1 (top keyboard row) to toggle" }
|
||||||
|
//{ "God mode", &GodMode_fix_enabled, GameFixes::GodMode, "ALT + 2 (top keyboard row) to toggle.\nPlayer health bar will restore." },
|
||||||
|
//{ "Stealth mode",&StealthMode_fix_enabled, GameFixes::Stealth, "ALT + 3 (top keyboard row) to toggle.\nEnemies won't attack you." }
|
||||||
|
};
|
||||||
|
// Prepare array of sliders for ImGui
|
||||||
|
static SliderFix2 sliders[4];
|
||||||
|
|
||||||
// Load and unload game core dll functions /!\ necessary
|
// Load and unload game core dll functions /!\ necessary
|
||||||
static void LoadFixDLL()
|
static void LoadFixDLL()
|
||||||
@@ -66,28 +97,42 @@ static void LoadFixDLL()
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFixEnabled");
|
SetFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFixEnabled");
|
||||||
SetFixesEnabled = (SetFixesFn)GetProcAddress(fixLib, "SetFixesEnabled");
|
SetFixes = (SetFixesFn)GetProcAddress(fixLib, "SetFixesEnabled");
|
||||||
SetFOV = (SetIntFn)GetProcAddress(fixLib, "SetFOV");
|
SetValues = (SetFloatFn)GetProcAddress(fixLib, "SetValues");
|
||||||
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);
|
// Apply initial values loaded from settings
|
||||||
if (SetFixEnabled) SetFixEnabled(fix_enabled, true);
|
if (SetValues) {
|
||||||
if (SetFixesEnabled) {
|
SetValues(GameSetting::FOV, worldFOVvalue);
|
||||||
SetFixesEnabled(GameFixes::FOV, fov_fix_enabled);
|
SetValues(GameSetting::HUD, HUDOffsetValue);
|
||||||
SetFixesEnabled(GameFixes::UltraWide, ultrawide_fix_enabled);
|
SetValues(GameSetting::WorldTimeDilation, worldTimeDilationValue);
|
||||||
SetFixesEnabled(GameFixes::DOF, DOF_fix_enabled);
|
SetValues(GameSetting::AITimeDilation, AITimeDilationValue);
|
||||||
SetFixesEnabled(GameFixes::ChromaticAberrations, CA_fix_enabled);
|
|
||||||
SetFixesEnabled(GameFixes::Vignetting, Vignetting_fix_enabled);
|
|
||||||
SetFixesEnabled(GameFixes::Fog, Fog_fix_enabled);
|
|
||||||
SetFixesEnabled(GameFixes::DevConsole, console);
|
|
||||||
}
|
}
|
||||||
|
if (SetFixEnabled) SetFixEnabled(fix_enabled, true);
|
||||||
|
if (SetFixes) {
|
||||||
|
SetFixes(GameFixes::FOV, fov_fix_enabled);
|
||||||
|
SetFixes(GameFixes::UltraWide, ultrawide_fix_enabled);
|
||||||
|
SetFixes(GameFixes::HUD, HUD_fix_enabled);
|
||||||
|
SetFixes(GameFixes::DOF, DOF_fix_enabled);
|
||||||
|
SetFixes(GameFixes::ChromaticAberrations, CA_fix_enabled);
|
||||||
|
SetFixes(GameFixes::Vignetting, Vignetting_fix_enabled);
|
||||||
|
SetFixes(GameFixes::Fog, Fog_fix_enabled);
|
||||||
|
SetFixes(GameFixes::TimeDilation, Time_Dilation_fix_enabled);
|
||||||
|
SetFixes(GameFixes::DevConsole, console);
|
||||||
|
}
|
||||||
|
|
||||||
|
sliders[0] = { "In game additional FOV", "##FOVValue", SliderType::Int, &worldFOVvalue, -20, 70, GameSetting::FOV, SetValues };
|
||||||
|
sliders[1] = { "HUD scaling", "##HUDScaling", SliderType::Int, &HUDOffsetValue, 0, 30, GameSetting::HUD, SetValues };
|
||||||
|
sliders[2] = { "World time dilation", "##WorldTimeDilationValue", SliderType::Float, &worldTimeDilationValue, 0.f, 2.f,GameSetting::WorldTimeDilation , SetValues, nullptr,
|
||||||
|
"Will affect everything in the world.\nDefault value is 1." };
|
||||||
|
sliders[3] = { "AI time dilation", "##AITimeDilationValue", SliderType::Float, &AITimeDilationValue, 0.f, 2.f, GameSetting::AITimeDilation, SetValues, nullptr,
|
||||||
|
"Will affect only enemies in the world.\nDefault value is 1." };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Settings functions
|
// Settings functions
|
||||||
static void SaveSettings()
|
static void SaveSettings() {
|
||||||
{
|
|
||||||
ini::IniFile pluginIniFile;
|
ini::IniFile pluginIniFile;
|
||||||
pluginIniFile["1#General fix"].setComment(std::vector<std::string>{ "The following sections are saved by plugin",
|
pluginIniFile["1#General fix"].setComment(std::vector<std::string>{ "The following sections are saved by plugin",
|
||||||
"You should not need to modify them",
|
"You should not need to modify them",
|
||||||
@@ -99,18 +144,23 @@ static void SaveSettings()
|
|||||||
pluginIniFile["2#Individual fix"].setComment("Controls each fix individually");
|
pluginIniFile["2#Individual fix"].setComment("Controls each fix individually");
|
||||||
pluginIniFile["2#Individual fix"]["FOV"] = fov_fix_enabled;
|
pluginIniFile["2#Individual fix"]["FOV"] = fov_fix_enabled;
|
||||||
pluginIniFile["2#Individual fix"]["UltraWide"] = ultrawide_fix_enabled;
|
pluginIniFile["2#Individual fix"]["UltraWide"] = ultrawide_fix_enabled;
|
||||||
|
pluginIniFile["2#Individual fix"]["HUD"] = HUD_fix_enabled;
|
||||||
pluginIniFile["2#Individual fix"]["DOF"] = DOF_fix_enabled;
|
pluginIniFile["2#Individual fix"]["DOF"] = DOF_fix_enabled;
|
||||||
pluginIniFile["2#Individual fix"]["Chromatic aberrations"] = CA_fix_enabled;
|
pluginIniFile["2#Individual fix"]["Chromatic aberrations"] = CA_fix_enabled;
|
||||||
pluginIniFile["2#Individual fix"]["Vignetting"] = Vignetting_fix_enabled;
|
pluginIniFile["2#Individual fix"]["Vignetting"] = Vignetting_fix_enabled;
|
||||||
pluginIniFile["2#Individual fix"]["Fog"] = Fog_fix_enabled;
|
pluginIniFile["2#Individual fix"]["Fog"] = Fog_fix_enabled;
|
||||||
|
pluginIniFile["2#Individual fix"]["Time dilation"] = Time_Dilation_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"]["HUD scaling"] = HUDOffsetValue;
|
||||||
|
pluginIniFile["3#Fixes tuning"]["HUD scaling"] = HUDOffsetValue;
|
||||||
|
pluginIniFile["3#Fixes tuning"]["World time dilation scale"] = worldTimeDilationValue;
|
||||||
|
pluginIniFile["3#Fixes tuning"]["AI time dilation scale"] = AITimeDilationValue;
|
||||||
|
|
||||||
pluginIniFile.save(SETTINGS_FILE);
|
pluginIniFile.save(SETTINGS_FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LoadSettings()
|
static void LoadSettings() {
|
||||||
{
|
|
||||||
ini::IniFile pluginIniFile;
|
ini::IniFile pluginIniFile;
|
||||||
try {
|
try {
|
||||||
pluginIniFile.load(SETTINGS_FILE);
|
pluginIniFile.load(SETTINGS_FILE);
|
||||||
@@ -118,11 +168,16 @@ static void LoadSettings()
|
|||||||
console = pluginIniFile["1#General fix"]["Console"].as<bool>();
|
console = pluginIniFile["1#General fix"]["Console"].as<bool>();
|
||||||
fov_fix_enabled = pluginIniFile["2#Individual fix"]["FOV"].as<bool>();
|
fov_fix_enabled = pluginIniFile["2#Individual fix"]["FOV"].as<bool>();
|
||||||
ultrawide_fix_enabled = pluginIniFile["2#Individual fix"]["UltraWide"].as<bool>();
|
ultrawide_fix_enabled = pluginIniFile["2#Individual fix"]["UltraWide"].as<bool>();
|
||||||
|
HUD_fix_enabled = pluginIniFile["2#Individual fix"]["HUD"].as<bool>();
|
||||||
DOF_fix_enabled = pluginIniFile["2#Individual fix"]["DOF"].as<bool>();
|
DOF_fix_enabled = pluginIniFile["2#Individual fix"]["DOF"].as<bool>();
|
||||||
CA_fix_enabled = pluginIniFile["2#Individual fix"]["Chromatic aberrations"].as<bool>();
|
CA_fix_enabled = pluginIniFile["2#Individual fix"]["Chromatic aberrations"].as<bool>();
|
||||||
Vignetting_fix_enabled = pluginIniFile["2#Individual fix"]["Vignetting"].as<bool>();
|
Vignetting_fix_enabled = pluginIniFile["2#Individual fix"]["Vignetting"].as<bool>();
|
||||||
Fog_fix_enabled = pluginIniFile["2#Individual fix"]["Fog"].as<bool>();
|
Fog_fix_enabled = pluginIniFile["2#Individual fix"]["Fog"].as<bool>();
|
||||||
|
Time_Dilation_fix_enabled = pluginIniFile["2#Individual fix"]["Time dilation"].as<bool>();
|
||||||
worldFOVvalue = pluginIniFile["3#Fixes tuning"]["World FOV"].as<int>();
|
worldFOVvalue = pluginIniFile["3#Fixes tuning"]["World FOV"].as<int>();
|
||||||
|
HUDOffsetValue = pluginIniFile["3#Fixes tuning"]["HUD scaling"].as<int>();
|
||||||
|
worldTimeDilationValue = pluginIniFile["3#Fixes tuning"]["World time dilation scale"].as<float>();
|
||||||
|
AITimeDilationValue = pluginIniFile["3#Fixes tuning"]["AI time dilation scale"].as<float>();
|
||||||
}
|
}
|
||||||
catch (const std::exception& e) {}
|
catch (const std::exception& e) {}
|
||||||
}
|
}
|
||||||
@@ -142,14 +197,7 @@ void read_log_file(const std::string& filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialize ImGui widgets for Reshade
|
// Initialize ImGui widgets for Reshade
|
||||||
static void on_overlay_draw(reshade::api::effect_runtime* runtime)
|
static void on_overlay_draw(reshade::api::effect_runtime* runtime) {
|
||||||
{
|
|
||||||
ImGuiStyle& style = ImGui::GetStyle();
|
|
||||||
style.ItemSpacing = ImVec2(8 * scale, 8 * scale); // Spacing between widgets
|
|
||||||
style.FramePadding = ImVec2(3 * scale, 3 * scale); // Widgets padding
|
|
||||||
style.WindowPadding = ImVec2(10 * scale, 10 * scale); // Overlay padding
|
|
||||||
style.CellPadding = ImVec2(10 * scale, 10 * scale); // Table cells padding
|
|
||||||
|
|
||||||
ImGui::SetNextWindowSize(ImVec2(350 * scale, 150 * scale), ImGuiCond_Once);
|
ImGui::SetNextWindowSize(ImVec2(350 * scale, 150 * scale), ImGuiCond_Once);
|
||||||
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.84f, 0.12f, 0.51f, 1.0f)); // pink
|
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.84f, 0.12f, 0.51f, 1.0f)); // pink
|
||||||
@@ -166,111 +214,111 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime)
|
|||||||
show_log_overlay = true; // Fix information
|
show_log_overlay = true; // Fix information
|
||||||
}
|
}
|
||||||
|
|
||||||
if (popup_Informations)
|
if (popup_Informations) {
|
||||||
{
|
|
||||||
ImGui::Begin("Informations", &popup_Informations, ImGuiWindowFlags_AlwaysAutoResize);
|
ImGui::Begin("Informations", &popup_Informations, ImGuiWindowFlags_AlwaysAutoResize);
|
||||||
ImGui::Text("Version : %s", FIX_VERSION);
|
ImGui::Text("Version : %s", FIX_VERSION);
|
||||||
ImGui::Text(FIX_INFORMATIONS);
|
ImGui::Text(FIX_INFORMATIONS);
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (show_log_overlay)
|
if (show_log_overlay) {
|
||||||
{
|
|
||||||
ImGui::Begin("Game log", &show_log_overlay, ImGuiWindowFlags_AlwaysAutoResize);
|
ImGui::Begin("Game log", &show_log_overlay, ImGuiWindowFlags_AlwaysAutoResize);
|
||||||
ImGui::TextUnformatted(log_content.c_str());
|
ImGui::TextUnformatted(log_content.c_str());
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::BeginTable("FixesTable", 2, ImGuiTableFlags_SizingStretchSame)) {
|
if (ImGui::BeginTabBar("MainTabs")) {
|
||||||
ImGui::TableSetupColumn("LeftFix", ImGuiTableColumnFlags_WidthStretch, 0.4f);
|
if (ImGui::BeginTabItem("Fixes")) {
|
||||||
ImGui::TableSetupColumn("RightFix", ImGuiTableColumnFlags_WidthStretch, 0.6f);
|
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2(10 * scale, 10 * scale));
|
||||||
ImGui::TableNextRow();
|
if (ImGui::BeginTable("FixesTable", 2, ImGuiTableFlags_SizingStretchSame)) {
|
||||||
|
ImGui::TableSetupColumn("LeftFix", ImGuiTableColumnFlags_WidthStretch, 0.4f);
|
||||||
// Drawing a left column with slider and general fix
|
ImGui::TableSetupColumn("RightFix", ImGuiTableColumnFlags_WidthStretch, 0.6f);
|
||||||
ImGui::TableSetColumnIndex(0);
|
|
||||||
if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen))
|
|
||||||
if (ImGui::Checkbox("Fix enabled", &fix_enabled)) {
|
|
||||||
if (SetFixEnabled) SetFixEnabled(fix_enabled, false);
|
|
||||||
SaveSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sliders
|
|
||||||
ImGui::TableSetColumnIndex(0);
|
|
||||||
if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen))
|
|
||||||
{
|
|
||||||
ImGui::SetNextItemWidth(180 * scale);
|
|
||||||
if (ImGui::SliderInt("##FOVValue", &worldFOVvalue, -20, 70)) {
|
|
||||||
if (SetFOV) SetFOV(worldFOVvalue);
|
|
||||||
SaveSettings();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Individual fixes
|
|
||||||
ImGui::TableSetColumnIndex(1);
|
|
||||||
if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) {
|
|
||||||
if (ImGui::BeginTable("IndividualFixesTable", 2, ImGuiTableFlags_SizingStretchSame)) {
|
|
||||||
ImGui::TableSetupColumn("IndFix1", ImGuiTableColumnFlags_WidthStretch, 0.4f);
|
|
||||||
ImGui::TableSetupColumn("IndFix2", ImGuiTableColumnFlags_WidthStretch, 0.6f);
|
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
|
|
||||||
|
// Drawing a left column with slider and general fix
|
||||||
ImGui::TableSetColumnIndex(0);
|
ImGui::TableSetColumnIndex(0);
|
||||||
if (ImGui::Checkbox("FOV", &fov_fix_enabled)) {
|
if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen))
|
||||||
if (SetFixesEnabled) SetFixesEnabled(GameFixes::FOV, fov_fix_enabled);
|
if (ImGui::Checkbox("Fix enabled", &fix_enabled)) {
|
||||||
SaveSettings();
|
if (SetFixEnabled) SetFixEnabled(fix_enabled, false);
|
||||||
}
|
SaveSettings();
|
||||||
|
}
|
||||||
if (ImGui::Checkbox("Vignetting", &Vignetting_fix_enabled)) {
|
// Individual fixes
|
||||||
if (SetFixesEnabled) SetFixesEnabled(GameFixes::Vignetting, Vignetting_fix_enabled);
|
|
||||||
SaveSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ImGui::Checkbox("Fog", &Fog_fix_enabled)) {
|
|
||||||
if (SetFixesEnabled) SetFixesEnabled(GameFixes::Fog, Fog_fix_enabled);
|
|
||||||
SaveSettings();
|
|
||||||
}
|
|
||||||
if (ImGui::IsItemHovered()) {
|
|
||||||
ImGui::BeginTooltip();
|
|
||||||
ImGui::Text("This fix will disable all fogs including volumetric fog.");
|
|
||||||
ImGui::EndTooltip();
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::TableSetColumnIndex(1);
|
ImGui::TableSetColumnIndex(1);
|
||||||
if (ImGui::Checkbox("Ultrawide", &ultrawide_fix_enabled)) {
|
if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) {
|
||||||
if (SetFixesEnabled) SetFixesEnabled(GameFixes::UltraWide, ultrawide_fix_enabled);
|
if (ImGui::BeginTable("IndividualFixesTable", 2, ImGuiTableFlags_SizingStretchSame)) {
|
||||||
SaveSettings();
|
ImGui::TableSetupColumn("IndFix1", ImGuiTableColumnFlags_WidthStretch, 0.4f);
|
||||||
}
|
ImGui::TableSetupColumn("IndFix2", ImGuiTableColumnFlags_WidthStretch, 0.6f);
|
||||||
|
ImGui::TableNextRow();
|
||||||
|
|
||||||
if (ImGui::Checkbox("Depth of field", &DOF_fix_enabled)) {
|
ImGui::TableSetColumnIndex(0);
|
||||||
if (SetFixesEnabled) SetFixesEnabled(GameFixes::DOF, DOF_fix_enabled);
|
for (int i = 0; i < 3; ++i) DrawFixCheckbox(individualFixes[i]);
|
||||||
SaveSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ImGui::Checkbox("Chromatic aberrations", &CA_fix_enabled)) {
|
ImGui::TableSetColumnIndex(1);
|
||||||
if (SetFixesEnabled) SetFixesEnabled(GameFixes::ChromaticAberrations ,CA_fix_enabled);
|
for (int i = 3; i < IM_ARRAYSIZE(individualFixes); ++i) DrawFixCheckbox(individualFixes[i]);
|
||||||
SaveSettings();
|
|
||||||
|
ImGui::EndTable();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
ImGui::EndTable();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fix status
|
ImGui::SetCursorPosY(ImGui::GetCursorPosY() - 2 /** 1 style.ItemSpacing.y*/);
|
||||||
if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) {
|
if (ImGui::BeginTable("FixesSliders", 2, ImGuiTableFlags_SizingStretchSame)) {
|
||||||
ImGui::Text("Screen width: %d, height: %d, aspect ratio: %.2f", screenWidth, screenHeight, aspectRatio);
|
ImGui::TableNextRow();
|
||||||
if (GetGameInfos) {
|
ImGui::TableSetColumnIndex(0);
|
||||||
GameInfos infos{};
|
for (int i = 0; i < 1; ++i) DrawSlider2(sliders[i], 200);
|
||||||
GetGameInfos(&infos);
|
ImGui::TableSetColumnIndex(1);
|
||||||
if (infos.consoleEnabled)
|
for (int i = 1; i < 2; ++i) DrawSlider2(sliders[i], 200);
|
||||||
ImGui::Text("Console enabled and bound to key F2");
|
ImGui::EndTable();
|
||||||
ImGui::TextColored(ImColor(48, 179, 25), "FOV In: %.2f, Out: %.2f", infos.FOVIn, infos.FOVOut);
|
}
|
||||||
|
ImGui::PopStyleVar();
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::BeginTabItem("Cheats")) {
|
||||||
|
for (const auto& cheat : cheatFixes) DrawFixCheckbox(cheat);
|
||||||
|
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2(10 * scale, 10 * scale));
|
||||||
|
if (ImGui::BeginTable("SlidersTable", 2, ImGuiTableFlags_SizingStretchSame)) {
|
||||||
|
ImGui::TableSetupColumn("LeftSliders", ImGuiTableColumnFlags_WidthStretch, 0.5f);
|
||||||
|
ImGui::TableSetupColumn("RightSliders", ImGuiTableColumnFlags_WidthStretch, 0.5f);
|
||||||
|
ImGui::TableNextRow();
|
||||||
|
|
||||||
|
ImGui::TableSetColumnIndex(0);
|
||||||
|
DrawSlider2(sliders[2], 180);
|
||||||
|
ImGui::TableSetColumnIndex(1);
|
||||||
|
DrawSlider2(sliders[3], 180);
|
||||||
|
ImGui::EndTable();
|
||||||
|
}
|
||||||
|
ImGui::PopStyleVar();
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
if (ImGui::CollapsingHeader("Cheat informations", ImGuiTreeNodeFlags_DefaultOpen)) {
|
||||||
|
if (GetGameInfos) {
|
||||||
|
GameInfos infos{};
|
||||||
|
GetGameInfos(&infos);
|
||||||
|
ImGui::TextColored(ImColor(48, 179, 25), "Player health: %.2f", infos.Health);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::EndTabBar();
|
||||||
|
|
||||||
|
// Fix status
|
||||||
|
if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) {
|
||||||
|
ImGui::Text("Screen width: %d, height: %d, aspect ratio: %.2f", screenWidth, screenHeight, aspectRatio);
|
||||||
|
if (GetGameInfos) {
|
||||||
|
GameInfos infos{};
|
||||||
|
GetGameInfos(&infos);
|
||||||
|
if (infos.consoleEnabled)
|
||||||
|
ImGui::Text("Console enabled and bound to key F2");
|
||||||
|
ImGui::TextColored(ImColor(48, 179, 25), "FOV In: %.2f, Out: %.2f", infos.FOVIn, infos.FOVOut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ImGui::PopStyleVar();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Main dll intrance
|
// Main dll intrance
|
||||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD ul_reason_for_call, LPVOID)
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD ul_reason_for_call, LPVOID) {
|
||||||
{
|
|
||||||
switch (ul_reason_for_call)
|
switch (ul_reason_for_call)
|
||||||
{
|
{
|
||||||
case DLL_PROCESS_ATTACH:
|
case DLL_PROCESS_ATTACH:
|
||||||
|
|||||||
Reference in New Issue
Block a user