1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-16 10:52:55 +08:00

Remove validKeys (now in DrawableTaikoHitObject).

This commit is contained in:
smoogipooo 2017-03-25 23:54:50 +09:00
parent e5c674a051
commit 7c9900376f

View File

@ -2,22 +2,14 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Input;
using System.Collections.Generic;
using osu.Game.Modes.Taiko.Judgements;
using System;
using osu.Game.Modes.Objects.Drawables;
using osu.Framework.Input;
namespace osu.Game.Modes.Taiko.Objects.Drawable
{
public class DrawableDrumRollTick : DrawableTaikoHitObject
{
/// <summary>
/// A list of keys which this HitObject will accept. These are the standard Taiko keys for now.
/// These should be moved to bindings later.
/// </summary>
private readonly List<Key> validKeys = new List<Key>(new[] { Key.D, Key.F, Key.J, Key.K });
private readonly DrumRollTick tick;
public DrawableDrumRollTick(DrumRollTick tick)
@ -53,18 +45,9 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
// Drum roll ticks shouldn't move
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
protected override bool HandleKeyPress(Key key)
{
if (args.Repeat)
return false;
if (Judgement.Result.HasValue)
return false;
if (!validKeys.Contains(args.Key))
return false;
return UpdateJudgement(true);
return !Judgement.Result.HasValue && UpdateJudgement(true);
}
}
}