2025-08-14 09:50:12 +02:00
# define IMGUI_DISABLE_INCLUDE_IMCONFIG_H
# define IMGUI_HAS_DOCK 1
# include <imgui.h>
# include <reshade.hpp>
# include <fstream>
# include <string>
# include <Windows.h>
2025-09-14 22:40:25 +02:00
// Screen informations
static int screenWidth = GetSystemMetrics ( SM_CXSCREEN ) ;
static int screenHeight = GetSystemMetrics ( SM_CYSCREEN ) ;
static float aspectRatio = ( float ) screenWidth / screenHeight ;
2025-08-14 09:50:12 +02:00
// Core game dll functions declarations
typedef void ( * SetBoolFn ) ( bool , bool ) ;
typedef void ( * SetIntFn ) ( int ) ;
2025-09-15 11:46:17 +02:00
typedef void ( * SetFloatFn ) ( float ) ;
2025-08-14 09:50:12 +02:00
typedef float ( * GetFloatFn ) ( ) ;
2025-09-14 22:40:25 +02:00
typedef bool ( * GetBoolFn ) ( ) ;
2025-08-14 09:50:12 +02:00
static HMODULE fixLib = nullptr ;
2025-09-17 11:23:29 +02:00
static LONG g_coreInitialized = 0 ;
2025-08-14 09:50:12 +02:00
static SetBoolFn SetFixEnabled = nullptr ;
static SetBoolFn SetFOVFixEnabled = nullptr ;
static SetBoolFn SetAspectRatioFixEnabled = nullptr ;
static SetBoolFn SetDOFFixEnabled = nullptr ;
static SetBoolFn SetCAFixEnabled = nullptr ;
static SetBoolFn SetVignettingFixEnabled = nullptr ;
static SetBoolFn SetFogFixEnabled = nullptr ;
2025-09-16 11:55:45 +02:00
static SetBoolFn SetCameraFixEnabled = nullptr ;
2025-09-19 19:28:15 +02:00
static SetBoolFn SetHUDFixEnabled = nullptr ;
2025-08-14 09:50:12 +02:00
static SetIntFn SetFOV = nullptr ;
2025-09-15 11:46:17 +02:00
static SetFloatFn SetCameraDistance = nullptr ;
2025-09-16 11:55:45 +02:00
static SetIntFn SetCameraHeight = nullptr ;
2025-09-19 19:28:15 +02:00
static SetIntFn SetHUD = nullptr ;
2025-09-15 11:46:17 +02:00
2025-08-14 09:50:12 +02:00
static GetFloatFn GetFOVIn = nullptr ;
2025-08-14 23:07:19 +02:00
static GetFloatFn GetCompensadedFOV = nullptr ;
2025-08-14 09:50:12 +02:00
static GetFloatFn GetFOVOut = nullptr ;
2025-09-14 22:40:25 +02:00
static GetBoolFn GetConsoleEnabled = nullptr ;
2025-08-14 09:50:12 +02:00
// Plugin variables for checkboxes and sliders
static bool fov_fix_enabled = false ;
static bool Aspect_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 ;
2025-09-16 11:55:45 +02:00
static bool camera_fix_enabled = false ;
2025-09-19 19:28:15 +02:00
static bool HUD_fix_enabled = false ;
2025-08-14 09:50:12 +02:00
static bool fix_enabled = false ;
static int worldFOVvalue = 0 ;
2025-09-15 11:46:17 +02:00
static float cameraDistancevalue = 1.f ;
2025-09-16 11:55:45 +02:00
static int cameraHeightvalue = - 15 ;
2025-09-19 19:28:15 +02:00
static int HUDvalue = 0 ;
2025-08-14 09:50:12 +02:00
static bool popup_Informations = false ;
// Plugin settings
const char * SETTINGS_FILE = " PluginSettings.ini " ;
const char * GENERAL_FIX_SETTING = " GeneralFIX= " ;
const char * WORLD_FOV_FIX_SETTING = " WorldFOVFIX= " ;
const char * ASPECT_FIX_SETTING = " AspectFIX= " ;
2025-09-16 11:55:45 +02:00
const char * CAMERA_FIX_SETTING = " CameraFIX= " ;
2025-09-19 19:28:15 +02:00
const char * HUD_FIX_SETTING = " HUDFIX= " ;
2025-08-14 09:50:12 +02:00
const char * DOF_FIX_SETTING = " DOFFIX= " ;
const char * CA_FIX_SETTING = " CAFIX= " ;
const char * VIGNETTING_FIX_SETTING = " VignettingFIX= " ;
const char * FOG_FIX_SETTING = " FogFIX= " ;
const char * WORLD_FOV_SETTING = " WorldFOV= " ;
2025-09-15 11:46:17 +02:00
const char * CAMERA_DISTANCE_SETTING = " CameraDistance= " ;
2025-09-16 11:55:45 +02:00
const char * CAMERA_HEIGHT_SETTING = " CameraHeight= " ;
2025-09-19 19:28:15 +02:00
const char * HUD_SETTING = " HUDValue= " ;
const char * FIX_VERSION = " 1.0.5 " ;
const char * FIX_INFORMATIONS = " This fix allows to: \n - Control FOV in game. \n - Disable pillar boxing in cutscences. \n - Control camera. \n - Control HUD safezone. \n - Disable depth of field. \n - Disable chromatic aberrations. \n - Disable vignetting. \n - Disable FOG. \n - Re enable console. \n \n Disabling pillar boxing will compensate FOV \n for main menu and cutscenes. \n Disabling Fog will not entirely remove it. " ;
2025-08-14 09:50:12 +02:00
const char * DONATION_URL = " https://buymeacoffee.com/k4sh44 " ;
2025-09-14 22:40:25 +02:00
// Scaling factor based on screen resolution
float scale = 1.f ;
2025-08-14 09:50:12 +02:00
// Load and unload game core dll functions /!\ necessary
static void LoadFixDLL ( )
{
2025-09-17 11:23:29 +02:00
if ( InterlockedCompareExchange ( & g_coreInitialized , 1 , 0 ) ! = 0 )
return ;
2025-08-14 09:50:12 +02:00
2025-09-14 22:40:25 +02:00
if ( GetModuleHandleA ( " HellIsUsCore.dll " ) = = nullptr ) {
fixLib = LoadLibraryA ( " HellIsUsCore.dll " ) ;
2025-08-14 09:50:12 +02:00
2025-09-14 22:40:25 +02:00
if ( ! fixLib ) {
MessageBoxA ( nullptr , " Impossible to load game core dll " , " Erreur " , MB_OK ) ;
return ;
}
2025-08-14 09:50:12 +02:00
2025-09-14 22:40:25 +02:00
SetFixEnabled = ( SetBoolFn ) GetProcAddress ( fixLib , " SetFixEnabled " ) ;
SetFOVFixEnabled = ( SetBoolFn ) GetProcAddress ( fixLib , " SetFOVFixEnabled " ) ;
SetAspectRatioFixEnabled = ( SetBoolFn ) GetProcAddress ( fixLib , " SetAspectRatioFixEnabled " ) ;
SetDOFFixEnabled = ( SetBoolFn ) GetProcAddress ( fixLib , " SetDOFFixEnabled " ) ;
SetCAFixEnabled = ( SetBoolFn ) GetProcAddress ( fixLib , " SetCAFixEnabled " ) ;
SetVignettingFixEnabled = ( SetBoolFn ) GetProcAddress ( fixLib , " SetVignettingFixEnabled " ) ;
SetFogFixEnabled = ( SetBoolFn ) GetProcAddress ( fixLib , " SetFogFixEnabled " ) ;
2025-09-16 11:55:45 +02:00
SetCameraFixEnabled = ( SetBoolFn ) GetProcAddress ( fixLib , " SetCameraFixEnabled " ) ;
2025-09-19 19:28:15 +02:00
SetHUDFixEnabled = ( SetBoolFn ) GetProcAddress ( fixLib , " SetHUDFixEnabled " ) ;
2025-09-14 22:40:25 +02:00
SetFOV = ( SetIntFn ) GetProcAddress ( fixLib , " SetFOV " ) ;
2025-09-15 11:46:17 +02:00
SetCameraDistance = ( SetFloatFn ) GetProcAddress ( fixLib , " SetCameraDistance " ) ;
2025-09-16 11:55:45 +02:00
SetCameraHeight = ( SetIntFn ) GetProcAddress ( fixLib , " SetCameraHeight " ) ;
2025-09-19 19:28:15 +02:00
SetHUD = ( SetIntFn ) GetProcAddress ( fixLib , " SetHUD " ) ;
2025-09-14 22:40:25 +02:00
GetFOVIn = ( GetFloatFn ) GetProcAddress ( fixLib , " GetFOVIn " ) ;
GetCompensadedFOV = ( GetFloatFn ) GetProcAddress ( fixLib , " GetCompensatedFOV " ) ;
GetFOVOut = ( GetFloatFn ) GetProcAddress ( fixLib , " GetFOVOut " ) ; ;
GetConsoleEnabled = ( GetBoolFn ) GetProcAddress ( fixLib , " GetConsoleEnabled " ) ;
// Apply initial values loaded from settings
if ( SetFOV ) SetFOV ( worldFOVvalue ) ;
2025-09-15 15:11:43 +02:00
if ( SetCameraDistance ) SetCameraDistance ( cameraDistancevalue ) ;
2025-09-16 11:55:45 +02:00
if ( SetCameraHeight ) SetCameraHeight ( cameraHeightvalue ) ;
2025-09-19 19:28:15 +02:00
if ( SetHUD ) SetHUD ( HUDvalue ) ;
2025-09-14 22:40:25 +02:00
if ( SetFOVFixEnabled ) SetFOVFixEnabled ( fov_fix_enabled , true ) ;
2025-09-16 11:55:45 +02:00
if ( SetCameraFixEnabled ) SetCameraFixEnabled ( camera_fix_enabled , true ) ;
2025-09-19 19:28:15 +02:00
if ( SetHUDFixEnabled ) SetHUDFixEnabled ( HUD_fix_enabled , true ) ;
2025-09-14 22:40:25 +02:00
if ( SetAspectRatioFixEnabled ) SetAspectRatioFixEnabled ( Aspect_fix_enabled , true ) ;
if ( SetDOFFixEnabled ) SetDOFFixEnabled ( DOF_fix_enabled , true ) ;
if ( SetCAFixEnabled ) SetCAFixEnabled ( CA_fix_enabled , true ) ;
if ( SetVignettingFixEnabled ) SetVignettingFixEnabled ( Vignetting_fix_enabled , true ) ;
if ( SetFogFixEnabled ) SetFogFixEnabled ( Fog_fix_enabled , true ) ;
if ( SetFixEnabled ) SetFixEnabled ( fix_enabled , true ) ;
}
2025-08-14 09:50:12 +02:00
}
// Settings functions
static void SaveSettings ( )
{
std : : ofstream file ( SETTINGS_FILE ) ;
if ( file . is_open ( ) )
{
file < < GENERAL_FIX_SETTING < < ( fix_enabled ? " 1 " : " 0 " ) < < " \n " ;
file < < WORLD_FOV_FIX_SETTING < < ( fov_fix_enabled ? " 1 " : " 0 " ) < < " \n " ;
file < < ASPECT_FIX_SETTING < < ( Aspect_fix_enabled ? " 1 " : " 0 " ) < < " \n " ;
2025-09-16 11:55:45 +02:00
file < < CAMERA_FIX_SETTING < < ( camera_fix_enabled ? " 1 " : " 0 " ) < < " \n " ;
2025-09-19 19:28:15 +02:00
file < < HUD_FIX_SETTING < < ( HUD_fix_enabled ? " 1 " : " 0 " ) < < " \n " ;
2025-08-14 09:50:12 +02:00
file < < DOF_FIX_SETTING < < ( DOF_fix_enabled ? " 1 " : " 0 " ) < < " \n " ;
file < < CA_FIX_SETTING < < ( CA_fix_enabled ? " 1 " : " 0 " ) < < " \n " ;
file < < VIGNETTING_FIX_SETTING < < ( Vignetting_fix_enabled ? " 1 " : " 0 " ) < < " \n " ;
file < < FOG_FIX_SETTING < < ( Fog_fix_enabled ? " 1 " : " 0 " ) < < " \n " ;
file < < WORLD_FOV_SETTING < < worldFOVvalue < < " \n " ;
2025-09-15 11:46:17 +02:00
file < < CAMERA_DISTANCE_SETTING < < cameraDistancevalue < < " \n " ;
2025-09-16 11:55:45 +02:00
file < < CAMERA_HEIGHT_SETTING < < cameraHeightvalue < < " \n " ;
2025-09-19 19:28:15 +02:00
file < < HUD_SETTING < < HUDvalue < < " \n " ;
2025-08-14 09:50:12 +02:00
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 ( WORLD_FOV_FIX_SETTING ) = = 0 )
{
std : : string val = line . substr ( strlen ( WORLD_FOV_FIX_SETTING ) ) ;
fov_fix_enabled = ( val = = " 1 " | | val = = " true " ) ;
}
2025-09-16 11:55:45 +02:00
else if ( line . find ( CAMERA_FIX_SETTING ) = = 0 )
2025-09-15 11:46:17 +02:00
{
2025-09-16 11:55:45 +02:00
std : : string val = line . substr ( strlen ( CAMERA_FIX_SETTING ) ) ;
camera_fix_enabled = ( val = = " 1 " | | val = = " true " ) ;
2025-09-15 11:46:17 +02:00
}
2025-09-19 19:28:15 +02:00
else if ( line . find ( HUD_FIX_SETTING ) = = 0 )
{
std : : string val = line . substr ( strlen ( HUD_FIX_SETTING ) ) ;
HUD_fix_enabled = ( val = = " 1 " | | val = = " true " ) ;
}
2025-08-14 09:50:12 +02:00
else if ( line . find ( ASPECT_FIX_SETTING ) = = 0 )
{
std : : string val = line . substr ( strlen ( ASPECT_FIX_SETTING ) ) ;
Aspect_fix_enabled = ( val = = " 1 " | | val = = " true " ) ;
}
else if ( line . find ( DOF_FIX_SETTING ) = = 0 )
{
std : : string val = line . substr ( strlen ( DOF_FIX_SETTING ) ) ;
DOF_fix_enabled = ( val = = " 1 " | | val = = " true " ) ;
}
else if ( line . find ( CA_FIX_SETTING ) = = 0 )
{
std : : string val = line . substr ( strlen ( CA_FIX_SETTING ) ) ;
CA_fix_enabled = ( val = = " 1 " | | val = = " true " ) ;
}
else if ( line . find ( VIGNETTING_FIX_SETTING ) = = 0 )
{
std : : string val = line . substr ( strlen ( VIGNETTING_FIX_SETTING ) ) ;
Vignetting_fix_enabled = ( val = = " 1 " | | val = = " true " ) ;
}
else if ( line . find ( FOG_FIX_SETTING ) = = 0 )
{
std : : string val = line . substr ( strlen ( FOG_FIX_SETTING ) ) ;
Fog_fix_enabled = ( val = = " 1 " | | val = = " true " ) ;
}
else if ( line . find ( WORLD_FOV_SETTING ) = = 0 )
worldFOVvalue = std : : stoi ( line . substr ( strlen ( WORLD_FOV_SETTING ) ) ) ;
2025-09-15 11:46:17 +02:00
else if ( line . find ( CAMERA_DISTANCE_SETTING ) = = 0 )
2025-09-15 15:11:43 +02:00
cameraDistancevalue = std : : stof ( line . substr ( strlen ( CAMERA_DISTANCE_SETTING ) ) ) ;
2025-09-16 11:55:45 +02:00
else if ( line . find ( CAMERA_HEIGHT_SETTING ) = = 0 )
cameraHeightvalue = std : : stoi ( line . substr ( strlen ( CAMERA_HEIGHT_SETTING ) ) ) ;
2025-09-19 19:28:15 +02:00
else if ( line . find ( HUD_SETTING ) = = 0 )
HUDvalue = std : : stoi ( line . substr ( strlen ( HUD_SETTING ) ) ) ;
2025-08-14 09:50:12 +02:00
}
file . close ( ) ;
}
}
// Initialize ImGui widgets for Reshade
static void on_overlay_draw ( reshade : : api : : effect_runtime * runtime )
{
2025-09-14 22:40:25 +02:00
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
2025-08-14 09:50:12 +02:00
2025-09-14 22:40:25 +02:00
ImGui : : SetNextWindowSize ( ImVec2 ( 350 * scale , 150 * scale ) , ImGuiCond_Once ) ;
if ( ImGui : : Button ( " Like my work ? Consider donation " ) ) ShellExecuteA ( NULL , " open " , DONATION_URL , NULL , NULL , SW_SHOWNORMAL ) ; // Donation
ImGui : : SameLine ( ) ;
if ( ImGui : : Button ( " Fix informations " ) ) popup_Informations = true ; // Fix information
2025-08-14 09:50:12 +02:00
if ( popup_Informations )
2025-09-14 22:40:25 +02:00
{
ImGui : : Begin ( " Informations " , & popup_Informations ) ;
ImGui : : Text ( " Version : %s " , FIX_VERSION ) ;
ImGui : : Text ( FIX_INFORMATIONS ) ;
ImGui : : End ( ) ;
2025-08-14 09:50:12 +02:00
}
2025-08-14 22:59:55 +02:00
2025-09-14 22:40:25 +02:00
if ( ImGui : : BeginTable ( " FixesTable " , 2 , ImGuiTableFlags_SizingStretchSame ) ) {
ImGui : : TableSetupColumn ( " LeftFix " , ImGuiTableColumnFlags_WidthStretch , 0.4f ) ;
ImGui : : TableSetupColumn ( " RightFix " , ImGuiTableColumnFlags_WidthStretch , 0.6f ) ;
ImGui : : TableNextRow ( ) ;
// Drawing a left column with slider and general fix
ImGui : : TableSetColumnIndex ( 0 ) ;
if ( ImGui : : CollapsingHeader ( " Enable fixes " , ImGuiTreeNodeFlags_DefaultOpen ) )
if ( ImGui : : Checkbox ( " Fix enabled " , & fix_enabled ) ) {
if ( SetFixEnabled ) SetFixEnabled ( fix_enabled , false ) ;
SaveSettings ( ) ;
}
2025-08-14 09:50:12 +02:00
2025-09-14 22:40:25 +02:00
// Sliders
if ( ImGui : : CollapsingHeader ( " In game additional FOV " , ImGuiTreeNodeFlags_DefaultOpen ) )
{
ImGui : : SetNextItemWidth ( 150 * scale ) ;
if ( ImGui : : SliderInt ( " ##FOVValue " , & worldFOVvalue , - 20 , 50 ) ) {
if ( SetFOV ) SetFOV ( worldFOVvalue ) ;
SaveSettings ( ) ;
}
2025-08-14 09:50:12 +02:00
}
2025-09-15 11:46:17 +02:00
if ( ImGui : : CollapsingHeader ( " Camera distance (*) " , ImGuiTreeNodeFlags_DefaultOpen ) )
{
ImGui : : SetNextItemWidth ( 150 * scale ) ;
2025-09-16 11:55:45 +02:00
if ( ImGui : : SliderFloat ( " ##CameraDistanceValue " , & cameraDistancevalue , 0 , 3 ) ) {
2025-09-15 11:46:17 +02:00
if ( SetCameraDistance ) SetCameraDistance ( cameraDistancevalue ) ; SaveSettings ( ) ;
}
}
if ( ImGui : : IsItemHovered ( ) ) {
ImGui : : BeginTooltip ( ) ;
ImGui : : Text ( " Value is a multiplier. " ) ;
2025-09-16 11:55:45 +02:00
ImGui : : EndTooltip ( ) ;
}
if ( ImGui : : CollapsingHeader ( " Camera height (*) " , ImGuiTreeNodeFlags_DefaultOpen ) )
{
ImGui : : SetNextItemWidth ( 150 * scale ) ;
if ( ImGui : : SliderInt ( " ##CameraHeightValue " , & cameraHeightvalue , - 80 , 80 ) ) {
if ( SetCameraHeight ) SetCameraHeight ( cameraHeightvalue ) ; SaveSettings ( ) ;
}
}
if ( ImGui : : IsItemHovered ( ) ) {
ImGui : : BeginTooltip ( ) ;
ImGui : : Text ( " Default value is -15. " ) ;
2025-09-15 11:46:17 +02:00
ImGui : : EndTooltip ( ) ;
}
2025-09-14 22:40:25 +02:00
// 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.35f ) ;
ImGui : : TableSetupColumn ( " IndFix2 " , ImGuiTableColumnFlags_WidthStretch , 0.65f ) ;
ImGui : : TableNextRow ( ) ;
ImGui : : TableSetColumnIndex ( 0 ) ;
if ( ImGui : : Checkbox ( " FOV " , & fov_fix_enabled ) ) {
if ( SetFOVFixEnabled ) SetFOVFixEnabled ( fov_fix_enabled , false ) ;
SaveSettings ( ) ;
}
if ( ImGui : : IsItemHovered ( ) ) {
ImGui : : BeginTooltip ( ) ;
ImGui : : Text ( " This won't affect PDA for readability " ) ;
ImGui : : EndTooltip ( ) ;
}
2025-09-16 11:55:45 +02:00
if ( ImGui : : Checkbox ( " Camera " , & camera_fix_enabled ) ) {
if ( SetCameraFixEnabled ) SetCameraFixEnabled ( camera_fix_enabled , false ) ;
SaveSettings ( ) ;
}
if ( ImGui : : IsItemHovered ( ) ) {
ImGui : : BeginTooltip ( ) ;
ImGui : : Text ( " Controls distance and height. " ) ;
ImGui : : EndTooltip ( ) ;
}
2025-09-14 22:40:25 +02:00
if ( ImGui : : Checkbox ( " Vignetting " , & Vignetting_fix_enabled ) ) {
if ( SetVignettingFixEnabled ) SetVignettingFixEnabled ( Vignetting_fix_enabled , false ) ;
SaveSettings ( ) ;
}
if ( ImGui : : Checkbox ( " Fog " , & Fog_fix_enabled ) ) {
if ( SetFogFixEnabled ) SetFogFixEnabled ( Fog_fix_enabled , false ) ;
SaveSettings ( ) ;
}
if ( ImGui : : IsItemHovered ( ) ) {
ImGui : : BeginTooltip ( ) ;
ImGui : : Text ( " Enabling this fix is a one way. " ) ;
ImGui : : Text ( " Reverting it in real time would end in game crash. " ) ;
ImGui : : Text ( " So disabling this fix is only possible by doing it here and restart the game. " ) ;
ImGui : : EndTooltip ( ) ;
}
ImGui : : TableSetColumnIndex ( 1 ) ;
if ( ImGui : : Checkbox ( " Aspect ratio " , & Aspect_fix_enabled ) ) {
if ( SetAspectRatioFixEnabled ) SetAspectRatioFixEnabled ( Aspect_fix_enabled , false ) ;
SaveSettings ( ) ;
}
if ( ImGui : : IsItemHovered ( ) ) {
ImGui : : BeginTooltip ( ) ;
ImGui : : Text ( " Aspect ratio fix is only usefull for ultrawide displays. " ) ;
ImGui : : Text ( " No need to enable it if you play at 16/9. " ) ;
ImGui : : EndTooltip ( ) ;
}
2025-09-19 19:28:15 +02:00
if ( ImGui : : Checkbox ( " HUD safe zone " , & HUD_fix_enabled ) ) {
if ( SetHUDFixEnabled ) SetHUDFixEnabled ( HUD_fix_enabled , false ) ;
SaveSettings ( ) ;
}
if ( ImGui : : IsItemHovered ( ) ) {
ImGui : : BeginTooltip ( ) ;
ImGui : : Text ( " This fix is intended for ultrawide displays. " ) ;
ImGui : : Text ( " This is not a real time fix. " ) ;
ImGui : : Text ( " It will take effect after you load your savegame. " ) ;
ImGui : : EndTooltip ( ) ;
}
2025-09-14 22:40:25 +02:00
if ( ImGui : : Checkbox ( " Depth of field " , & DOF_fix_enabled ) ) {
if ( SetDOFFixEnabled ) SetDOFFixEnabled ( DOF_fix_enabled , false ) ;
SaveSettings ( ) ;
}
if ( ImGui : : Checkbox ( " Chromatic aberrations " , & CA_fix_enabled ) ) {
if ( SetCAFixEnabled ) SetCAFixEnabled ( CA_fix_enabled , false ) ;
SaveSettings ( ) ;
}
ImGui : : EndTable ( ) ;
}
2025-08-14 09:50:12 +02:00
}
2025-09-19 19:28:15 +02:00
if ( ImGui : : CollapsingHeader ( " HUD safe zone (*) " , ImGuiTreeNodeFlags_DefaultOpen ) )
{
ImGui : : SetNextItemWidth ( 150 * scale ) ;
if ( ImGui : : SliderInt ( " ##HUDValue " , & HUDvalue , 0 , 40 ) ) {
if ( SetHUD ) SetHUD ( HUDvalue ) ;
SaveSettings ( ) ;
}
}
if ( ImGui : : IsItemHovered ( ) ) {
ImGui : : BeginTooltip ( ) ;
ImGui : : Text ( " Percentage HUD bounds (let and right). " ) ;
ImGui : : EndTooltip ( ) ;
}
2025-09-14 22:40:25 +02:00
ImGui : : EndTable ( ) ;
2025-08-14 09:50:12 +02:00
}
// Fix status
if ( ImGui : : CollapsingHeader ( " Fix informations " , ImGuiTreeNodeFlags_DefaultOpen ) ) {
2025-09-14 22:40:25 +02:00
ImGui : : Text ( " Screen width: %d, height: %d, aspect ratio: %.2f " , screenWidth , screenHeight , aspectRatio ) ;
if ( GetConsoleEnabled & & GetConsoleEnabled ( ) )
ImGui : : Text ( " Console enabled and bound to key F2 " ) ;
if ( GetFOVIn & & GetCompensadedFOV & & GetFOVOut )
ImGui : : TextColored ( ImColor ( 48 , 179 , 25 ) , " FOV In: %.2f, Compensated: %.2f, Out: %.2f " , GetFOVIn ( ) , GetCompensadedFOV ( ) , GetFOVOut ( ) ) ;
2025-08-14 09:50:12 +02:00
}
}
// 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 ( " Hell Is Us " , & on_overlay_draw ) ;
reshade : : register_event < reshade : : addon_event : : init_effect_runtime > (
[ ] ( reshade : : api : : effect_runtime * runtime ) {
LoadFixDLL ( ) ;
} ) ;
break ;
case DLL_PROCESS_DETACH :
reshade : : unregister_addon ( hinstDLL ) ;
break ;
}
return TRUE ;
}