1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 00:47:24 +08:00

Use alternate sample on the downbeat while hovering OsuLogo

This commit is contained in:
Jamie Taylor 2021-02-10 18:14:32 +09:00
parent d91e17542a
commit 996f1098f6

View File

@ -45,6 +45,7 @@ namespace osu.Game.Screens.Menu
private SampleChannel sampleClick;
private SampleChannel sampleBeat;
private SampleChannel sampleDownbeat;
private readonly Container colourAndTriangles;
private readonly Triangles triangles;
@ -259,6 +260,7 @@ namespace osu.Game.Screens.Menu
{
sampleClick = audio.Samples.Get(@"Menu/osu-logo-select");
sampleBeat = audio.Samples.Get(@"Menu/osu-logo-heartbeat");
sampleDownbeat = audio.Samples.Get(@"Menu/osu-logo-downbeat");
logo.Texture = textures.Get(@"Menu/logo");
ripple.Texture = textures.Get(@"Menu/logo");
@ -281,7 +283,15 @@ namespace osu.Game.Screens.Menu
if (beatIndex < 0) return;
if (IsHovered)
this.Delay(early_activation).Schedule(() => sampleBeat.Play());
{
this.Delay(early_activation).Schedule(() =>
{
if (beatIndex % (int)timingPoint.TimeSignature == 0)
sampleDownbeat.Play();
else
sampleBeat.Play();
});
}
logoBeatContainer
.ScaleTo(1 - 0.02f * amplitudeAdjust, early_activation, Easing.Out).Then()