mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +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>
|
/// </summary>
|
||||||
public event Action OnGameplayStarted;
|
public event Action OnGameplayStarted;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Raised after all gameplay has finished.
|
||||||
|
/// </summary>
|
||||||
|
public event Action OnShowingResults;
|
||||||
|
|
||||||
public override bool AllowBackButton => false; // handled by HoldForMenuButton
|
public override bool AllowBackButton => false; // handled by HoldForMenuButton
|
||||||
|
|
||||||
protected override bool PlayExitSound => !isRestarting;
|
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.
|
// This player instance may already be in the process of exiting.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
OnShowingResults?.Invoke();
|
||||||
this.Push(CreateResults(prepareScoreForDisplayTask.GetResultSafely()));
|
this.Push(CreateResults(prepareScoreForDisplayTask.GetResultSafely()));
|
||||||
}, Time.Current + delay, 50);
|
}, Time.Current + delay, 50);
|
||||||
|
|
||||||
|
@ -529,7 +529,13 @@ namespace osu.Game.Screens.Play
|
|||||||
scheduledPushPlayer = Scheduler.AddDelayed(() =>
|
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).
|
// 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();
|
ContentOut();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user