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

Remove scores from song select leaderboard when leaving the screen

This commit is contained in:
Dean Herbert 2024-01-06 20:44:07 +09:00
parent fbc40ffc65
commit d3710f0bfd
No known key found for this signature in database
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);