Update Program.cs
This commit is contained in:
parent
447f6be16f
commit
02af61fc09
@ -158,25 +158,20 @@ namespace Ryujinx.Ava
|
||||
public static void ReloadConfig()
|
||||
{
|
||||
|
||||
string OverrideConfigurationPath = "";
|
||||
string localConfigurationPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ReleaseInformation.ConfigName);
|
||||
string appDataConfigurationPath = Path.Combine(AppDataManager.BaseDirPath, ReleaseInformation.ConfigName);
|
||||
|
||||
string overrideLocalConfigurationPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ReleaseInformation.CustomConfigNameOverride);
|
||||
string overrideAppDataConfigurationPath = Path.Combine(AppDataManager.BaseDirPath, ReleaseInformation.CustomConfigNameOverride);
|
||||
|
||||
Logger.Notice.Print(LogClass.Application, $"Loading configuration (overrideAppDataConfigurationPath)from: {overrideAppDataConfigurationPath}");
|
||||
|
||||
// Now load the configuration as the other subsystems are now registered
|
||||
if (File.Exists(localConfigurationPath))
|
||||
{
|
||||
ConfigurationPath = localConfigurationPath;
|
||||
OverrideConfigurationPath = localConfigurationPath;
|
||||
}
|
||||
else if (File.Exists(appDataConfigurationPath))
|
||||
{
|
||||
ConfigurationPath = appDataConfigurationPath;
|
||||
OverrideConfigurationPath = overrideAppDataConfigurationPath;
|
||||
}
|
||||
|
||||
if (ConfigurationPath == null)
|
||||
@ -187,7 +182,7 @@ namespace Ryujinx.Ava
|
||||
|
||||
ConfigurationState.Instance.LoadDefault();
|
||||
ConfigurationState.Instance.ToFileFormat().SaveConfig(ConfigurationPath);
|
||||
ConfigurationState.Instance.ToFileFormat().SaveConfig(OverrideConfigurationPath);
|
||||
ConfigurationState.Instance.ToFileFormat().SaveConfig(overrideAppDataConfigurationPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -196,7 +191,7 @@ namespace Ryujinx.Ava
|
||||
if (ConfigurationFileFormat.TryLoad(ConfigurationPath, out ConfigurationFileFormat configurationFileFormat))
|
||||
{
|
||||
ConfigurationState.Instance.Load(configurationFileFormat, ConfigurationPath);
|
||||
ConfigurationState.Instance.ToFileFormat().SaveConfig(OverrideConfigurationPath);
|
||||
ConfigurationState.Instance.ToFileFormat().SaveConfig(overrideAppDataConfigurationPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -213,37 +208,15 @@ namespace Ryujinx.Ava
|
||||
if (File.Exists(overrideLocalConfigurationPath))
|
||||
{
|
||||
ConfigurationPath = overrideLocalConfigurationPath;
|
||||
Logger.Notice.Print(LogClass.Application, $"(args)Loading configuration (Local) from: {ConfigurationPath}");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Notice.Print(LogClass.Application, $"File not found(Local): {overrideLocalConfigurationPath}");
|
||||
}
|
||||
|
||||
if (File.Exists(overrideAppDataConfigurationPath))
|
||||
{
|
||||
ConfigurationPath = overrideAppDataConfigurationPath;
|
||||
Logger.Notice.Print(LogClass.Application, $"(args)Loading configuration(AppData) from: {ConfigurationPath}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Notice.Print(LogClass.Application, $"File not found(AppData): {overrideAppDataConfigurationPath}");
|
||||
}
|
||||
}
|
||||
|
||||
UseHardwareAcceleration = ConfigurationState.Instance.EnableHardwareAcceleration;
|
||||
|
||||
// Check if graphics backend was overridden
|
||||
if (CommandLineState.OverrideGraphicsBackend is not null)
|
||||
ConfigurationState.Instance.Graphics.GraphicsBackend.Value = CommandLineState.OverrideGraphicsBackend.ToLower() switch
|
||||
{
|
||||
"opengl" => GraphicsBackend.OpenGl,
|
||||
"vulkan" => GraphicsBackend.Vulkan,
|
||||
"metal" => GraphicsBackend.Metal,
|
||||
_ => ConfigurationState.Instance.Graphics.GraphicsBackend
|
||||
};
|
||||
|
||||
// Check if backend threading was overridden
|
||||
if (CommandLineState.OverrideBackendThreading is not null)
|
||||
ConfigurationState.Instance.Graphics.BackendThreading.Value = CommandLineState.OverrideBackendThreading.ToLower() switch
|
||||
|
Loading…
x
Reference in New Issue
Block a user