Add HUD scaling and AI time dilation
This commit is contained in:
@@ -17,7 +17,7 @@ typedef void (*InitloggerFn)();
|
||||
static HMODULE fixLib = nullptr;
|
||||
static LONG g_coreInitialized = 0;
|
||||
static LONG g_hotkeysInitialized = 0;
|
||||
static LONG g_uniformReseted = 0;
|
||||
static LONG g_uniformReseted = 0;
|
||||
static SetBoolFn SetFixEnabled = nullptr;
|
||||
static SetFixesFn SetFixes = nullptr;
|
||||
static SetFloatFn SetValues = nullptr;
|
||||
@@ -27,9 +27,9 @@ void SetFixesEnabled(GameFixes fix, bool value) { if (SetFixes) SetFixes(fix, va
|
||||
// Plugin variables for checkboxes and sliders
|
||||
static bool fov_fix_enabled = false;
|
||||
static bool ultrawide_fix_enabled = false;
|
||||
static bool HUD_fix_enabled = false;
|
||||
static bool camera_fix_enabled = false;
|
||||
static bool DOF_fix_enabled = false;
|
||||
static bool CA_fix_enabled = false;
|
||||
static bool Vignetting_fix_enabled = false;
|
||||
static bool Fog_fix_enabled = false;
|
||||
static bool fix_enabled = false;
|
||||
@@ -40,6 +40,7 @@ static bool StealthMode_fix_enabled = false;
|
||||
static bool console = true;
|
||||
static int worldFOVvalue = 0;
|
||||
static float cameraDistancevalue = 1.f;
|
||||
static int HUDvalue = 0;
|
||||
static float worldTimeDilationValue = 1.f;
|
||||
static float AITimeDilationValue = 1.f;
|
||||
static float OSD_duration = 3.f;
|
||||
@@ -51,7 +52,7 @@ static std::string log_content;
|
||||
// Plugin settings
|
||||
const char* SETTINGS_FILE = "PluginSettings.ini";
|
||||
const char* FIX_VERSION = "1.0.3";
|
||||
const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV.\n - Control camera distance.\n - Enable ultrawide in cutscene.\n - Disable pillarboxing in cutscenes.\n - Disable depth of field.\n - Disable vignetting.\n - Disable fog.\n - Enable cheats.";
|
||||
const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV.\n - Control camera distance.\n - Control HUD scaling.\n - Enable ultrawide in cutscene.\n - Disable depth of field.\n - Disable vignetting.\n - Disable fog.\n - Enable cheats.";
|
||||
const char* DONATION_URL = "https://buymeacoffee.com/k4sh44";
|
||||
|
||||
// Scaling factor based on screen resolution
|
||||
@@ -63,6 +64,7 @@ static FixToggle individualFixes[] = {
|
||||
{ "Vignetting", &Vignetting_fix_enabled, GameFixes::Vignetting },
|
||||
{ "Fog", &Fog_fix_enabled, GameFixes::Fog, "This fix will not remove all fogs."},
|
||||
{ "Ultrawide", &ultrawide_fix_enabled, GameFixes::UltraWide },
|
||||
{ "HUD", &HUD_fix_enabled, GameFixes::HUD },
|
||||
{ "Camera distance", &camera_fix_enabled, GameFixes::Camera },
|
||||
{ "Depth of field", &DOF_fix_enabled, GameFixes::DOF },
|
||||
};
|
||||
@@ -71,11 +73,11 @@ 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 won't decrease." },
|
||||
{ "Stamina", &Stamina_fix_enabled, GameFixes::Stamina, "ALT + 3 (top keyboard row) to toggle.\nPlayer stamina won't decrease." },
|
||||
{ "Stealth mode", &StealthMode_fix_enabled, GameFixes::Stealth, "ALT + 4 (top keyboard row) to toggle.\nEnemies will ignore you unless you attack them.\nThey still detect your presence." }
|
||||
{ "Stealth mode", &StealthMode_fix_enabled, GameFixes::Stealth, "ALT + 4 (top keyboard row) to toggle.\nEnemies will ignore you unless you attack them.\nThey still detect your presence.\nThis won't work with boss." }
|
||||
};
|
||||
|
||||
// Prepare array of sliders for ImGui
|
||||
static SliderFix2 sliders[4];
|
||||
static SliderFix2 sliders[5];
|
||||
|
||||
static void InitializeHotkeys();
|
||||
// Load and unload game core dll functions /!\ necessary
|
||||
@@ -101,6 +103,7 @@ static void LoadFixDLL(reshade::api::effect_runtime* runtime) {
|
||||
// Apply initial values loaded from settings
|
||||
if (SetValues) {
|
||||
SetValues(GameSetting::FOV, worldFOVvalue);
|
||||
SetValues(GameSetting::HUD, HUDvalue);
|
||||
SetValues(GameSetting::WorldTimeDilation, worldTimeDilationValue);
|
||||
SetValues(GameSetting::CameraDistance, cameraDistancevalue);
|
||||
}
|
||||
@@ -108,6 +111,7 @@ static void LoadFixDLL(reshade::api::effect_runtime* runtime) {
|
||||
if (SetFixes) {
|
||||
SetFixes(GameFixes::FOV, fov_fix_enabled);
|
||||
SetFixes(GameFixes::UltraWide, ultrawide_fix_enabled);
|
||||
SetFixes(GameFixes::HUD, HUD_fix_enabled);
|
||||
SetFixes(GameFixes::Camera, camera_fix_enabled);
|
||||
SetFixes(GameFixes::DOF, DOF_fix_enabled);
|
||||
SetFixes(GameFixes::Vignetting, Vignetting_fix_enabled);
|
||||
@@ -122,10 +126,11 @@ static void LoadFixDLL(reshade::api::effect_runtime* runtime) {
|
||||
sliders[0] = { "In game additional FOV", "##FOVValue", SliderType::Int, &worldFOVvalue, -20, 50, GameSetting::FOV, SetValues };
|
||||
sliders[1] = { "Camera distance (*)", "##CameraOffset", SliderType::Float, &cameraDistancevalue, 0, 4, GameSetting::CameraDistance, SetValues, "%.1f",
|
||||
"Value is a multiplier." };
|
||||
sliders[2] = { "World time dilation", "##WorldTimeDilationValue", SliderType::Float, &worldTimeDilationValue, 0.f, 3.f,GameSetting::WorldTimeDilation , SetValues, "%.1f",
|
||||
sliders[2] = { "HUD scaling", "##HUDValue", SliderType::Int, &HUDvalue, 0, 40, GameSetting::HUD, SetValues, nullptr, "This will only affect HUD" };
|
||||
sliders[3] = { "World time dilation", "##WorldTimeDilationValue", SliderType::Float, &worldTimeDilationValue, 0.f, 3.f,GameSetting::WorldTimeDilation , SetValues, "%.1f",
|
||||
"Will affect everything in the world.\nDefault value is 1." };
|
||||
sliders[3] = { "AI time dilation", "##AITimeDilationValue", SliderType::Float, &AITimeDilationValue, 0.f, 3.f,GameSetting::AITimeDilation , SetValues, "%.1f",
|
||||
"Will affect onmy ennemies.\nDefault value is 1." };
|
||||
sliders[4] = { "AI time dilation", "##AITimeDilationValue", SliderType::Float, &AITimeDilationValue, 0.f, 3.f,GameSetting::AITimeDilation , SetValues, "%.1f",
|
||||
"Will affect only ennemies.\nDefault value is 1." };
|
||||
}
|
||||
InitializeHotkeys();
|
||||
}
|
||||
@@ -143,6 +148,7 @@ static void SaveSettings() {
|
||||
pluginIniFile["2#Individual fix"].setComment("Controls each fix individually");
|
||||
pluginIniFile["2#Individual fix"]["FOV"] = fov_fix_enabled;
|
||||
pluginIniFile["2#Individual fix"]["UltraWide"] = ultrawide_fix_enabled;
|
||||
pluginIniFile["2#Individual fix"]["HUD"] = HUD_fix_enabled;
|
||||
pluginIniFile["2#Individual fix"]["Camera"] = camera_fix_enabled;
|
||||
pluginIniFile["2#Individual fix"]["DOF"] = DOF_fix_enabled;
|
||||
pluginIniFile["2#Individual fix"]["Vignetting"] = Vignetting_fix_enabled;
|
||||
@@ -153,6 +159,7 @@ static void SaveSettings() {
|
||||
pluginIniFile["2#Individual fix"]["Stealth"] = StealthMode_fix_enabled;
|
||||
pluginIniFile["3#Fixes tuning"].setComment("Individual fix fine tune");
|
||||
pluginIniFile["3#Fixes tuning"]["World FOV"] = worldFOVvalue;
|
||||
pluginIniFile["3#Fixes tuning"]["HUD scaling"] = HUDvalue;
|
||||
pluginIniFile["3#Fixes tuning"]["Camera distance"] = cameraDistancevalue;
|
||||
pluginIniFile["3#Fixes tuning"]["World time dilation scale"] = worldTimeDilationValue;
|
||||
pluginIniFile["3#Fixes tuning"]["AI time dilation scale"] = AITimeDilationValue;
|
||||
@@ -168,6 +175,7 @@ static void LoadSettings() {
|
||||
console = pluginIniFile["1#General fix"]["Console"].as<bool>();
|
||||
fov_fix_enabled = pluginIniFile["2#Individual fix"]["FOV"].as<bool>();
|
||||
ultrawide_fix_enabled = pluginIniFile["2#Individual fix"]["UltraWide"].as<bool>();
|
||||
HUD_fix_enabled = pluginIniFile["2#Individual fix"]["HUD"].as<bool>();
|
||||
camera_fix_enabled = pluginIniFile["2#Individual fix"]["Camera"].as<bool>();
|
||||
DOF_fix_enabled = pluginIniFile["2#Individual fix"]["DOF"].as<bool>();
|
||||
Vignetting_fix_enabled = pluginIniFile["2#Individual fix"]["Vignetting"].as<bool>();
|
||||
@@ -177,6 +185,7 @@ static void LoadSettings() {
|
||||
Stamina_fix_enabled = pluginIniFile["2#Individual fix"]["Stamina"].as<bool>();
|
||||
StealthMode_fix_enabled = pluginIniFile["2#Individual fix"]["Stealth"].as<bool>();
|
||||
worldFOVvalue = pluginIniFile["3#Fixes tuning"]["World FOV"].as<int>();
|
||||
HUDvalue = pluginIniFile["3#Fixes tuning"]["HUD scaling"].as<int>();
|
||||
cameraDistancevalue = pluginIniFile["3#Fixes tuning"]["Camera distance"].as<int>();
|
||||
worldTimeDilationValue = pluginIniFile["3#Fixes tuning"]["World time dilation scale"].as<float>();
|
||||
AITimeDilationValue = pluginIniFile["3#Fixes tuning"]["AI time dilation scale"].as<float>();
|
||||
@@ -270,6 +279,7 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) {
|
||||
DrawSlider2(sliders[0], 200);
|
||||
ImGui::TableSetColumnIndex(1);
|
||||
DrawSlider2(sliders[1], 200);
|
||||
DrawSlider2(sliders[2], 200);
|
||||
ImGui::EndTable();
|
||||
}
|
||||
ImGui::PopStyleVar();
|
||||
@@ -286,9 +296,9 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) {
|
||||
ImGui::TableNextRow();
|
||||
|
||||
ImGui::TableSetColumnIndex(0);
|
||||
DrawSlider2(sliders[2], 220);
|
||||
ImGui::TableSetColumnIndex(1);
|
||||
DrawSlider2(sliders[3], 220);
|
||||
ImGui::TableSetColumnIndex(1);
|
||||
DrawSlider2(sliders[4], 220);
|
||||
ImGui::EndTable();
|
||||
}
|
||||
ImGui::PopStyleVar();
|
||||
|
||||
Reference in New Issue
Block a user