mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-28 06:46:24 +02:00
UI: Button to set emulator time based on system time in settings, under the time settings.
Partially resolves #355. I think that wanted automatic. If automatic functionality is still desired even with this change then that will be considered.
This commit is contained in:
parent
1f0fa525a3
commit
d9fe0da345
3 changed files with 34 additions and 1 deletions
|
@ -329,7 +329,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; }
|
||||
|
@ -453,6 +457,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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue