mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 23:12:56 +08:00
Only play back sample once when traversing up multiple screens in stack
This commit is contained in:
parent
ef0b5c9406
commit
fd9c7184e4
@ -223,7 +223,12 @@ namespace osu.Game.Screens
|
||||
|
||||
public override bool OnExiting(ScreenExitEvent e)
|
||||
{
|
||||
if (ValidForResume && PlayExitSound)
|
||||
// Only play the exit sound if we are the last screen in the exit sequence.
|
||||
// This stops many sample playbacks from stacking when a huge screen purge happens (ie. returning to menu via the home button
|
||||
// from a deeply nested screen).
|
||||
bool arrivingAtFinalDestination = e.Next == e.Destination;
|
||||
|
||||
if (ValidForResume && PlayExitSound && arrivingAtFinalDestination)
|
||||
sampleExit?.Play();
|
||||
|
||||
if (ValidForResume && logo != null)
|
||||
|
Loading…
Reference in New Issue
Block a user