1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 14:12:56 +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<HitResultCell> bottomScoreStatistics = null!;
private FillFlowContainer<ModCell> modStatistics = null!; private FillFlowContainer<ModCell> modStatistics = null!;
private readonly Bindable<bool> prefer24HourTime = new Bindable<bool>(); private readonly Bindable<bool> prefer24HourTime = new Bindable<bool>();
public LeaderboardScoreTooltip() public LeaderboardScoreTooltip()
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
@ -94,12 +95,14 @@ namespace osu.Game.Online.Leaderboards
} }
}; };
} }
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
prefer24HourTime.BindValueChanged(_ => updateTimestampLabel(), true); prefer24HourTime.BindValueChanged(_ => updateTimestampLabel(), true);
} }
private ScoreInfo? displayedScore; private ScoreInfo? displayedScore;
public void SetContent(ScoreInfo score) public void SetContent(ScoreInfo score)
@ -128,11 +131,14 @@ namespace osu.Game.Online.Leaderboards
topScoreStatistics.Add(new HitResultCell(result)); topScoreStatistics.Add(new HitResultCell(result));
} }
} }
private void updateTimestampLabel() private void updateTimestampLabel()
{ {
if (displayedScore != null) 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}";
} }
} }