1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 20:53:00 +08:00

Merge pull request #17829 from nekodex/sfx-tweaks

UI SFX Tweaks
This commit is contained in:
Dean Herbert 2022-04-15 22:08:43 +09:00 committed by GitHub
commit 987e931baa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -185,8 +185,7 @@ namespace osu.Game.Screens.Menu
private void load(AudioManager audio) private void load(AudioManager audio)
{ {
sampleHover = audio.Samples.Get(@"Menu/button-hover"); sampleHover = audio.Samples.Get(@"Menu/button-hover");
if (!string.IsNullOrEmpty(sampleName)) sampleClick = audio.Samples.Get(!string.IsNullOrEmpty(sampleName) ? $@"Menu/{sampleName}" : @"UI/button-select");
sampleClick = audio.Samples.Get($@"Menu/{sampleName}");
} }
protected override bool OnMouseDown(MouseDownEvent e) protected override bool OnMouseDown(MouseDownEvent e)

View File

@ -283,9 +283,15 @@ namespace osu.Game.Screens.Menu
this.Delay(early_activation).Schedule(() => this.Delay(early_activation).Schedule(() =>
{ {
if (beatIndex % timingPoint.TimeSignature.Numerator == 0) if (beatIndex % timingPoint.TimeSignature.Numerator == 0)
sampleDownbeat.Play(); {
sampleDownbeat?.Play();
}
else else
sampleBeat.Play(); {
var channel = sampleBeat.GetChannel();
channel.Frequency.Value = 0.95 + RNG.NextDouble(0.1);
channel.Play();
}
}); });
} }