Merge branch 'master' into update-icons

This commit is contained in:
Dan Balasescu
2020-09-03 20:19:51 +09:00
committed by GitHub
12 changed files with 144 additions and 138 deletions

View File

@ -14,8 +14,6 @@ namespace osu.Game.Screens.Multi.Match.Components
{
public class MatchLeaderboard : Leaderboard<MatchLeaderboardScope, APIUserScoreAggregate>
{
public Action<IEnumerable<APIUserScoreAggregate>> ScoresLoaded;
[Resolved(typeof(Room), nameof(Room.RoomID))]
private Bindable<int?> roomId { get; set; }
@ -39,18 +37,20 @@ namespace osu.Game.Screens.Multi.Match.Components
if (roomId.Value == null)
return null;
var req = new GetRoomScoresRequest(roomId.Value ?? 0);
var req = new GetRoomLeaderboardRequest(roomId.Value ?? 0);
req.Success += r =>
{
scoresCallback?.Invoke(r);
ScoresLoaded?.Invoke(r);
scoresCallback?.Invoke(r.Leaderboard);
TopScore = r.UserScore;
};
return req;
}
protected override LeaderboardScore CreateDrawableScore(APIUserScoreAggregate model, int index) => new MatchLeaderboardScore(model, index);
protected override LeaderboardScore CreateDrawableTopScore(APIUserScoreAggregate model) => new MatchLeaderboardScore(model, model.Position, false);
}
public enum MatchLeaderboardScope

View File

@ -14,8 +14,8 @@ namespace osu.Game.Screens.Multi.Match.Components
{
private readonly APIUserScoreAggregate score;
public MatchLeaderboardScore(APIUserScoreAggregate score, int rank)
: base(score.CreateScoreInfo(), rank)
public MatchLeaderboardScore(APIUserScoreAggregate score, int? rank, bool allowHighlight = true)
: base(score.CreateScoreInfo(), rank, allowHighlight)
{
this.score = score;
}