From 0dd38028cbf54b672a41fcec0024740ff8ccea72 Mon Sep 17 00:00:00 2001 From: Thog Date: Wed, 25 Mar 2020 23:23:21 +0100 Subject: Make Device Location Name configuration (custom TZ) (#1031) This permit to use arbitrary timezone (instead of UTC). Useful for games like ACNH. --- Ryujinx.Common/Configuration/ConfigurationState.cs | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'Ryujinx.Common/Configuration/ConfigurationState.cs') 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 @@ -153,6 +153,11 @@ namespace Ryujinx.Configuration /// public ReactiveObject Region { get; private set; } + /// + /// Change System TimeZone + /// + public ReactiveObject TimeZone { get; private set; } + /// /// Enables or disables Docked Mode /// @@ -182,6 +187,7 @@ namespace Ryujinx.Configuration { Language = new ReactiveObject(); Region = new ReactiveObject(); + TimeZone = new ReactiveObject(); EnableDockedMode = new ReactiveObject(); EnableMulticoreScheduling = new ReactiveObject(); EnableFsIntegrityChecks = new ReactiveObject(); @@ -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; -- cgit v1.2.3