mirror of
https://github.com/ppy/osu
synced 2024-12-28 01:42:57 +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>
|
/// </summary>
|
||||||
public void RefetchScores() => Scheduler.AddOnce(refetchScores);
|
public void RefetchScores() => Scheduler.AddOnce(refetchScores);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clear all scores from the display.
|
||||||
|
/// </summary>
|
||||||
|
public void ClearScores()
|
||||||
|
{
|
||||||
|
cancelPendingWork();
|
||||||
|
SetScores(null);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Call when a retrieval or display failure happened to show a relevant message to the user.
|
/// Call when a retrieval or display failure happened to show a relevant message to the user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -220,9 +229,7 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
{
|
{
|
||||||
Debug.Assert(ThreadSafety.IsUpdateThread);
|
Debug.Assert(ThreadSafety.IsUpdateThread);
|
||||||
|
|
||||||
cancelPendingWork();
|
ClearScores();
|
||||||
|
|
||||||
SetScores(null);
|
|
||||||
setState(LeaderboardState.Retrieving);
|
setState(LeaderboardState.Retrieving);
|
||||||
|
|
||||||
currentFetchCancellationSource = new CancellationTokenSource();
|
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)
|
public override void OnResuming(ScreenTransitionEvent e)
|
||||||
{
|
{
|
||||||
base.OnResuming(e);
|
base.OnResuming(e);
|
||||||
|
Loading…
Reference in New Issue
Block a user