1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-18 05:39:53 +08:00

Add more ranked play SFX (#37258)

- Stage changes (with ducking):


https://github.com/user-attachments/assets/1ed1cf5a-759b-487a-9028-314accc15a6a

- Messages (with debouncing):


https://github.com/user-attachments/assets/c8c38d18-4fcc-4654-887b-be3de3e84949

Message sample might be a bit too clicky, but consider this a first
pass.

---
- [x] depends on ppy/osu-resources#417

---------

Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
Jamie Taylor
2026-04-12 01:43:36 +09:00
committed by GitHub
Unverified
parent 6231e06ebe
commit e36f9b2dcf
3 changed files with 42 additions and 2 deletions
@@ -5,6 +5,8 @@ using System;
using System.Collections.Generic;
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.Containers;
@@ -221,6 +223,9 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Components
private bool expanded;
private Sample messageReceivedSample = null!;
private double? lastSamplePlayback;
public BubbleChatHistory()
{
AutoSizeAxes = Axes.Y;
@@ -232,6 +237,12 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Components
};
}
[BackgroundDependencyLoader]
private void load(AudioManager audio)
{
messageReceivedSample = audio.Samples.Get(@"Multiplayer/Matchmaking/Ranked/message");
}
/// <summary>
/// Collapses the display such that only new messages are temporarily shown.
/// </summary>
@@ -301,6 +312,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Components
newMessage.Show();
playSample();
// If not in the expanded state, hide the new message after a short while.
if (!expanded)
{
@@ -309,6 +322,15 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Components
}
}
private void playSample()
{
if (lastSamplePlayback != null && Time.Current - lastSamplePlayback < 100)
return;
messageReceivedSample.Play();
lastSamplePlayback = Time.Current;
}
private partial class MessageBubble : CompositeDrawable
{
private readonly APIUser user;
@@ -2,6 +2,8 @@
// See the LICENCE file in the repository root for full licence text.
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.Containers;
@@ -10,6 +12,7 @@ using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Overlays;
using osu.Game.Users.Drawables;
using osuTK;
@@ -27,6 +30,11 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay
private FillFlowContainer detailsContainer = null!;
private CircularContainer avatarContainer = null!;
private Sample stageChangeSample = null!;
[Resolved]
private MusicController musicController { get; set; } = null!;
public RankedPlayStageOverlay(LocalisableString stageName, RankedPlayColourScheme colourScheme)
{
this.stageName = stageName;
@@ -34,7 +42,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay
}
[BackgroundDependencyLoader]
private void load()
private void load(AudioManager audio)
{
RelativeSizeAxes = Axes.Both;
@@ -153,6 +161,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay
Text = $"{Multiplier:N0}x damage",
});
}
stageChangeSample = audio.Samples.Get(@"Multiplayer/Matchmaking/Ranked/stage-change");
}
protected override void LoadComplete()
@@ -173,6 +183,14 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay
.ScaleTo(0.9f)
.ScaleTo(1f, duration, easing);
musicController.DuckMomentarily(time_visible, new DuckParameters
{
DuckDuration = 0,
DuckVolumeTo = 0.5,
DuckCutoffTo = 600,
});
stageChangeSample.Play();
using (BeginDelayedSequence(time_visible))
{
this.FadeOut(duration, easing)
+1 -1
View File
@@ -40,7 +40,7 @@
</PackageReference>
<PackageReference Include="Realm" Version="20.1.0" />
<PackageReference Include="ppy.osu.Framework" Version="2026.318.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2026.404.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2026.411.0" />
<PackageReference Include="Sentry" Version="6.2.0" />
<!-- Held back due to 0.34.0 failing AOT compilation on ZstdSharp.dll dependency. -->
<PackageReference Include="SharpCompress" Version="0.47.0" />