Also support taiko drum

This commit is contained in:
Dean Herbert 2020-05-21 10:59:30 +09:00
parent ce223a2bd8
commit c0e68f9854
1 changed files with 8 additions and 2 deletions

View File

@ -12,6 +12,7 @@
using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Rulesets.Taiko.Audio; using osu.Game.Rulesets.Taiko.Audio;
using osu.Game.Screens.Play;
using osu.Game.Skinning; using osu.Game.Skinning;
namespace osu.Game.Rulesets.Taiko.UI namespace osu.Game.Rulesets.Taiko.UI
@ -145,6 +146,9 @@ private void load(TextureStore textures, OsuColour colours)
centreHit.Colour = colours.Pink; centreHit.Colour = colours.Pink;
} }
[Resolved(canBeNull: true)]
private GameplayClock gameplayClock { get; set; }
public bool OnPressed(TaikoAction action) public bool OnPressed(TaikoAction action)
{ {
Drawable target = null; Drawable target = null;
@ -157,14 +161,16 @@ public bool OnPressed(TaikoAction action)
target = centreHit; target = centreHit;
back = centre; back = centre;
drumSample.Centre?.Play(); if (gameplayClock?.IsSeeking != true)
drumSample.Centre?.Play();
} }
else if (action == RimAction) else if (action == RimAction)
{ {
target = rimHit; target = rimHit;
back = rim; back = rim;
drumSample.Rim?.Play(); if (gameplayClock?.IsSeeking != true)
drumSample.Rim?.Play();
} }
if (target != null) if (target != null)