aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Common/Configuration/ConfigurationState.cs
diff options
context:
space:
mode:
authorThog <me@thog.eu>2020-03-25 23:23:21 +0100
committerGitHub <noreply@github.com>2020-03-26 09:23:21 +1100
commit0dd38028cbf54b672a41fcec0024740ff8ccea72 (patch)
treec383578796b157f399a4ef6eff8aa0b99df785cf /Ryujinx.Common/Configuration/ConfigurationState.cs
parent82c3df83c43b32510927b7fa710eeb099067ed2e (diff)
Make Device Location Name configuration (custom TZ) (#1031)
This permit to use arbitrary timezone (instead of UTC). Useful for games like ACNH.
Diffstat (limited to 'Ryujinx.Common/Configuration/ConfigurationState.cs')
-rw-r--r--Ryujinx.Common/Configuration/ConfigurationState.cs24
1 files changed, 21 insertions, 3 deletions
diff --git a/Ryujinx.Common/Configuration/ConfigurationState.cs b/Ryujinx.Common/Configuration/ConfigurationState.cs
index 0f7b4084..e563008a 100644
--- a/Ryujinx.Common/Configuration/ConfigurationState.cs
+++ b/Ryujinx.Common/Configuration/ConfigurationState.cs
@@ -154,6 +154,11 @@ namespace Ryujinx.Configuration
public ReactiveObject<Region> Region { get; private set; }
/// <summary>
+ /// Change System TimeZone
+ /// </summary>
+ public ReactiveObject<string> TimeZone { get; private set; }
+
+ /// <summary>
/// Enables or disables Docked Mode
/// </summary>
public ReactiveObject<bool> EnableDockedMode { get; private set; }
@@ -182,6 +187,7 @@ namespace Ryujinx.Configuration
{
Language = new ReactiveObject<Language>();
Region = new ReactiveObject<Region>();
+ TimeZone = new ReactiveObject<string>();
EnableDockedMode = new ReactiveObject<bool>();
EnableMulticoreScheduling = new ReactiveObject<bool>();
EnableFsIntegrityChecks = new ReactiveObject<bool>();
@@ -295,7 +301,7 @@ namespace Ryujinx.Configuration
{
ConfigurationFileFormat configurationFile = new ConfigurationFileFormat
{
- Version = 2,
+ Version = ConfigurationFileFormat.CurrentVersion,
GraphicsShadersDumpPath = Graphics.ShadersDumpPath,
LoggingEnableDebug = Logger.EnableDebug,
LoggingEnableStub = Logger.EnableStub,
@@ -308,6 +314,7 @@ namespace Ryujinx.Configuration
EnableFileLog = Logger.EnableFileLog,
SystemLanguage = System.Language,
SystemRegion = System.Region,
+ SystemTimeZone = System.TimeZone,
DockedMode = System.EnableDockedMode,
EnableDiscordIntegration = EnableDiscordIntegration,
EnableVsync = Graphics.EnableVsync,
@@ -354,6 +361,7 @@ namespace Ryujinx.Configuration
Logger.EnableFileLog.Value = true;
System.Language.Value = Language.AmericanEnglish;
System.Region.Value = Region.USA;
+ System.TimeZone.Value = "UTC";
System.EnableDockedMode.Value = false;
EnableDiscordIntegration.Value = true;
Graphics.EnableVsync.Value = true;
@@ -452,7 +460,7 @@ namespace Ryujinx.Configuration
{
bool configurationFileUpdated = false;
- if (configurationFileFormat.Version < 0 || configurationFileFormat.Version > 2)
+ if (configurationFileFormat.Version < 0 || configurationFileFormat.Version > ConfigurationFileFormat.CurrentVersion)
{
Common.Logging.Logger.PrintWarning(LogClass.Application, $"Unsupported configuration version {configurationFileFormat.Version}, loading default.");
@@ -463,13 +471,22 @@ namespace Ryujinx.Configuration
if (configurationFileFormat.Version < 2)
{
- Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, needs to be updated.");
+ Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 2.");
configurationFileFormat.SystemRegion = Region.USA;
configurationFileUpdated = true;
}
+ if (configurationFileFormat.Version < 3)
+ {
+ Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 3.");
+
+ configurationFileFormat.SystemTimeZone = "UTC";
+
+ configurationFileUpdated = true;
+ }
+
Graphics.ShadersDumpPath.Value = configurationFileFormat.GraphicsShadersDumpPath;
Logger.EnableDebug.Value = configurationFileFormat.LoggingEnableDebug;
Logger.EnableStub.Value = configurationFileFormat.LoggingEnableStub;
@@ -482,6 +499,7 @@ namespace Ryujinx.Configuration
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
System.Language.Value = configurationFileFormat.SystemLanguage;
System.Region.Value = configurationFileFormat.SystemRegion;
+ System.TimeZone.Value = configurationFileFormat.SystemTimeZone;
System.EnableDockedMode.Value = configurationFileFormat.DockedMode;
System.EnableDockedMode.Value = configurationFileFormat.DockedMode;
EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration;