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
1 changed files with 6 additions and 0 deletions

View File

@ -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<bool> mouseWheelDisabled;
private readonly Bindable<bool> storyboardReplacesBackground = new Bindable<bool>();
@ -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();