1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 09:02:55 +08:00

Fix initial visual state of positions before sort runs

This commit is contained in:
Dean Herbert 2022-11-18 16:08:27 +09:00
parent 0a520c979e
commit d59befc9d3

View File

@ -62,17 +62,21 @@ namespace osu.Game.Screens.Play.HUD
private int? scorePosition; private int? scorePosition;
private bool scorePositionIsSet;
public int? ScorePosition public int? ScorePosition
{ {
get => scorePosition; get => scorePosition;
set set
{ {
if (value == scorePosition) // We always want to run once, as the incoming value may be null and require a visual update to "-".
if (value == scorePosition && scorePositionIsSet)
return; return;
scorePosition = value; scorePosition = value;
positionText.Text = scorePosition.HasValue ? $"#{scorePosition.Value.FormatRank()}" : "-"; positionText.Text = scorePosition.HasValue ? $"#{scorePosition.Value.FormatRank()}" : "-";
scorePositionIsSet = true;
updateState(); updateState();
} }