1
0
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:
Jamie Taylor 2022-06-15 13:04:08 +09:00
parent af87722be8
commit 6b744a14b0
No known key found for this signature in database
GPG Key ID: 2ACFA8B6370B8C8C
3 changed files with 7 additions and 5 deletions

View File

@ -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;

View File

@ -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();

View File

@ -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!;