mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 19:42:55 +08:00
Merge pull request #26612 from peppy/fix-back-sample-playback
Fix back sound being too loud when exiting many screens
This commit is contained in:
commit
4cd1573a4c
@ -40,8 +40,6 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
||||
{
|
||||
public override string Title => "Lounge";
|
||||
|
||||
protected override bool PlayExitSound => false;
|
||||
|
||||
protected override BackgroundScreen CreateBackground() => new LoungeBackgroundScreen
|
||||
{
|
||||
SelectedRoom = { BindTarget = SelectedRoom }
|
||||
|
@ -44,8 +44,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
|
||||
public override string ShortTitle => "room";
|
||||
|
||||
protected override bool PlayExitSound => !exitConfirmed;
|
||||
|
||||
[Resolved]
|
||||
private MultiplayerClient client { get; set; }
|
||||
|
||||
|
@ -13,6 +13,8 @@ namespace osu.Game.Screens.OnlinePlay
|
||||
|
||||
public virtual string ShortTitle => Title;
|
||||
|
||||
protected sealed override bool PlayExitSound => false;
|
||||
|
||||
[Resolved]
|
||||
protected IRoomManager? RoomManager { get; private set; }
|
||||
|
||||
|
@ -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