1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 14:52:57 +08:00

Add song select panel sound effects.

This commit is contained in:
Dean Herbert 2016-12-05 20:09:56 +09:00
parent 590ca3108c
commit 8fc8ca3998
2 changed files with 15 additions and 1 deletions

@ -1 +1 @@
Subproject commit 8ee9e6736fb3f656894baaef109a06fd25278fe6
Subproject commit 1bf3167fa384c124f388a885f01613ed59fe8169

View File

@ -24,6 +24,7 @@ using OpenTK;
using OpenTK.Graphics;
using osu.Game.Screens.Play;
using osu.Framework;
using osu.Framework.Audio.Sample;
using osu.Game.Beatmaps.Drawables;
using osu.Game.Graphics.Containers;
@ -45,6 +46,9 @@ namespace osu.Game.Screens.Select
private static readonly Vector2 BACKGROUND_BLUR = new Vector2(20);
private CancellationTokenSource initialAddSetsTask;
private AudioSample sampleChangeDifficulty;
private AudioSample sampleChangeBeatmap;
class WedgeBackground : Container
{
public WedgeBackground()
@ -163,6 +167,9 @@ namespace osu.Game.Screens.Select
trackManager = audio.Track;
sampleChangeDifficulty = audio.Sample.Get(@"SongSelect/select-difficulty");
sampleChangeBeatmap = audio.Sample.Get(@"SongSelect/select-expand");
initialAddSetsTask = new CancellationTokenSource();
Task.Factory.StartNew(() => addBeatmapSets(game, initialAddSetsTask.Token), initialAddSetsTask.Token);
@ -259,7 +266,14 @@ namespace osu.Game.Screens.Select
private void selectionChanged(BeatmapGroup group, BeatmapInfo beatmap)
{
if (!beatmap.Equals(Beatmap?.BeatmapInfo))
{
if (beatmap.BeatmapSetID == Beatmap?.BeatmapInfo.BeatmapSetID)
sampleChangeDifficulty.Play();
else
sampleChangeBeatmap.Play();
Beatmap = database.GetWorkingBeatmap(beatmap, Beatmap);
}
ensurePlayingSelected();
}