阶段性完成
This commit is contained in:
@@ -8,32 +8,34 @@ namespace Ichni.Menu
|
||||
{
|
||||
public class GraphicsSettingsWindow : SettingsWindow
|
||||
{
|
||||
private static readonly List<string> QualityPresetOptions = new List<string>
|
||||
private const string UiTable = "UI";
|
||||
|
||||
private static readonly string[] QualityPresetKeys =
|
||||
{
|
||||
"Performant",
|
||||
"Balanced",
|
||||
"High Fidelity"
|
||||
"ui_settings_quality_performance",
|
||||
"ui_settings_quality_balanced",
|
||||
"ui_settings_quality_high_fidelity"
|
||||
};
|
||||
|
||||
private static readonly List<string> DisplayModeOptions = new List<string>
|
||||
private static readonly string[] BloomQualityKeys =
|
||||
{
|
||||
"Fullscreen",
|
||||
"Borderless Fullscreen",
|
||||
"Windowed"
|
||||
"ui_settings_bloom_off",
|
||||
"ui_settings_bloom_performance",
|
||||
"ui_settings_bloom_standard"
|
||||
};
|
||||
|
||||
private static readonly List<string> BloomQualityOptions = new List<string>
|
||||
private static readonly string[] VfxQualityKeys =
|
||||
{
|
||||
"Off",
|
||||
"Performance",
|
||||
"Standard"
|
||||
"ui_settings_vfx_low",
|
||||
"ui_settings_vfx_medium",
|
||||
"ui_settings_vfx_high"
|
||||
};
|
||||
|
||||
private static readonly List<string> VfxQualityOptions = new List<string>
|
||||
private static readonly string[] DisplayModeKeys =
|
||||
{
|
||||
"Low",
|
||||
"Medium",
|
||||
"High"
|
||||
"ui_settings_display_fullscreen",
|
||||
"ui_settings_display_borderless_fullscreen",
|
||||
"ui_settings_display_windowed"
|
||||
};
|
||||
|
||||
private readonly List<Vector2Int> _availableDisplayResolutions = new List<Vector2Int>();
|
||||
@@ -52,15 +54,14 @@ namespace Ichni.Menu
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
qualityPresetDropdown.SetUp((int)gameSettings.graphicsQualityPreset, QualityPresetOptions,
|
||||
"Menu UI/Settings_Quality_Preset");
|
||||
qualityPresetDropdown.SetUpLocalized((int)gameSettings.graphicsQualityPreset, UiTable, QualityPresetKeys);
|
||||
qualityPresetDropdown.updateValueAction = () =>
|
||||
{
|
||||
gameSettings.graphicsQualityPreset = (GraphicsQualityPreset)qualityPresetDropdown.selectedIndex;
|
||||
SettingsManager.instance.ApplyGraphicSettings();
|
||||
};
|
||||
|
||||
renderScaleModifier.SetUp(gameSettings.renderScaleLevel, 1, "Menu UI/Settings_Render_Scale");
|
||||
renderScaleModifier.SetUp(gameSettings.renderScaleLevel, 1);
|
||||
renderScaleModifier.SetMinMax(0, 5);
|
||||
renderScaleModifier.updateValueAction = () =>
|
||||
{
|
||||
@@ -68,7 +69,7 @@ namespace Ichni.Menu
|
||||
SettingsManager.instance.ApplyGraphicSettings();
|
||||
};
|
||||
|
||||
targetFrameModifier.SetUp(gameSettings.targetFrame, 30, "Menu UI/Settings_Target_Frame");
|
||||
targetFrameModifier.SetUp(gameSettings.targetFrame, 30);
|
||||
targetFrameModifier.SetMinMax(30, 120);
|
||||
targetFrameModifier.updateValueAction = () =>
|
||||
{
|
||||
@@ -119,21 +120,21 @@ namespace Ichni.Menu
|
||||
return;
|
||||
}
|
||||
|
||||
postProcessingSwitch.SetUp(gameSettings.enablePostProcessing, preservePrefabTitle: true);
|
||||
postProcessingSwitch.SetUp(gameSettings.enablePostProcessing);
|
||||
postProcessingSwitch.updateValueAction = () =>
|
||||
{
|
||||
gameSettings.enablePostProcessing = postProcessingSwitch.GetValue();
|
||||
SettingsManager.instance.ApplyPostProcessingSettings();
|
||||
};
|
||||
|
||||
bloomQualityDropdown.SetUp((int)gameSettings.bloomQuality, BloomQualityOptions, preservePrefabTitle: true);
|
||||
bloomQualityDropdown.SetUpLocalized((int)gameSettings.bloomQuality, UiTable, BloomQualityKeys);
|
||||
bloomQualityDropdown.updateValueAction = () =>
|
||||
{
|
||||
gameSettings.bloomQuality = (BloomQuality)bloomQualityDropdown.selectedIndex;
|
||||
SettingsManager.instance.ApplyPostProcessingSettings();
|
||||
};
|
||||
|
||||
vfxQualityDropdown.SetUp((int)gameSettings.vfxQuality, VfxQualityOptions, preservePrefabTitle: true);
|
||||
vfxQualityDropdown.SetUpLocalized((int)gameSettings.vfxQuality, UiTable, VfxQualityKeys);
|
||||
vfxQualityDropdown.updateValueAction = () =>
|
||||
{
|
||||
gameSettings.vfxQuality = (VfxQuality)vfxQualityDropdown.selectedIndex;
|
||||
@@ -145,23 +146,21 @@ namespace Ichni.Menu
|
||||
{
|
||||
BuildDisplayResolutionOptions();
|
||||
|
||||
vSyncSwitch.SetUp(gameSettings.vSyncEnabled, "Menu UI/Settings_VSync");
|
||||
vSyncSwitch.SetUp(gameSettings.vSyncEnabled);
|
||||
vSyncSwitch.updateValueAction = () =>
|
||||
{
|
||||
gameSettings.vSyncEnabled = vSyncSwitch.GetValue();
|
||||
SettingsManager.instance.ApplyDisplaySettings();
|
||||
};
|
||||
|
||||
displayModeDropdown.SetUp((int)gameSettings.displayMode, DisplayModeOptions,
|
||||
"Menu UI/Settings_Display_Mode");
|
||||
displayModeDropdown.SetUpLocalized((int)gameSettings.displayMode, UiTable, DisplayModeKeys);
|
||||
displayModeDropdown.updateValueAction = () =>
|
||||
{
|
||||
gameSettings.displayMode = (GraphicsDisplayMode)displayModeDropdown.selectedIndex;
|
||||
SettingsManager.instance.ApplyDisplaySettings();
|
||||
};
|
||||
|
||||
displayResolutionDropdown.SetUp(GetDisplayResolutionIndex(), _displayResolutionOptions,
|
||||
"Menu UI/Settings_Display_Resolution");
|
||||
displayResolutionDropdown.SetUpRuntime(GetDisplayResolutionIndex(), _displayResolutionOptions);
|
||||
displayResolutionDropdown.updateValueAction = () =>
|
||||
{
|
||||
Vector2Int resolution = _availableDisplayResolutions[displayResolutionDropdown.selectedIndex];
|
||||
|
||||
Reference in New Issue
Block a user