1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:42:57 +08:00

Merge pull request #26410 from peppy/ranking-leaderboard-whiz

Remove scores from song select leaderboard when leaving the screen
This commit is contained in:
Bartłomiej Dach 2024-01-08 11:51:46 +01:00 committed by GitHub
commit 991c6d239d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View File

@ -152,6 +152,15 @@ namespace osu.Game.Online.Leaderboards
/// </summary>
public void RefetchScores() => Scheduler.AddOnce(refetchScores);
/// <summary>
/// Clear all scores from the display.
/// </summary>
public void ClearScores()
{
cancelPendingWork();
SetScores(null);
}
/// <summary>
/// Call when a retrieval or display failure happened to show a relevant message to the user.
/// </summary>
@ -220,9 +229,7 @@ namespace osu.Game.Online.Leaderboards
{
Debug.Assert(ThreadSafety.IsUpdateThread);
cancelPendingWork();
SetScores(null);
ClearScores();
setState(LeaderboardState.Retrieving);
currentFetchCancellationSource = new CancellationTokenSource();

View File

@ -146,6 +146,14 @@ namespace osu.Game.Screens.Select
}
}
public override void OnSuspending(ScreenTransitionEvent e)
{
// Scores will be refreshed on arriving at this screen.
// Clear them to avoid animation overload on returning to song select.
playBeatmapDetailArea.Leaderboard.ClearScores();
base.OnSuspending(e);
}
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(e);