From 1ede12d847468d9b5e2826df79b17dc8d906c2db Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 19:08:50 +0900 Subject: [PATCH 01/15] Add basic DrawableDrumRollTick (no graphics yet, just input). --- .../TaikoDrumRollTickJudgementInfo.cs | 21 +++++++ .../Objects/Drawable/DrawableDrumRollTick.cs | 60 +++++++++++++++++++ .../osu.Game.Modes.Taiko.csproj | 2 + 3 files changed, 83 insertions(+) create mode 100644 osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgementInfo.cs create mode 100644 osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgementInfo.cs b/osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgementInfo.cs new file mode 100644 index 0000000000..ff9c4c4512 --- /dev/null +++ b/osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgementInfo.cs @@ -0,0 +1,21 @@ +namespace osu.Game.Modes.Taiko.Judgements +{ + public class TaikoDrumRollTickJudgementInfo : TaikoJudgementInfo + { + protected override int ScoreToInt(TaikoScoreResult result) + { + switch (result) + { + default: + return 0; + case TaikoScoreResult.Great: + return 200; + } + } + + protected override int AccuracyScoreToInt(TaikoScoreResult result) + { + return 0; + } + } +} diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs new file mode 100644 index 0000000000..3bd121321b --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -0,0 +1,60 @@ +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 + { + /// + /// A list of keys which this HitObject will accept. These are the standard Taiko keys for now. + /// These should be moved to bindings later. + /// + private List validKeys = new List(new[] { Key.D, Key.F, Key.J, Key.K }); + + public DrawableDrumRollTick(DrumRollTick tick) + : base(tick) + { + } + + protected override TaikoJudgementInfo CreateJudgementInfo() => new TaikoDrumRollTickJudgementInfo(); + + protected override void CheckJudgement(bool userTriggered) + { + if (!userTriggered) + { + if (Judgement.TimeOffset > HitObject.TickTimeDistance / 2) + Judgement.Result = Modes.Objects.Drawables.HitResult.Miss; + return; + } + + if (Math.Abs(Judgement.TimeOffset) < HitObject.TickTimeDistance / 2) + { + Judgement.Result = HitResult.Hit; + Judgement.Score = TaikoScoreResult.Great; + } + } + + protected override void Update() + { + // Drum roll ticks shouldn't move + } + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + if (args.Repeat) + return false; + + if (Judgement.Result.HasValue) + return false; + + if (!validKeys.Contains(args.Key)) + return false; + + return UpdateJudgement(true); + } + } +} diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index d8cd0d4ebb..61c3d460c0 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -49,8 +49,10 @@ + + From 7860199fbda8360182d15019d41e7efb488bde74 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 19:27:06 +0900 Subject: [PATCH 02/15] Fix post-merge errors. --- .../Objects/Drawable/DrawableDrumRollTick.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs index 3bd121321b..043fe32dca 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -7,7 +7,7 @@ using osu.Framework.Input; namespace osu.Game.Modes.Taiko.Objects.Drawable { - public class DrawableDrumRollTick : DrawableTaikoHitObject + public class DrawableDrumRollTick : DrawableTaikoHitObject { /// /// A list of keys which this HitObject will accept. These are the standard Taiko keys for now. @@ -15,9 +15,12 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable /// private List validKeys = new List(new[] { Key.D, Key.F, Key.J, Key.K }); + private DrumRollTick tick; + public DrawableDrumRollTick(DrumRollTick tick) : base(tick) { + this.tick = tick; } protected override TaikoJudgementInfo CreateJudgementInfo() => new TaikoDrumRollTickJudgementInfo(); @@ -26,12 +29,12 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { if (!userTriggered) { - if (Judgement.TimeOffset > HitObject.TickTimeDistance / 2) + if (Judgement.TimeOffset > tick.TickTimeDistance / 2) Judgement.Result = Modes.Objects.Drawables.HitResult.Miss; return; } - if (Math.Abs(Judgement.TimeOffset) < HitObject.TickTimeDistance / 2) + if (Math.Abs(Judgement.TimeOffset) < tick.TickTimeDistance / 2) { Judgement.Result = HitResult.Hit; Judgement.Score = TaikoScoreResult.Great; From ecd6958eeae12a7a5a608d49ed1165a2f3a8e5b9 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 19:30:22 +0900 Subject: [PATCH 03/15] Add basic DrawableDrumRoll (no graphics yet, just input). --- .../Objects/Drawable/DrawableDrumRoll.cs | 50 +++++++++++++++++++ .../osu.Game.Modes.Taiko.csproj | 1 + 2 files changed, 51 insertions(+) create mode 100644 osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs new file mode 100644 index 0000000000..70790d2ded --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs @@ -0,0 +1,50 @@ +using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Taiko.Judgements; +using System.Linq; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + public class DrawableDrumRoll : DrawableTaikoHitObject + { + private DrumRoll drumRoll; + + public DrawableDrumRoll(DrumRoll drumRoll) + : base(drumRoll) + { + this.drumRoll = drumRoll; + + int tickIndex = 0; + foreach (var tick in drumRoll.Ticks) + { + var newTick = new DrawableDrumRollTick(tick) + { + Depth = tickIndex, + X = (float)((tick.StartTime - HitObject.StartTime) / drumRoll.Duration) + }; + + AddNested(newTick); + + tickIndex++; + } + } + + protected override void CheckJudgement(bool userTriggered) + { + if (userTriggered) + return; + + if (Judgement.TimeOffset < 0) + return; + + int countHit = NestedHitObjects.Count(o => o.Judgement.Result == HitResult.Hit); + + if (countHit > drumRoll.RequiredGoodHits) + { + Judgement.Result = HitResult.Hit; + Judgement.Score = countHit >= drumRoll.RequiredGreatHits ? TaikoScoreResult.Great : TaikoScoreResult.Good; + } + else + Judgement.Result = HitResult.Miss; + } + } +} diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index 61c3d460c0..b37bc61c17 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -52,6 +52,7 @@ + From 409160859d965c2cfe33b5d20e922f90f3bace98 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 20 Mar 2017 18:07:44 +0900 Subject: [PATCH 04/15] Remove explicit namespacing. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs index 043fe32dca..0fa63a3d33 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -30,7 +30,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable if (!userTriggered) { if (Judgement.TimeOffset > tick.TickTimeDistance / 2) - Judgement.Result = Modes.Objects.Drawables.HitResult.Miss; + Judgement.Result = HitResult.Miss; return; } From 34b734275b640f0f770468a679235e3202d08716 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 20 Mar 2017 18:24:28 +0900 Subject: [PATCH 05/15] Add license headers. --- .../Judgements/TaikoDrumRollTickJudgementInfo.cs | 5 ++++- osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs | 5 ++++- .../Objects/Drawable/DrawableDrumRollTick.cs | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgementInfo.cs b/osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgementInfo.cs index ff9c4c4512..dd43ca5cc0 100644 --- a/osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgementInfo.cs +++ b/osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgementInfo.cs @@ -1,4 +1,7 @@ -namespace osu.Game.Modes.Taiko.Judgements +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Modes.Taiko.Judgements { public class TaikoDrumRollTickJudgementInfo : TaikoJudgementInfo { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs index 70790d2ded..8dd63d8a3e 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs @@ -1,4 +1,7 @@ -using osu.Game.Modes.Objects.Drawables; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; using System.Linq; diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs index 0fa63a3d33..6bbd5482ab 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -1,4 +1,7 @@ -using OpenTK.Input; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// 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; From b3e8a2257cd90a4927b9cbc2fa43ed479008368d Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 22 Mar 2017 01:51:44 +0900 Subject: [PATCH 06/15] Fix post-merge errors. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs | 2 +- osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs index 8dd63d8a3e..7c4794ea7d 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs @@ -44,7 +44,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable if (countHit > drumRoll.RequiredGoodHits) { Judgement.Result = HitResult.Hit; - Judgement.Score = countHit >= drumRoll.RequiredGreatHits ? TaikoScoreResult.Great : TaikoScoreResult.Good; + Judgement.TaikoResult = countHit >= drumRoll.RequiredGreatHits ? TaikoHitResult.Great : TaikoHitResult.Good; } else Judgement.Result = HitResult.Miss; diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs index 6bbd5482ab..e892687d64 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -40,7 +40,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable if (Math.Abs(Judgement.TimeOffset) < tick.TickTimeDistance / 2) { Judgement.Result = HitResult.Hit; - Judgement.Score = TaikoScoreResult.Great; + Judgement.TaikoResult = TaikoHitResult.Great; } } From 90c441f614096ec3e425969a60953a9f405be4d8 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 22 Mar 2017 01:51:53 +0900 Subject: [PATCH 07/15] Override UpdateScrollPosition instead of Update. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs index e892687d64..6a5ce855b2 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -44,7 +44,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable } } - protected override void Update() + protected override void UpdateScrollPosition(double time) { // Drum roll ticks shouldn't move } From a75a2e17944f1e1c2dc68216dca18e1a59edf23c Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 22 Mar 2017 01:52:55 +0900 Subject: [PATCH 08/15] Fix more post-merge errors. --- .../Judgements/TaikoDrumRollTickJudgementInfo.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgementInfo.cs b/osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgementInfo.cs index dd43ca5cc0..530d59ca95 100644 --- a/osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgementInfo.cs +++ b/osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgementInfo.cs @@ -5,18 +5,18 @@ namespace osu.Game.Modes.Taiko.Judgements { public class TaikoDrumRollTickJudgementInfo : TaikoJudgementInfo { - protected override int ScoreToInt(TaikoScoreResult result) + protected override int NumericResultForScore(TaikoHitResult result) { switch (result) { default: return 0; - case TaikoScoreResult.Great: + case TaikoHitResult.Great: return 200; } } - protected override int AccuracyScoreToInt(TaikoScoreResult result) + protected override int NumericResultForAccuracy(TaikoHitResult result) { return 0; } From 315deb6f12cc88f62483b2283557a7b5fa50c856 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Thu, 23 Mar 2017 19:43:00 +0900 Subject: [PATCH 09/15] Fix post-merge errors. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs | 4 ++++ .../Objects/Drawable/DrawableDrumRollTick.cs | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs index 7c4794ea7d..dcbdfa270d 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs @@ -31,6 +31,10 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable } } + protected override void UpdateState(ArmedState state) + { + } + protected override void CheckJudgement(bool userTriggered) { if (userTriggered) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs index 6a5ce855b2..83d878d293 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -26,7 +26,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable this.tick = tick; } - protected override TaikoJudgementInfo CreateJudgementInfo() => new TaikoDrumRollTickJudgementInfo(); + protected override TaikoJudgement CreateJudgement() => new TaikoDrumRollTickJudgement(); protected override void CheckJudgement(bool userTriggered) { @@ -44,6 +44,10 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable } } + protected override void UpdateState(ArmedState state) + { + } + protected override void UpdateScrollPosition(double time) { // Drum roll ticks shouldn't move From 60dcf2d14d693296c90f61ef1a9fe7a42250fd9a Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Thu, 23 Mar 2017 19:43:49 +0900 Subject: [PATCH 10/15] Make readonly. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs | 2 +- osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs index dcbdfa270d..3551538fe7 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs @@ -9,7 +9,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { public class DrawableDrumRoll : DrawableTaikoHitObject { - private DrumRoll drumRoll; + private readonly DrumRoll drumRoll; public DrawableDrumRoll(DrumRoll drumRoll) : base(drumRoll) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs index 83d878d293..360cccd6ca 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -16,9 +16,9 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable /// A list of keys which this HitObject will accept. These are the standard Taiko keys for now. /// These should be moved to bindings later. /// - private List validKeys = new List(new[] { Key.D, Key.F, Key.J, Key.K }); + private readonly List validKeys = new List(new[] { Key.D, Key.F, Key.J, Key.K }); - private DrumRollTick tick; + private readonly DrumRollTick tick; public DrawableDrumRollTick(DrumRollTick tick) : base(tick) From 5bd9147661c4cace5dfa61bbf1756b3ac94307cf Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 25 Mar 2017 20:53:28 +0900 Subject: [PATCH 11/15] Remove CreateCircle() - hitobjects should handle the addition of this to their hierarchy themselves. CreateCircle() lends itself to a few issues: - It can't be used for drum roll ticks unless it returned a Container instead, at which point the method loses its meaning, and I would rather that constructed in the ctor. - Writing `return Accented ? new AccentedCirclePiece() : new CirclePiece()` in two places as the body of this method feels wrong - it's something I would expect to be taken care of in the base DrawableTaikoHitObject, but that leads back to #1. - Swells don't have an AccentedCirclePiece, so #2 becomes more problematic. --- .../Objects/Drawable/DrawableTaikoHitObject.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs index e165f40442..c77c7762e3 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs @@ -4,7 +4,6 @@ using osu.Framework.Graphics; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; namespace osu.Game.Modes.Taiko.Objects.Drawable { @@ -17,11 +16,6 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable Origin = Anchor.Centre; RelativePositionAxes = Axes.X; - - Children = new[] - { - CreateCircle() - }; } protected override void LoadComplete() @@ -48,7 +42,5 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { UpdateScrollPosition(Time.Current); } - - protected abstract CirclePiece CreateCircle(); } } From 7c9900376f952035828193e3febee6f7310b9c31 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 25 Mar 2017 23:54:50 +0900 Subject: [PATCH 12/15] Remove validKeys (now in DrawableTaikoHitObject). --- .../Objects/Drawable/DrawableDrumRollTick.cs | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs index 360cccd6ca..fe7ed855f5 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -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 { - /// - /// A list of keys which this HitObject will accept. These are the standard Taiko keys for now. - /// These should be moved to bindings later. - /// - private readonly List validKeys = new List(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); } } } From d0b1fda24f4e48cabca2febe3d4ecc09d84a5851 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Mar 2017 12:33:15 +0900 Subject: [PATCH 13/15] Fix merge fail. --- osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index 50ec2002fb..a7b382b24c 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -56,7 +56,6 @@ - @@ -103,4 +102,4 @@ --> - \ No newline at end of file + From 4bb60607e16498bc6b5527faeab2deb87c06d3ff Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 09:50:43 +0900 Subject: [PATCH 14/15] Add property to make the div2 internal. --- .../Objects/Drawable/DrawableDrumRollTick.cs | 4 ++-- osu.Game.Modes.Taiko/Objects/DrumRollTick.cs | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs index fe7ed855f5..1e270c6751 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -24,12 +24,12 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { if (!userTriggered) { - if (Judgement.TimeOffset > tick.TickTimeDistance / 2) + if (Judgement.TimeOffset > tick.HitWindow) Judgement.Result = HitResult.Miss; return; } - if (Math.Abs(Judgement.TimeOffset) < tick.TickTimeDistance / 2) + if (Math.Abs(Judgement.TimeOffset) < tick.HitWindow) { Judgement.Result = HitResult.Hit; Judgement.TaikoResult = TaikoHitResult.Great; diff --git a/osu.Game.Modes.Taiko/Objects/DrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/DrumRollTick.cs index 66a2d16fe1..2ca0d71fc1 100644 --- a/osu.Game.Modes.Taiko/Objects/DrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/DrumRollTick.cs @@ -15,5 +15,10 @@ namespace osu.Game.Modes.Taiko.Objects /// Half of this value is the hit window of the tick. /// public double TickTimeDistance; + + /// + /// The time allowed to hit this tick. + /// + public double HitWindow => TickTimeDistance / 2; } } \ No newline at end of file From ae4cabccefe7695787ad572e5bffd1de1c284eba Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 16:00:39 +0900 Subject: [PATCH 15/15] Adjust comment. --- osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs index d4abdb5ead..9bc75a55f5 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs @@ -26,6 +26,7 @@ namespace osu.Game.Modes.Taiko.UI /// /// The play field height scale. + /// This also uniformly scales the notes to match the new playfield height. /// public const float PLAYFIELD_SCALE = 0.65f;