mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Add support for showing own top score in timeshift
This commit is contained in:
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 class MatchLeaderboard : Leaderboard<MatchLeaderboardScope, APIUserScoreAggregate>
|
||||||
{
|
{
|
||||||
public Action<IEnumerable<APIUserScoreAggregate>> ScoresLoaded;
|
|
||||||
|
|
||||||
[Resolved(typeof(Room), nameof(Room.RoomID))]
|
[Resolved(typeof(Room), nameof(Room.RoomID))]
|
||||||
private Bindable<int?> roomId { get; set; }
|
private Bindable<int?> roomId { get; set; }
|
||||||
|
|
||||||
@ -43,8 +41,8 @@ namespace osu.Game.Screens.Multi.Match.Components
|
|||||||
|
|
||||||
req.Success += r =>
|
req.Success += r =>
|
||||||
{
|
{
|
||||||
scoresCallback?.Invoke(r);
|
scoresCallback?.Invoke(r.Leaderboard);
|
||||||
ScoresLoaded?.Invoke(r);
|
TopScore = r.OwnScore;
|
||||||
};
|
};
|
||||||
|
|
||||||
return req;
|
return req;
|
||||||
|
Reference in New Issue
Block a user