1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 18:03:11 +08:00

Fix formatting

This commit is contained in:
Dean Herbert 2022-09-17 22:22:56 +09:00
parent 0bfe967452
commit a1d830e47f

View File

@ -27,6 +27,7 @@ namespace osu.Game.Online.Leaderboards
private FillFlowContainer<HitResultCell> bottomScoreStatistics = null!;
private FillFlowContainer<ModCell> modStatistics = null!;
private readonly Bindable<bool> prefer24HourTime = new Bindable<bool>();
public LeaderboardScoreTooltip()
{
AutoSizeAxes = Axes.Both;
@ -94,12 +95,14 @@ namespace osu.Game.Online.Leaderboards
}
};
}
protected override void LoadComplete()
{
base.LoadComplete();
prefer24HourTime.BindValueChanged(_ => updateTimestampLabel(), true);
}
private ScoreInfo? displayedScore;
public void SetContent(ScoreInfo score)
@ -128,11 +131,14 @@ namespace osu.Game.Online.Leaderboards
topScoreStatistics.Add(new HitResultCell(result));
}
}
private void updateTimestampLabel()
{
if (displayedScore != null)
{
timestampLabel.Text = prefer24HourTime.Value ? $"Played on {displayedScore.Date.ToLocalTime():d MMMM yyyy HH:mm}" : $"Played on {displayedScore.Date.ToLocalTime():d MMMM yyyy h:mm tt}";
timestampLabel.Text = prefer24HourTime.Value
? $"Played on {displayedScore.Date.ToLocalTime():d MMMM yyyy HH:mm}"
: $"Played on {displayedScore.Date.ToLocalTime():d MMMM yyyy h:mm tt}";
}
}