mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add config in settings for forcing 24H time, determines default off CurrentCulture
This commit is contained in:
@ -29,7 +29,21 @@ namespace osu.Game.Overlays.Toolbar
|
||||
}
|
||||
}
|
||||
|
||||
private bool format12H = true;
|
||||
private bool format12H = false;
|
||||
|
||||
public bool Format12H
|
||||
{
|
||||
get => format12H;
|
||||
set
|
||||
{
|
||||
if (format12H == value)
|
||||
return;
|
||||
|
||||
format12H = value;
|
||||
updateMetrics();
|
||||
UpdateDisplay(DateTimeOffset.Now); //Update realTime.Text immediately instead of waiting until next second
|
||||
}
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
@ -52,14 +66,14 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
protected override void UpdateDisplay(DateTimeOffset now)
|
||||
{
|
||||
realTime.Text = format12H ? $"{now:hh:mm:ss tt}" : $"{now:HH:mm:ss}";
|
||||
realTime.Text = format12H ? $"{now:h:mm:ss tt}" : $"{now:HH:mm:ss}";
|
||||
gameTime.Text = $"running {new TimeSpan(TimeSpan.TicksPerSecond * (int)(Clock.CurrentTime / 1000)):c}";
|
||||
}
|
||||
|
||||
private void updateMetrics()
|
||||
{
|
||||
if (format12H)
|
||||
Width = 74;
|
||||
Width = 70;
|
||||
else
|
||||
Width = showRuntime ? 66 : 45; // Allows for space for game time up to 99 days (in the padding area since this is quite rare).
|
||||
|
||||
|
Reference in New Issue
Block a user