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

moved BindValueChanged to LoadComplete

This commit is contained in:
vegguid 2022-09-17 12:58:23 +02:00
parent 288cc7b201
commit 0bfe967452

View File

@ -94,13 +94,11 @@ namespace osu.Game.Online.Leaderboards
}
};
}
private void updateDisplay()
protected override void LoadComplete()
{
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}";
}
base.LoadComplete();
prefer24HourTime.BindValueChanged(_ => updateTimestampLabel(), true);
}
private ScoreInfo? displayedScore;
@ -111,7 +109,7 @@ namespace osu.Game.Online.Leaderboards
displayedScore = score;
prefer24HourTime.BindValueChanged(_ => updateDisplay(), true);
updateTimestampLabel();
modStatistics.Clear();
topScoreStatistics.Clear();
@ -130,6 +128,13 @@ 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}";
}
}
protected override void PopIn() => this.FadeIn(20, Easing.OutQuint);
protected override void PopOut() => this.FadeOut(80, Easing.OutQuint);