mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 09:58:21 +08:00
Add sound for team swaps
This commit is contained in:
parent
2c6ee0ebf7
commit
217ca754ae
@ -3,6 +3,8 @@
|
||||
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -22,6 +24,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
||||
|
||||
private Drawable box;
|
||||
|
||||
private Sample sampleTeamSwap;
|
||||
|
||||
[Resolved]
|
||||
private OsuColour colours { get; set; }
|
||||
|
||||
@ -39,7 +43,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
box = new Container
|
||||
{
|
||||
@ -72,6 +76,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
||||
{
|
||||
InternalChild = box;
|
||||
}
|
||||
|
||||
sampleTeamSwap = audio.Samples.Get(@"Multiplayer/team-swap");
|
||||
}
|
||||
|
||||
private void changeTeam()
|
||||
@ -99,6 +105,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
||||
if (newTeam == displayedTeam)
|
||||
return;
|
||||
|
||||
if (newTeam != null && displayedTeam != null)
|
||||
sampleTeamSwap?.Play();
|
||||
|
||||
displayedTeam = newTeam;
|
||||
|
||||
if (displayedTeam != null)
|
||||
|
Loading…
Reference in New Issue
Block a user