mirror of
https://github.com/ppy/osu
synced 2024-12-27 09:23:15 +00:00
Remove scores from song select leaderboard when leaving the screen
This commit is contained in:
parent
fbc40ffc65
commit
d3710f0bfd
@ -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();
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user