From be2b4e68b9e90fb42cc27032015b4885da10293e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Jun 2022 17:49:18 +0900 Subject: [PATCH] Don't play player exit sound when restarting --- osu.Game/Screens/Play/Player.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index d6f6a06eb7..33a20ff190 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -53,6 +53,8 @@ public abstract class Player : ScreenWithBeatmapBackground, ISamplePlaybackDisab 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 @@ public abstract class Player : ScreenWithBeatmapBackground, ISamplePlaybackDisab public Action RestartRequested; + private bool isRestarting; + private Bindable mouseWheelDisabled; private readonly Bindable storyboardReplacesBackground = new Bindable(); @@ -643,6 +647,8 @@ public void Restart() 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();