mirror of
https://github.com/ppy/osu.git
synced 2024-09-21 14:47:25 +08:00
End high performance session when showing results screen
This commit is contained in:
parent
f0e2b803de
commit
b01fb2a5bf
@ -57,6 +57,11 @@ namespace osu.Game.Screens.Play
|
||||
/// </summary>
|
||||
public event Action OnGameplayStarted;
|
||||
|
||||
/// <summary>
|
||||
/// Raised after all gameplay has finished.
|
||||
/// </summary>
|
||||
public event Action OnShowingResults;
|
||||
|
||||
public override bool AllowBackButton => false; // handled by HoldForMenuButton
|
||||
|
||||
protected override bool PlayExitSound => !isRestarting;
|
||||
@ -820,6 +825,7 @@ namespace osu.Game.Screens.Play
|
||||
// This player instance may already be in the process of exiting.
|
||||
return;
|
||||
|
||||
OnShowingResults?.Invoke();
|
||||
this.Push(CreateResults(prepareScoreForDisplayTask.GetResultSafely()));
|
||||
}, Time.Current + delay, 50);
|
||||
|
||||
|
@ -529,7 +529,13 @@ namespace osu.Game.Screens.Play
|
||||
scheduledPushPlayer = Scheduler.AddDelayed(() =>
|
||||
{
|
||||
// ensure that once we have reached this "point of no return", readyForPush will be false for all future checks (until a new player instance is prepared).
|
||||
var consumedPlayer = consumePlayer();
|
||||
Player consumedPlayer = consumePlayer();
|
||||
|
||||
consumedPlayer.OnShowingResults += () =>
|
||||
{
|
||||
highPerformanceSession?.Dispose();
|
||||
highPerformanceSession = null;
|
||||
};
|
||||
|
||||
ContentOut();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user