1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 20:53:04 +08:00

small fixes & docs fixes

This commit is contained in:
Wleter 2024-12-29 19:13:39 +01:00
parent 5cc7ad4cf1
commit f20e69b55c
3 changed files with 8 additions and 11 deletions

View File

@ -16,9 +16,6 @@ namespace osu.Game.Online.Leaderboards
{ {
public abstract partial class LeaderboardScoresProvider<TScope, TScoreInfo> : Component public abstract partial class LeaderboardScoresProvider<TScope, TScoreInfo> : Component
{ {
/// <summary>
/// The currently displayed scores.
/// </summary>
public IBindableList<TScoreInfo> Scores => scores; public IBindableList<TScoreInfo> Scores => scores;
public TScoreInfo? UserScore { get; private set; } public TScoreInfo? UserScore { get; private set; }
@ -112,9 +109,9 @@ namespace osu.Game.Online.Leaderboards
} }
/// <summary> /// <summary>
/// Call when a retrieval or display failure happened to show a relevant message to the user. /// Call when a retrieval of scores failed.
/// </summary> /// </summary>
/// <param name="state">The state to display.</param> /// <param name="state">The error state.</param>
protected void SetErrorState(LeaderboardState state) protected void SetErrorState(LeaderboardState state)
{ {
switch (state) switch (state)
@ -131,7 +128,7 @@ namespace osu.Game.Online.Leaderboards
} }
/// <summary> /// <summary>
/// Performs a fetch/refresh of scores to be displayed. /// Performs a fetch/refresh of scores of the leaderboard.
/// </summary> /// </summary>
/// <param name="cancellationToken"></param> /// <param name="cancellationToken"></param>
/// <returns>An <see cref="APIRequest"/> responsible for the fetch operation. This will be queued and performed automatically.</returns> /// <returns>An <see cref="APIRequest"/> responsible for the fetch operation. This will be queued and performed automatically.</returns>
@ -160,9 +157,9 @@ namespace osu.Game.Online.Leaderboards
} }
/// <summary> /// <summary>
/// Call when retrieved scores are ready to be displayed. /// Call when retrieved scores are ready to use by a leaderboard.
/// </summary> /// </summary>
/// <param name="scores">The scores to display.</param> /// <param name="scores">The scores to use.</param>
/// <param name="userScore">The user top score, if any.</param> /// <param name="userScore">The user top score, if any.</param>
protected void SetScores(IEnumerable<TScoreInfo>? scores, TScoreInfo? userScore = default) protected void SetScores(IEnumerable<TScoreInfo>? scores, TScoreInfo? userScore = default)
{ {

View File

@ -40,7 +40,7 @@ namespace osu.Game.Screens.OnlinePlay.Match.Components
if (room.RoomID == null) if (room.RoomID == null)
return; return;
SetScores(null); PrepareScoresRetrieval();
RefetchScores(); RefetchScores();
} }

View File

@ -183,8 +183,6 @@ namespace osu.Game.Screens.Select.Leaderboards
void localScoresChanged(IRealmCollection<ScoreInfo> sender, ChangeSet? changes) void localScoresChanged(IRealmCollection<ScoreInfo> sender, ChangeSet? changes)
{ {
SetState(LeaderboardState.Retrieving);
if (cancellationToken.IsCancellationRequested) if (cancellationToken.IsCancellationRequested)
return; return;
@ -193,6 +191,8 @@ namespace osu.Game.Screens.Select.Leaderboards
if (changes?.HasCollectionChanges() == false) if (changes?.HasCollectionChanges() == false)
return; return;
SetState(LeaderboardState.Retrieving);
var scores = sender.AsEnumerable(); var scores = sender.AsEnumerable();
if (filterMods && !mods.Value.Any()) if (filterMods && !mods.Value.Any())