mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Display remaining attempts for playlist rooms with room-level attempt limits
This commit is contained in:
19
osu.Game/Online/Rooms/ItemAttemptsCount.cs
Normal file
19
osu.Game/Online/Rooms/ItemAttemptsCount.cs
Normal file
@ -0,0 +1,19 @@
|
||||
// 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 Newtonsoft.Json;
|
||||
|
||||
namespace osu.Game.Online.Rooms
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents attempts on a specific playlist item.
|
||||
/// </summary>
|
||||
public class ItemAttemptsCount
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public int PlaylistItemID { get; set; }
|
||||
|
||||
[JsonProperty("attempts")]
|
||||
public int Attempts { get; set; }
|
||||
}
|
||||
}
|
16
osu.Game/Online/Rooms/PlaylistAggregateScore.cs
Normal file
16
osu.Game/Online/Rooms/PlaylistAggregateScore.cs
Normal file
@ -0,0 +1,16 @@
|
||||
// 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 Newtonsoft.Json;
|
||||
|
||||
namespace osu.Game.Online.Rooms
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents aggregated score for the local user for a playlist.
|
||||
/// </summary>
|
||||
public class PlaylistAggregateScore
|
||||
{
|
||||
[JsonProperty("playlist_item_attempts")]
|
||||
public ItemAttemptsCount[] PlaylistItemAttempts { get; set; }
|
||||
}
|
||||
}
|
@ -72,6 +72,10 @@ namespace osu.Game.Online.Rooms
|
||||
[JsonIgnore]
|
||||
public readonly Bindable<int?> MaxParticipants = new Bindable<int?>();
|
||||
|
||||
[Cached]
|
||||
[JsonProperty("current_user_score")]
|
||||
public readonly Bindable<PlaylistAggregateScore> UserScore = new Bindable<PlaylistAggregateScore>();
|
||||
|
||||
[Cached]
|
||||
[JsonProperty("recent_participants")]
|
||||
public readonly BindableList<User> RecentParticipants = new BindableList<User>();
|
||||
@ -144,6 +148,7 @@ namespace osu.Game.Online.Rooms
|
||||
MaxParticipants.Value = other.MaxParticipants.Value;
|
||||
ParticipantCount.Value = other.ParticipantCount.Value;
|
||||
EndDate.Value = other.EndDate.Value;
|
||||
UserScore.Value = other.UserScore.Value;
|
||||
|
||||
if (EndDate.Value != null && DateTimeOffset.Now >= EndDate.Value)
|
||||
Status.Value = new RoomStatusEnded();
|
||||
|
Reference in New Issue
Block a user