UI: Button to set emulator time based on system time in settings, under the time settings

This commit is contained in:
Evan Husted
2025-05-08 17:05:03 -05:00
committed by KeatonTheBot
parent 95ac0a7a51
commit d640f50203
12 changed files with 50 additions and 2 deletions
@@ -328,7 +328,11 @@ namespace Ryujinx.Ava.UI.ViewModels
}
}
//private DateTimeOffset _currentDate;
//private TimeSpan _currentTime;
public DateTimeOffset CurrentDate { get; set; }
public TimeSpan CurrentTime { get; set; }
internal AvaloniaList<TimeZone> TimeZones { get; set; }
@@ -452,6 +456,18 @@ namespace Ryujinx.Ava.UI.ViewModels
Dispatcher.UIThread.Post(() => OnPropertyChanged(nameof(PreferredGpuIndex)));
}
public void MatchSystemTime()
{
var dto = DateTimeOffset.Now;
CurrentDate = new DateTimeOffset(dto.Year, dto.Month, dto.Day, 0, 0, 0, dto.Offset);
CurrentTime = dto.TimeOfDay;
OnPropertyChanged(nameof(CurrentDate));
OnPropertyChanged(nameof(CurrentTime));
}
public async Task LoadTimeZones()
{
_timeZoneContentManager = new TimeZoneContentManager();