1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-18 09:49:53 +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:
Bartłomiej Dach
2024-01-22 16:18:32 +01:00
committed by GitHub
Unverified
4 changed files with 8 additions and 5 deletions
@@ -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; }
+6 -1
View File
@@ -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)