Make beatmap scores also support null position

This commit is contained in:
smoogipoo
2020-02-20 15:04:12 +09:00
parent 1a689231c2
commit d79ca97fe9
4 changed files with 33 additions and 8 deletions

View File

@ -17,7 +17,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
{
private readonly Box background;
public DrawableTopScore(ScoreInfo score, int position = 1)
public DrawableTopScore(ScoreInfo score, int? position = 1)
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Diagnostics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -71,10 +70,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
topScoresContainer.Add(new DrawableTopScore(topScore));
if (userScoreInfo != null && userScoreInfo.OnlineScoreID != topScore.OnlineScoreID)
{
Debug.Assert(userScore.Position != null);
topScoresContainer.Add(new DrawableTopScore(userScoreInfo, userScore.Position.Value));
}
topScoresContainer.Add(new DrawableTopScore(userScoreInfo, userScore.Position));
});
}

View File

@ -112,9 +112,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
};
}
public int ScorePosition
public int? ScorePosition
{
set => rankText.Text = $"#{value}";
set => rankText.Text = value == null ? "-" : $"#{value}";
}
/// <summary>