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

Add confirm-selection sound in song select

This commit is contained in:
Dean Herbert 2017-11-26 03:30:05 +09:00
parent c5aacb75c6
commit 5aa6615107
2 changed files with 10 additions and 2 deletions

View File

@ -4,6 +4,8 @@
using System.Linq;
using OpenTK.Input;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input;
@ -42,9 +44,13 @@ namespace osu.Game.Screens.Select
beatmapDetails.Leaderboard.ScoreSelected += s => Push(new Results(s));
}
private SampleChannel sampleConfirm;
[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load(OsuColour colours, AudioManager audio)
{
sampleConfirm = audio.Sample.Get($@"SongSelect/confirm-selection");
Footer.AddButton(@"mods", colours.Yellow, modSelect, Key.F1, float.MaxValue);
BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, colours.Purple, null, Key.Number1);
@ -128,6 +134,8 @@ namespace osu.Game.Screens.Select
Beatmap.Value.Track.Looping = false;
Beatmap.Disabled = true;
sampleConfirm?.Play();
LoadComponentAsync(player = new PlayerLoader(new Player()), l => Push(player));
}
}

View File

@ -335,7 +335,7 @@ namespace osu.Game.Screens.Select
logo.Action = () =>
{
carouselRaisedStart();
return true;
return false;
};
}