1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 18:23:04 +08:00

Cancel previous load attempts before starting a new score load.

This commit is contained in:
Dean Herbert 2017-03-04 21:35:12 +09:00
parent 95e2e2b027
commit a5d044067c
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49

View File

@ -25,6 +25,7 @@ using OpenTK;
using System.Linq;
using osu.Framework.Graphics.Primitives;
using System.Threading.Tasks;
using osu.Framework.Threading;
using osu.Game.Graphics;
using osu.Game.Overlays.Notifications;
using osu.Game.Screens.Play;
@ -93,13 +94,17 @@ namespace osu.Game
PlayMode = LocalConfig.GetBindable<PlayMode>(OsuConfig.PlayMode);
}
private ScheduledDelegate scoreLoad;
protected void LoadScore(Score s)
{
scoreLoad?.Cancel();
var menu = intro.ChildScreen;
if (menu == null)
{
Schedule(() => LoadScore(s));
scoreLoad = Schedule(() => LoadScore(s));
return;
}
@ -107,7 +112,7 @@ namespace osu.Game
{
menu.MakeCurrent();
Delay(500);
Schedule(() => LoadScore(s));
scoreLoad = Schedule(() => LoadScore(s));
return;
}