1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 18:42:56 +08:00

Fix Use24HourDisplay conditional flipped

This commit is contained in:
Salman Ahmed 2022-04-07 15:56:12 +03:00
parent b2c0eaeab4
commit c323020fcf
2 changed files with 3 additions and 2 deletions

View File

@ -40,6 +40,7 @@ namespace osu.Game.Overlays.Toolbar
return; return;
use24HourDisplay = value; use24HourDisplay = value;
updateMetrics(); updateMetrics();
UpdateDisplay(DateTimeOffset.Now); //Update realTime.Text immediately instead of waiting until next second UpdateDisplay(DateTimeOffset.Now); //Update realTime.Text immediately instead of waiting until next second
} }
@ -66,7 +67,7 @@ namespace osu.Game.Overlays.Toolbar
protected override void UpdateDisplay(DateTimeOffset now) protected override void UpdateDisplay(DateTimeOffset now)
{ {
realTime.Text = use24HourDisplay ? $"{now:h:mm:ss tt}" : $"{now:HH:mm:ss}"; realTime.Text = use24HourDisplay ? $"{now:HH:mm:ss}" : $"{now:h:mm:ss tt}";
gameTime.Text = $"running {new TimeSpan(TimeSpan.TicksPerSecond * (int)(Clock.CurrentTime / 1000)):c}"; gameTime.Text = $"running {new TimeSpan(TimeSpan.TicksPerSecond * (int)(Clock.CurrentTime / 1000)):c}";
} }

View File

@ -97,7 +97,7 @@ namespace osu.Game.Overlays.Toolbar
analog.FadeTo(showAnalog ? 1 : 0); analog.FadeTo(showAnalog ? 1 : 0);
}, true); }, true);
prefer24HourTime.BindValueChanged(prefer24H => digital.Use24HourDisplay = !prefer24H.NewValue, true); prefer24HourTime.BindValueChanged(prefer24H => digital.Use24HourDisplay = prefer24H.NewValue, true);
} }
protected override bool OnClick(ClickEvent e) protected override bool OnClick(ClickEvent e)