misc: Overhaul DirtyHacks saving to support storing a value alongside an off/off flag.

This commit is contained in:
Evan Husted 2024-12-29 21:17:01 -06:00
parent f5ce539de9
commit f362bef43d
13 changed files with 190 additions and 27 deletions

View file

@ -66,6 +66,8 @@ namespace Ryujinx.Ava.UI.ViewModels
private string _ldnServer;
private bool _xc2MenuSoftlockFix = ConfigurationState.Instance.Hacks.Xc2MenuSoftlockFix;
private bool _shaderTranslationThreadSleep = ConfigurationState.Instance.Hacks.EnableShaderCompilationThreadSleep;
private int _shaderTranslationSleepDelay = ConfigurationState.Instance.Hacks.ShaderCompilationThreadSleepDelay;
public int ResolutionScale
{
@ -287,6 +289,28 @@ namespace Ryujinx.Ava.UI.ViewModels
OnPropertyChanged();
}
}
public bool ShaderTranslationDelayEnabled
{
get => _shaderTranslationThreadSleep;
set
{
_shaderTranslationThreadSleep = value;
OnPropertyChanged();
}
}
public int ShaderTranslationDelay
{
get => _shaderTranslationSleepDelay;
set
{
_shaderTranslationSleepDelay = value;
OnPropertyChanged();
}
}
public int Language { get; set; }
public int Region { get; set; }
@ -763,6 +787,8 @@ namespace Ryujinx.Ava.UI.ViewModels
// Dirty Hacks
config.Hacks.Xc2MenuSoftlockFix.Value = Xc2MenuSoftlockFixEnabled;
config.Hacks.EnableShaderCompilationThreadSleep.Value = ShaderTranslationDelayEnabled;
config.Hacks.ShaderCompilationThreadSleepDelay.Value = ShaderTranslationDelay;
config.ToFileFormat().SaveConfig(Program.ConfigurationPath);
@ -809,5 +835,11 @@ namespace Ryujinx.Ava.UI.ViewModels
"there is a low chance that the game will softlock, " +
"the submenu won't show up, while background music is still there.");
});
public static string ShaderTranslationDelayTooltip { get; } = Lambda.String(sb =>
{
sb.Append(
"This hack applies the delay you specify every time shaders are attempted to be translated.");
});
}
}