mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add audio feedback to song select 'random'
This commit is contained in:
@ -100,6 +100,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private Sample sampleChangeDifficulty;
|
||||
private Sample sampleChangeBeatmap;
|
||||
private Sample sampleRandomBeatmap;
|
||||
|
||||
private Container carouselContainer;
|
||||
|
||||
@ -109,6 +110,8 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private double audioFeedbackLastPlaybackTime;
|
||||
|
||||
private bool randomClicked;
|
||||
|
||||
[Resolved]
|
||||
private MusicController music { get; set; }
|
||||
|
||||
@ -288,6 +291,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
sampleChangeDifficulty = audio.Samples.Get(@"SongSelect/select-difficulty");
|
||||
sampleChangeBeatmap = audio.Samples.Get(@"SongSelect/select-expand");
|
||||
sampleRandomBeatmap = audio.Samples.Get(@"SongSelect/select-random");
|
||||
SampleConfirm = audio.Samples.Get(@"SongSelect/confirm-selection");
|
||||
|
||||
if (dialogOverlay != null)
|
||||
@ -315,8 +319,16 @@ namespace osu.Game.Screens.Select
|
||||
(new FooterButtonMods { Current = Mods }, ModSelect),
|
||||
(new FooterButtonRandom
|
||||
{
|
||||
NextRandom = () => Carousel.SelectNextRandom(),
|
||||
PreviousRandom = Carousel.SelectPreviousRandom
|
||||
NextRandom = () =>
|
||||
{
|
||||
randomClicked = true;
|
||||
Carousel.SelectNextRandom();
|
||||
},
|
||||
PreviousRandom = () =>
|
||||
{
|
||||
randomClicked = true;
|
||||
Carousel.SelectPreviousRandom();
|
||||
}
|
||||
}, null),
|
||||
(new FooterButtonOptions(), BeatmapOptions)
|
||||
};
|
||||
@ -486,7 +498,9 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
if (beatmap != null && beatmapInfoPrevious != null && Time.Current - audioFeedbackLastPlaybackTime >= 50)
|
||||
{
|
||||
if (beatmap.BeatmapSet?.ID == beatmapInfoPrevious.BeatmapSet?.ID)
|
||||
if (randomClicked)
|
||||
sampleRandomBeatmap.Play();
|
||||
else if (beatmap.BeatmapSet?.ID == beatmapInfoPrevious.BeatmapSet?.ID)
|
||||
sampleChangeDifficulty.Play();
|
||||
else
|
||||
sampleChangeBeatmap.Play();
|
||||
@ -494,6 +508,7 @@ namespace osu.Game.Screens.Select
|
||||
audioFeedbackLastPlaybackTime = Time.Current;
|
||||
}
|
||||
|
||||
randomClicked = false;
|
||||
beatmapInfoPrevious = beatmap;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user