Skip to content

Commit

Permalink
Reformat the Advanced Options menu (#993)
Browse files Browse the repository at this point in the history
  • Loading branch information
Murugo authored Jul 31, 2024
1 parent d1fe34e commit f15be91
Show file tree
Hide file tree
Showing 24 changed files with 1,250 additions and 480 deletions.
46 changes: 21 additions & 25 deletions Common/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,25 @@ void UpdateConfigDefaults()
ReplaceButtonText = BUTTON_ICONS_GENERIC;
}

UpdateScaleResolution();
}

void LockConfigs()
{
// Blank function
}

bool ResolutionAvailableCheck(int width, int height)
{
UNREFERENCED_PARAMETER(width);
UNREFERENCED_PARAMETER(height);
// Blank function

return true;
}

void UpdateScaleResolution()
{
// Check if ScaleWindowedResolution exists in ini file
if (ScaleWindowedResolution == 0xFFFF)
{
Expand All @@ -429,23 +448,14 @@ void UpdateConfigDefaults()
ScaleFactor = 2.0f;
break;
case 2:
ScaleFactor = 1.75f;
break;
case 3:
ScaleFactor = 1.5f;
break;
case 4:
ScaleFactor = 1.25f;
break;
case 5:
case 3:
ScaleFactor = 0.75f;
break;
case 6:
case 4:
ScaleFactor = 0.5f;
break;
case 7:
ScaleFactor = 0.25f;
break;
}

// Disable features that don't work with scaled resolutions and might cause a perf issue
Expand All @@ -454,18 +464,4 @@ void UpdateConfigDefaults()
AntiAliasing = 0;
FixGPUAntiAliasing = false;
}
}

void LockConfigs()
{
// Blank function
}

bool ResolutionAvailableCheck(int width, int height)
{
UNREFERENCED_PARAMETER(width);
UNREFERENCED_PARAMETER(height);
// Blank function

return true;
}
4 changes: 3 additions & 1 deletion Common/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
visit(ClosetCutsceneFix, true) \
visit(CommandWindowMouseFix, true) \
visit(CreateLocalFix, true) \
visit(CustomAdvancedOptions, true) \
visit(d3d8to9, true) \
visit(DelayedFadeIn, true) \
visit(Direct3DCreate9On12, false) \
Expand Down Expand Up @@ -78,7 +79,6 @@
visit(GamepadControlsFix, true) \
visit(PuzzleAlignmentFixes, true) \
visit(HalogenLightFix, true) \
visit(HealthIndicatorOption, true) \
visit(HookDirect3D, true) \
visit(HookDirectInput, true) \
visit(HookDirectSound, true) \
Expand Down Expand Up @@ -343,6 +343,7 @@ struct CFGDATA
DWORD VolumeLevel = 15;
DWORD HealthIndicatorOption = 1;
DWORD DisplayModeOption = 0;
DWORD ScaleWindowedResolutionOption = 0;
};

extern HMODULE m_hModule;
Expand All @@ -369,3 +370,4 @@ void Parse(char* strParse, NV NameValueCallback, void* lpParam = nullptr);
void __stdcall ParseCallback(char* lpName, char* lpValue, void*);
void LogSettings();
void UpdateConfigDefaults();
void UpdateScaleResolution();
4 changes: 2 additions & 2 deletions Common/Settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ UnlockJapLang = 1
; Replaces the Options > Advanced Options > Low Res Texture option with a Display Mode option to change the screen mode used for the game.
DisplayModeOption = 1

; Replaces the Options > Game Options > Search View option with a Health Indicator option to enable/disable the low health visual used in-game.
HealthIndicatorOption = 1
; Adds Render Resolution and Health Indicator options to the Options > Advanced Options menu.
CustomAdvancedOptions = 1

[Menu Fixes]
; Fixes the mouse hitboxes for the game's main menu selections for the North American version 1.1 executable.
Expand Down
17 changes: 16 additions & 1 deletion Common/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ HRESULT GetConfigData()
}

// Update Health Indicator setting
if (HealthIndicatorOption)
if (CustomAdvancedOptions)
{
// If health indicator was retrieved from the config file then use it
if (BytesRead >= ((DWORD)&ConfigData.HealthIndicatorOption + sizeof(ConfigData.HealthIndicatorOption) - (DWORD)&ConfigData))
Expand All @@ -1427,6 +1427,21 @@ HRESULT GetConfigData()
}
}

// If scale resolution was retrieved from the config file then use it
if (CustomAdvancedOptions)
{
if (BytesRead >= ((DWORD)&ConfigData.ScaleWindowedResolutionOption + sizeof(ConfigData.ScaleWindowedResolutionOption) - (DWORD)&ConfigData))
{
ScaleWindowedResolution = ConfigData.ScaleWindowedResolutionOption;
UpdateScaleResolution();
}
// Otherwise use ScaleWindowedResolution value
else
{
ConfigData.ScaleWindowedResolutionOption = ScaleWindowedResolution;
}
}

return (BytesRead ? S_OK : E_FAIL);
}

Expand Down
17 changes: 7 additions & 10 deletions Launcher/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@
<Title>Dynamic Resolution Scaling</Title>
<Description>Works only in windowed and fullscreen windowed mode.</Description>
<Choices type="list">
<Value name="0.25">7</Value>
<Value name="0.5">6</Value>
<Value name="0.75">5</Value>
<Value name="0.5">4</Value>
<Value name="0.75">3</Value>
<Value name="1.0" default="true">0</Value>
<Value name="1.25">4</Value>
<Value name="1.5">3</Value>
<Value name="1.75">2</Value>
<Value name="1.5">2</Value>
<Value name="2.0">1</Value>
</Choices>
</Feature>
Expand Down Expand Up @@ -663,7 +660,7 @@
</Section>

<Section name="Menu Additions">

<Feature name="DisplayModeOption">
<Title>Display mode option</Title>
<Description>Replaces the Options > Advanced Options > Low Res Texture option with a Display Mode option to change the screen mode used for the game.</Description>
Expand All @@ -673,9 +670,9 @@
</Choices>
</Feature>

<Feature name="HealthIndicatorOption">
<Title>Health indicator option</Title>
<Description>Replaces the Options > Game Options > Search View option with a Health Indicator option to enable/disable the low health visual used in-game.</Description>
<Feature name="CustomAdvancedOptions">
<Title>Render resolution and health indicator options</Title>
<Description>Adds Render Resolution and Health Indicator options to the Options > Advanced Options menu.</Description>
<Choices type="check">
<Value name="Disable">0</Value>
<Value name="Enable" default="true">1</Value>
Expand Down
15 changes: 6 additions & 9 deletions Launcher/config_br.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@
<Title>Dynamic Resolution Scaling</Title>
<Description>Works only in windowed and fullscreen windowed mode.</Description>
<Choices type="list">
<Value name="0.25">7</Value>
<Value name="0.5">6</Value>
<Value name="0.75">5</Value>
<Value name="0.5">4</Value>
<Value name="0.75">3</Value>
<Value name="1.0" default="true">0</Value>
<Value name="1.25">4</Value>
<Value name="1.5">3</Value>
<Value name="1.75">2</Value>
<Value name="1.5">2</Value>
<Value name="2.0">1</Value>
</Choices>
</Feature>
Expand Down Expand Up @@ -673,9 +670,9 @@
</Choices>
</Feature>

<Feature name="HealthIndicatorOption">
<Title>Health indicator option</Title>
<Description>Replaces the Options > Game Options > Search View option with a Health Indicator option to enable/disable the low health visual used in-game.</Description>
<Feature name="CustomAdvancedOptions">
<Title>Render resolution and health indicator options</Title>
<Description>Adds Render Resolution and Health Indicator options to the Options > Advanced Options menu.</Description>
<Choices type="check">
<Value name="Disable">0</Value>
<Value name="Enable" default="true">1</Value>
Expand Down
24 changes: 15 additions & 9 deletions Launcher/config_es.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@
<Title>Dynamic Resolution Scaling</Title>
<Description>Works only in windowed and fullscreen windowed mode.</Description>
<Choices type="list">
<Value name="0.25">7</Value>
<Value name="0.5">6</Value>
<Value name="0.75">5</Value>
<Value name="0.5">4</Value>
<Value name="0.75">3</Value>
<Value name="1.0" default="true">0</Value>
<Value name="1.25">4</Value>
<Value name="1.5">3</Value>
<Value name="1.75">2</Value>
<Value name="1.5">2</Value>
<Value name="2.0">1</Value>
</Choices>
</Feature>
Expand Down Expand Up @@ -673,9 +670,9 @@
</Choices>
</Feature>

<Feature name="HealthIndicatorOption">
<Title>Health indicator option</Title>
<Description>Replaces the Options > Game Options > Search View option with a Health Indicator option to enable/disable the low health visual used in-game.</Description>
<Feature name="CustomAdvancedOptions">
<Title>Render resolution and health indicator options</Title>
<Description>Adds Render Resolution and Health Indicator options to the Options > Advanced Options menu.</Description>
<Choices type="check">
<Value name="Disable">0</Value>
<Value name="Enable" default="true">1</Value>
Expand Down Expand Up @@ -1096,6 +1093,15 @@
</Choices>
</Feature>

<Feature name="CustomAdvancedOptions">
<Title>Extend advanced options</Title>
<Description>Adds Display Mode, Render Resolution, and Health Indicator options to the Options > Advanced Options menu.</Description>
<Choices type="check">
<Value name="Disable">0</Value>
<Value name="Enable" default="true">1</Value>
</Choices>
</Feature>

</Section>

<Section name="Entornos">
Expand Down
19 changes: 8 additions & 11 deletions Launcher/config_it.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@
<Title>Dynamic Resolution Scaling</Title>
<Description>Works only in windowed and fullscreen windowed mode.</Description>
<Choices type="list">
<Value name="0.25">7</Value>
<Value name="0.5">6</Value>
<Value name="0.75">5</Value>
<Value name="0.5">4</Value>
<Value name="0.75">3</Value>
<Value name="1.0" default="true">0</Value>
<Value name="1.25">4</Value>
<Value name="1.5">3</Value>
<Value name="1.75">2</Value>
<Value name="1.5">2</Value>
<Value name="2.0">1</Value>
</Choices>
</Feature>
Expand Down Expand Up @@ -673,12 +670,12 @@
</Choices>
</Feature>

<Feature name="HealthIndicatorOption">
<Title>Opzione indicatore salute</Title>
<Description>Sostituisce Opzioni > Opzioni di gioco > Controllo visuale con Indicatore salute, per abilitare/disabilitare la grafica di salute bassa nel gioco.</Description>
<Feature name="CustomAdvancedOptions">
<Title>Render resolution and health indicator options</Title>
<Description>Adds Render Resolution and Health Indicator options to the Options > Advanced Options menu.</Description>
<Choices type="check">
<Value name="Disabilitato">0</Value>
<Value name="Abilitato" default="true">1</Value>
<Value name="Disable">0</Value>
<Value name="Enable" default="true">1</Value>
</Choices>
</Feature>

Expand Down
Loading

0 comments on commit f15be91

Please sign in to comment.