mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 13:22:55 +08:00
Add support for showing own top score in timeshift
This commit is contained in:
parent
d1ceb81797
commit
77698ec31e
18
osu.Game/Online/Multiplayer/APILeaderboard.cs
Normal file
18
osu.Game/Online/Multiplayer/APILeaderboard.cs
Normal 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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user