diff --git a/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs b/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs index 08612117a..75a5168fc 100644 --- a/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs +++ b/src/Ryujinx.Ava/UI/ViewModels/SettingsViewModel.cs @@ -238,8 +238,9 @@ namespace Ryujinx.Ava.UI.ViewModels } } - public DateTimeOffset DateOffset { get; set; } - public TimeSpan TimeOffset { get; set; } + public DateTimeOffset CurrentDate { get; set; } + public TimeSpan CurrentTime { get; set; } + internal AvaloniaList TimeZones { get; set; } public AvaloniaList GameDirectories { get; set; } public ObservableCollection AvailableGpus { get; set; } @@ -397,10 +398,11 @@ namespace Ryujinx.Ava.UI.ViewModels Language = (int)config.System.Language.Value; TimeZone = config.System.TimeZone; - DateTime dateTimeOffset = DateTime.Now.AddSeconds(config.System.SystemTimeOffset); + DateTime currentDateTime = DateTime.Now; + + CurrentDate = currentDateTime.Date; + CurrentTime = currentDateTime.TimeOfDay.Add(TimeSpan.FromSeconds(config.System.SystemTimeOffset)); - DateOffset = dateTimeOffset.Date; - TimeOffset = dateTimeOffset.TimeOfDay; EnableVsync = config.Graphics.EnableVsync; EnableFsIntegrityChecks = config.System.EnableFsIntegrityChecks; ExpandDramSize = config.System.ExpandRam; @@ -487,9 +489,7 @@ namespace Ryujinx.Ava.UI.ViewModels config.System.TimeZone.Value = TimeZone; } - TimeSpan systemTimeOffset = DateOffset - DateTime.Now; - - config.System.SystemTimeOffset.Value = systemTimeOffset.Seconds; + config.System.SystemTimeOffset.Value = Convert.ToInt64((CurrentDate.ToUnixTimeSeconds() + CurrentTime.TotalSeconds) - DateTimeOffset.Now.ToUnixTimeSeconds()); config.Graphics.EnableVsync.Value = EnableVsync; config.System.EnableFsIntegrityChecks.Value = EnableFsIntegrityChecks; config.System.ExpandRam.Value = ExpandDramSize; diff --git a/src/Ryujinx.Ava/UI/Views/Settings/SettingsSystemView.axaml b/src/Ryujinx.Ava/UI/Views/Settings/SettingsSystemView.axaml index 1d4f040fd..cc60ef24d 100644 --- a/src/Ryujinx.Ava/UI/Views/Settings/SettingsSystemView.axaml +++ b/src/Ryujinx.Ava/UI/Views/Settings/SettingsSystemView.axaml @@ -3,12 +3,12 @@ xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" - mc:Ignorable="d" x:CompileBindings="True" - x:DataType="viewModels:SettingsViewModel"> + x:DataType="viewModels:SettingsViewModel" + mc:Ignorable="d"> @@ -27,13 +27,15 @@ - - + + @@ -58,20 +60,21 @@ - - + + - + @@ -104,71 +107,67 @@ - + - + - + - + - + - + - + - - + + - + - + @@ -180,12 +179,10 @@ Margin="10,0,0,0" HorizontalAlignment="Stretch" Orientation="Vertical"> - + - +