1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:52:53 +08:00

Use a single sample for CarouselHeader on-hover with randomised pitch instead of multiple samples

This commit is contained in:
Jamie Taylor 2021-01-15 20:16:22 +09:00
parent d91e17542a
commit bc7f4a4f88

View File

@ -57,7 +57,7 @@ namespace osu.Game.Screens.Select.Carousel
[BackgroundDependencyLoader]
private void load(AudioManager audio, OsuColour colours)
{
sampleHover = audio.Samples.Get($@"SongSelect/song-ping-variation-{RNG.Next(1, 5)}");
sampleHover = audio.Samples.Get("SongSelect/song-ping");
hoverLayer.Colour = colours.Blue.Opacity(0.1f);
}
@ -99,7 +99,11 @@ namespace osu.Game.Screens.Select.Carousel
protected override bool OnHover(HoverEvent e)
{
sampleHover?.Play();
if (sampleHover != null)
{
sampleHover.Frequency.Value = 0.90 + RNG.NextDouble(0.2);
sampleHover.Play();
}
hoverLayer.FadeIn(100, Easing.OutQuint);
return base.OnHover(e);