1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 06:23:21 +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 bool scorePositionIsSet;
public int? ScorePosition
{
get => scorePosition;
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;
scorePosition = value;
positionText.Text = scorePosition.HasValue ? $"#{scorePosition.Value.FormatRank()}" : "-";
scorePositionIsSet = true;
updateState();
}