1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00

Added if to ignore more (for our purposes) useless keydowns

This commit is contained in:
FreezyLemon 2017-11-29 06:51:00 +01:00
parent c00fb47236
commit e3232dd754

View File

@ -106,16 +106,20 @@ namespace osu.Game.Rulesets.Taiko.UI
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{ {
var sampleBank = Beatmap.ControlPointInfo.SoundPointAt(WorkingBeatmap.Track.CurrentTime).SampleBank ?? "normal"; if (!args.Repeat)
string sampleName = ""; {
var sampleBank = Beatmap.ControlPointInfo.SoundPointAt(WorkingBeatmap.Track.CurrentTime).SampleBank ?? "normal";
string sampleName = "";
if (centreKeys.Contains(args.Key)) if (centreKeys.Contains(args.Key))
sampleName = "hitnormal"; sampleName = "hitnormal";
else if (rimKeys.Contains(args.Key)) else if (rimKeys.Contains(args.Key))
sampleName = "hitclap"; sampleName = "hitclap";
audio.Sample.Get($"Gameplay/{sampleBank}-{sampleName}")?.Play();
}
audio.Sample.Get($"Gameplay/{sampleBank}-{sampleName}")?.Play();
return base.OnKeyDown(state, args); return base.OnKeyDown(state, args);
} }