mirror of
https://github.com/ppy/osu.git
synced 2025-02-05 21:23:22 +08:00
Remove validKeys (now in DrawableTaikoHitObject).
This commit is contained in:
parent
e5c674a051
commit
7c9900376f
@ -2,22 +2,14 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using System.Collections.Generic;
|
|
||||||
using osu.Game.Modes.Taiko.Judgements;
|
using osu.Game.Modes.Taiko.Judgements;
|
||||||
using System;
|
using System;
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
using osu.Framework.Input;
|
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
namespace osu.Game.Modes.Taiko.Objects.Drawable
|
||||||
{
|
{
|
||||||
public class DrawableDrumRollTick : DrawableTaikoHitObject
|
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;
|
private readonly DrumRollTick tick;
|
||||||
|
|
||||||
public DrawableDrumRollTick(DrumRollTick tick)
|
public DrawableDrumRollTick(DrumRollTick tick)
|
||||||
@ -53,18 +45,9 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
|
|||||||
// Drum roll ticks shouldn't move
|
// Drum roll ticks shouldn't move
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
protected override bool HandleKeyPress(Key key)
|
||||||
{
|
{
|
||||||
if (args.Repeat)
|
return !Judgement.Result.HasValue && UpdateJudgement(true);
|
||||||
return false;
|
|
||||||
|
|
||||||
if (Judgement.Result.HasValue)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!validKeys.Contains(args.Key))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return UpdateJudgement(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user