1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Merge remote-tracking branch 'refs/remotes/ppy/master' into requests-expanded

This commit is contained in:
Andrei Zavatski 2019-08-07 06:33:54 +03:00
commit 2d0f555048
3 changed files with 8 additions and 16 deletions

0
.gitmodules vendored
View File

View File

@ -1,2 +0,0 @@
language: csharp
solution: osu.sln

View File

@ -255,7 +255,7 @@ namespace osu.Game.Screens.Play
private void performImmediateExit()
{
// if a restart has been requested, cancel any pending completion (user has shown intent to restart).
onCompletionEvent = null;
completionProgressDelegate?.Cancel();
ValidForResume = false;
@ -275,20 +275,16 @@ namespace osu.Game.Screens.Play
sampleRestart?.Play();
// if a restart has been requested, cancel any pending completion (user has shown intent to restart).
onCompletionEvent = null;
ValidForResume = false;
RestartRequested?.Invoke();
this.Exit();
performImmediateExit();
}
private ScheduledDelegate onCompletionEvent;
private ScheduledDelegate completionProgressDelegate;
private void onCompletion()
{
// Only show the completion screen if the player hasn't failed
if (ScoreProcessor.HasFailed || onCompletionEvent != null)
if (ScoreProcessor.HasFailed || completionProgressDelegate != null)
return;
ValidForResume = false;
@ -297,7 +293,7 @@ namespace osu.Game.Screens.Play
using (BeginDelayedSequence(1000))
{
onCompletionEvent = Schedule(delegate
completionProgressDelegate = Schedule(delegate
{
if (!this.IsCurrentScreen()) return;
@ -306,8 +302,6 @@ namespace osu.Game.Screens.Play
scoreManager.Import(score).Wait();
this.Push(CreateResults(score));
onCompletionEvent = null;
});
}
}
@ -471,10 +465,10 @@ namespace osu.Game.Screens.Play
public override bool OnExiting(IScreen next)
{
if (onCompletionEvent != null)
if (completionProgressDelegate != null && !completionProgressDelegate.Cancelled && !completionProgressDelegate.Completed)
{
// Proceed to result screen if beatmap already finished playing
onCompletionEvent.RunTask();
// proceed to result screen if beatmap already finished playing
completionProgressDelegate.RunTask();
return true;
}