From 27ff2a7d49dcb4d735ee35cc54ef4d045d4a0a15 Mon Sep 17 00:00:00 2001 From: Jamie Taylor Date: Fri, 3 Oct 2025 17:16:45 +0900 Subject: [PATCH] Add SFX for round transitions --- .../Matchmaking/Match/StageDisplay.cs | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs index e383df71c9..446d01562c 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/StageDisplay.cs @@ -3,6 +3,8 @@ using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; @@ -138,8 +140,15 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match private Circle innerCircle = null!; private CircularProgress progress = null!; + private Sample? swishSample; + private Sample? swooshSample; + private Sample? roundUpSample; + private SampleChannel? swishChannel; + private SampleChannel? swooshChannel; + private SampleChannel? roundUpChannel; + [BackgroundDependencyLoader] - private void load(OverlayColourProvider colours) + private void load(OverlayColourProvider colours, AudioManager audio) { Size = new Vector2(76); @@ -210,6 +219,11 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match Text = $"{round_count}" }, }; + + swishSample = audio.Samples.Get(@"UI/overlay-pop-in"); + swooshSample = audio.Samples.Get(@"UI/overlay-big-pop-out"); + roundUpSample = audio.Samples.Get(@"Multiplayer/Matchmaking/round-up"); + } private int round; @@ -231,9 +245,37 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match .MoveToY(0, 500, Easing.InQuart) .ScaleTo(1, 500, Easing.InQuart); + swishChannel = swishSample?.GetChannel(); + + if (swishChannel != null) + { + swishChannel.Balance.Value = -OsuGameBase.SFX_STEREO_STRENGTH; + swishChannel?.Play(); + } + + Scheduler.AddDelayed(() => + { + swooshChannel = swooshSample?.GetChannel(); + + if (swooshChannel != null) { + swooshChannel.Balance.Value = -OsuGameBase.SFX_STEREO_STRENGTH; + swooshChannel?.Play(); + } + }, 1250); + Scheduler.AddDelayed(() => { progress.ProgressTo((float)round / round_count, 500, Easing.InOutQuart); + + roundUpChannel = roundUpSample?.GetChannel(); + + if (roundUpChannel != null) + { + roundUpChannel.Balance.Value = -OsuGameBase.SFX_STEREO_STRENGTH; + roundUpChannel.Frequency.Value = 1f + round * 0.05f; + roundUpChannel?.Play(); + } + Scheduler.AddDelayed(() => { innerCircle