Fix playfield display

This commit is contained in:
smoogipoo
2018-08-03 16:46:03 +09:00
parent b778a8d207
commit e6775c7a16
5 changed files with 40 additions and 41 deletions

View File

@ -7,20 +7,17 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
public class DrawableStrongDrumRoll : DrawableStrongHitObject
{
private readonly DrawableDrumRoll drumRoll;
public DrawableStrongDrumRoll(StrongHitObject strong, DrawableDrumRoll drumRoll)
: base(strong)
: base(strong, drumRoll)
{
this.drumRoll = drumRoll;
}
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
{
if (!drumRoll.Judged)
if (!MainObject.Judged)
return;
ApplyResult(r => r.Type = drumRoll.IsHit ? HitResult.Great : HitResult.Miss);
ApplyResult(r => r.Type = MainObject.IsHit ? HitResult.Great : HitResult.Miss);
}
public override bool OnPressed(TaikoAction action) => false;

View File

@ -7,20 +7,17 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
public class DrawableStrongDrumRollTick : DrawableStrongHitObject
{
private readonly DrawableDrumRollTick tick;
public DrawableStrongDrumRollTick(StrongHitObject strong, DrawableDrumRollTick tick)
: base(strong)
: base(strong, tick)
{
this.tick = tick;
}
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
{
if (!tick.Judged)
if (!MainObject.Judged)
return;
ApplyResult(r => r.Type = tick.IsHit ? HitResult.Great : HitResult.Miss);
ApplyResult(r => r.Type = MainObject.IsHit ? HitResult.Great : HitResult.Miss);
}
public override bool OnPressed(TaikoAction action) => false;

View File

@ -15,23 +15,22 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
/// </summary>
private const double second_hit_window = 30;
private readonly DrawableHit hit;
public DrawableHit MainObject => (DrawableHit)base.MainObject;
public DrawableStrongHit(StrongHitObject strong, DrawableHit hit)
: base(strong)
: base(strong, hit)
{
this.hit = hit;
}
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
{
if (!hit.Result.HasResult)
if (!MainObject.Result.HasResult)
{
base.CheckForJudgements(userTriggered, timeOffset);
return;
}
if (!hit.Result.IsHit)
if (!MainObject.Result.IsHit)
{
ApplyResult(r => r.Type = HitResult.Miss);
return;
@ -44,22 +43,22 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
return;
}
if (Math.Abs(hit.Result.TimeOffset - timeOffset) < second_hit_window)
if (Math.Abs(MainObject.Result.TimeOffset - timeOffset) < second_hit_window)
ApplyResult(r => r.Type = HitResult.Great);
}
public override bool OnPressed(TaikoAction action)
{
// Don't process actions until the main hitobject is hit
if (!hit.IsHit)
if (!MainObject.IsHit)
return false;
// Don't process actions if the pressed button was released
if (hit.HitAction == null)
if (MainObject.HitAction == null)
return false;
// Don't handle invalid hit action presses
if (!hit.HitActions.Contains(action))
if (!MainObject.HitActions.Contains(action))
return false;
return UpdateJudgement(true);

View File

@ -7,9 +7,13 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
public abstract class DrawableStrongHitObject : DrawableTaikoHitObject
{
protected DrawableStrongHitObject(StrongHitObject strong)
public readonly DrawableHitObject MainObject;
protected DrawableStrongHitObject(StrongHitObject strong, DrawableHitObject mainObject)
: base(strong)
{
MainObject = mainObject;
AlwaysPresent = true;
}