From f20e69b55ccec307fcdaac312d902991930919bf Mon Sep 17 00:00:00 2001 From: Wleter Date: Sun, 29 Dec 2024 19:13:39 +0100 Subject: [PATCH] small fixes & docs fixes --- .../Leaderboards/LeaderboardScoresProvider.cs | 13 +++++-------- .../Components/MatchLeaderboardScoresProvider.cs | 2 +- .../BeatmapLeaderboardScoresProvider.cs | 4 ++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/osu.Game/Online/Leaderboards/LeaderboardScoresProvider.cs b/osu.Game/Online/Leaderboards/LeaderboardScoresProvider.cs index 097dbd4f8a..d4aa1db53b 100644 --- a/osu.Game/Online/Leaderboards/LeaderboardScoresProvider.cs +++ b/osu.Game/Online/Leaderboards/LeaderboardScoresProvider.cs @@ -16,9 +16,6 @@ namespace osu.Game.Online.Leaderboards { public abstract partial class LeaderboardScoresProvider : Component { - /// - /// The currently displayed scores. - /// public IBindableList Scores => scores; public TScoreInfo? UserScore { get; private set; } @@ -112,9 +109,9 @@ namespace osu.Game.Online.Leaderboards } /// - /// Call when a retrieval or display failure happened to show a relevant message to the user. + /// Call when a retrieval of scores failed. /// - /// The state to display. + /// The error state. protected void SetErrorState(LeaderboardState state) { switch (state) @@ -131,7 +128,7 @@ namespace osu.Game.Online.Leaderboards } /// - /// Performs a fetch/refresh of scores to be displayed. + /// Performs a fetch/refresh of scores of the leaderboard. /// /// /// An responsible for the fetch operation. This will be queued and performed automatically. @@ -160,9 +157,9 @@ namespace osu.Game.Online.Leaderboards } /// - /// Call when retrieved scores are ready to be displayed. + /// Call when retrieved scores are ready to use by a leaderboard. /// - /// The scores to display. + /// The scores to use. /// The user top score, if any. protected void SetScores(IEnumerable? scores, TScoreInfo? userScore = default) { diff --git a/osu.Game/Screens/OnlinePlay/Match/Components/MatchLeaderboardScoresProvider.cs b/osu.Game/Screens/OnlinePlay/Match/Components/MatchLeaderboardScoresProvider.cs index 23e2aeeb7d..299495cf99 100644 --- a/osu.Game/Screens/OnlinePlay/Match/Components/MatchLeaderboardScoresProvider.cs +++ b/osu.Game/Screens/OnlinePlay/Match/Components/MatchLeaderboardScoresProvider.cs @@ -40,7 +40,7 @@ namespace osu.Game.Screens.OnlinePlay.Match.Components if (room.RoomID == null) return; - SetScores(null); + PrepareScoresRetrieval(); RefetchScores(); } diff --git a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboardScoresProvider.cs b/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboardScoresProvider.cs index ec76c9bf97..a8d2d091df 100644 --- a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboardScoresProvider.cs +++ b/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboardScoresProvider.cs @@ -183,8 +183,6 @@ namespace osu.Game.Screens.Select.Leaderboards void localScoresChanged(IRealmCollection sender, ChangeSet? changes) { - SetState(LeaderboardState.Retrieving); - if (cancellationToken.IsCancellationRequested) return; @@ -193,6 +191,8 @@ namespace osu.Game.Screens.Select.Leaderboards if (changes?.HasCollectionChanges() == false) return; + SetState(LeaderboardState.Retrieving); + var scores = sender.AsEnumerable(); if (filterMods && !mods.Value.Any())