1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:12:57 +08:00

Add support for showing own top score in timeshift

This commit is contained in:
smoogipoo 2020-08-31 19:54:57 +09:00
parent d1ceb81797
commit 77698ec31e
2 changed files with 20 additions and 4 deletions

View File

@ -0,0 +1,18 @@
// 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.Collections.Generic;
using Newtonsoft.Json;
using osu.Game.Online.API.Requests.Responses;
namespace osu.Game.Online.Multiplayer
{
public class APILeaderboard
{
[JsonProperty("leaderboard")]
public List<APIUserScoreAggregate> Leaderboard;
[JsonProperty("own_score")]
public APIUserScoreAggregate OwnScore;
}
}

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; }
@ -43,8 +41,8 @@ namespace osu.Game.Screens.Multi.Match.Components
req.Success += r =>
{
scoresCallback?.Invoke(r);
ScoresLoaded?.Invoke(r);
scoresCallback?.Invoke(r.Leaderboard);
TopScore = r.OwnScore;
};
return req;