1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-19 01:17:19 +08:00

Don't play player exit sound when restarting

This commit is contained in:
Dean Herbert 2022-06-15 17:49:18 +09:00
parent 713cff3403
commit be2b4e68b9

View File

@ -53,6 +53,8 @@ namespace osu.Game.Screens.Play
public override bool AllowBackButton => false; // handled by HoldForMenuButton
protected override bool PlayExitSound => !isRestarting;
protected override UserActivity InitialActivity => new UserActivity.InSoloGame(Beatmap.Value.BeatmapInfo, Ruleset.Value);
public override float BackgroundParallaxAmount => 0.1f;
@ -75,6 +77,8 @@ namespace osu.Game.Screens.Play
public Action RestartRequested;
private bool isRestarting;
private Bindable<bool> mouseWheelDisabled;
private readonly Bindable<bool> storyboardReplacesBackground = new Bindable<bool>();
@ -643,6 +647,8 @@ namespace osu.Game.Screens.Play
if (!Configuration.AllowRestart)
return;
isRestarting = true;
// at the point of restarting the track should either already be paused or the volume should be zero.
// stopping here is to ensure music doesn't become audible after exiting back to PlayerLoader.
musicController.Stop();