mirror of
https://github.com/ppy/osu.git
synced 2025-03-03 17:12:55 +08:00
Move 'back' sample playback from OnResuming to OnExiting
This commit is contained in:
parent
af87722be8
commit
6b744a14b0
@ -66,6 +66,8 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
protected override BackgroundScreen CreateBackground() => background;
|
||||
|
||||
protected override bool PlayExitSound => false;
|
||||
|
||||
private Bindable<double> holdDelay;
|
||||
private Bindable<bool> loginDisplayed;
|
||||
|
||||
|
@ -77,7 +77,7 @@ namespace osu.Game.Screens
|
||||
|
||||
private Sample sampleExit;
|
||||
|
||||
protected virtual bool PlayResumeSound => true;
|
||||
protected virtual bool PlayExitSound => true;
|
||||
|
||||
public virtual float BackgroundParallaxAmount => 1;
|
||||
|
||||
@ -173,9 +173,6 @@ namespace osu.Game.Screens
|
||||
|
||||
public override void OnResuming(ScreenTransitionEvent e)
|
||||
{
|
||||
if (PlayResumeSound)
|
||||
sampleExit?.Play();
|
||||
|
||||
applyArrivingDefaults(true);
|
||||
|
||||
// it's feasible to resume to a screen if the target screen never loaded successfully.
|
||||
@ -215,6 +212,9 @@ namespace osu.Game.Screens
|
||||
|
||||
public override bool OnExiting(ScreenExitEvent e)
|
||||
{
|
||||
if (PlayExitSound)
|
||||
sampleExit?.Play();
|
||||
|
||||
if (ValidForResume && logo != null)
|
||||
onExitingLogo();
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace osu.Game.Screens.Play
|
||||
// We show the previous screen status
|
||||
protected override UserActivity? InitialActivity => null;
|
||||
|
||||
protected override bool PlayResumeSound => false;
|
||||
protected override bool PlayExitSound => false;
|
||||
|
||||
protected BeatmapMetadataDisplay MetadataInfo { get; private set; } = null!;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user