From 1ede12d847468d9b5e2826df79b17dc8d906c2db Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 19:08:50 +0900 Subject: [PATCH 01/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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 0ad070c2d83101d4d820c31755f21d794f598723 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Mar 2017 22:22:34 +0900 Subject: [PATCH 14/19] Update grade textures. --- osu-resources | 2 +- osu.Game/Screens/Select/Leaderboards/DrawableRank.cs | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/osu-resources b/osu-resources index 2d8a6c1699..e674531595 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 2d8a6c1699ff1acd3915fc28e8906dabf1b145a3 +Subproject commit e67453159540f5008b5efadfbc12dfb3f4bee1f7 diff --git a/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs b/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs index 6b59af0bb4..fd8a24f213 100644 --- a/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs +++ b/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs @@ -13,14 +13,14 @@ namespace osu.Game.Screens.Select.Leaderboards { public class DrawableRank : Container { - private readonly Sprite sprite; + private readonly Sprite rankSprite; public ScoreRank Rank { get; private set; } [BackgroundDependencyLoader] private void load(TextureStore textures) { - sprite.Texture = textures.Get($@"Badges/ScoreRanks/{Rank.GetDescription()}"); + rankSprite.Texture = textures.Get($@"Grades/{Rank.GetDescription()}"); } public DrawableRank(ScoreRank rank) @@ -29,10 +29,7 @@ namespace osu.Game.Screens.Select.Leaderboards Children = new Drawable[] { - sprite = new Sprite - { - RelativeSizeAxes = Axes.Both, - }, + rankSprite = new Sprite { FillMode = FillMode.Fill }, }; } } From 4bb60607e16498bc6b5527faeab2deb87c06d3ff Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 09:50:43 +0900 Subject: [PATCH 15/19] 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 4c7e523d1870c3691cdff4c06a3f617cd5a9c294 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 10:02:41 +0900 Subject: [PATCH 16/19] Rename Accented to Strong. --- .../Tests/TestCaseTaikoHitObjects.cs | 8 ++++---- .../Beatmaps/TaikoBeatmapConverter.cs | 8 ++++---- ...DrawableAccentedHit.cs => DrawableStrongHit.cs} | 6 +++--- ...AccentedCirclePiece.cs => StrongCirclePiece.cs} | 14 +++++++------- osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs | 6 +++--- .../Scoring/TaikoScoreProcessor.cs | 8 ++++---- osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj | 4 ++-- 7 files changed, 27 insertions(+), 27 deletions(-) rename osu.Game.Modes.Taiko/Objects/Drawable/{DrawableAccentedHit.cs => DrawableStrongHit.cs} (88%) rename osu.Game.Modes.Taiko/Objects/Drawable/Pieces/{AccentedCirclePiece.cs => StrongCirclePiece.cs} (64%) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs index edd9c74485..0204058b8a 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs @@ -38,7 +38,7 @@ namespace osu.Desktop.VisualTests.Tests Position = new Vector2(100, 100) }); - Add(new CentreHitCircle(new AccentedCirclePiece() + Add(new CentreHitCircle(new StrongCirclePiece() { KiaiMode = kiai }) @@ -54,7 +54,7 @@ namespace osu.Desktop.VisualTests.Tests Position = new Vector2(100, 300) }); - Add(new RimHitCircle(new AccentedCirclePiece() + Add(new RimHitCircle(new StrongCirclePiece() { KiaiMode = kiai }) @@ -70,7 +70,7 @@ namespace osu.Desktop.VisualTests.Tests Position = new Vector2(100, 500) }); - Add(new SwellCircle(new AccentedCirclePiece() + Add(new SwellCircle(new StrongCirclePiece() { KiaiMode = kiai }) @@ -87,7 +87,7 @@ namespace osu.Desktop.VisualTests.Tests Position = new Vector2(575, 100) }); - Add(new DrumRollCircle(new AccentedCirclePiece() + Add(new DrumRollCircle(new StrongCirclePiece() { KiaiMode = kiai }) diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs index 9b143e9fde..1fc2db53fa 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -44,7 +44,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps IHasRepeats repeatsData = original as IHasRepeats; IHasEndTime endTimeData = original as IHasEndTime; - bool accented = ((original.Sample?.Type ?? SampleType.None) & SampleType.Finish) > 0; + bool strong = ((original.Sample?.Type ?? SampleType.None) & SampleType.Finish) > 0; if (distanceData != null) { @@ -52,7 +52,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps { StartTime = original.StartTime, Sample = original.Sample, - Accented = accented, + IsStrong = strong, Distance = distanceData.Distance * (repeatsData?.RepeatCount ?? 1) }; @@ -65,7 +65,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps { StartTime = original.StartTime, Sample = original.Sample, - Accented = accented, + IsStrong = strong, EndTime = original.StartTime + endTimeData.Duration * bash_convert_factor }; @@ -75,7 +75,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps { StartTime = original.StartTime, Sample = original.Sample, - Accented = accented + IsStrong = strong }; } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableAccentedHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs similarity index 88% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableAccentedHit.cs rename to osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs index 9d9c67a7f4..5e225e1dce 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableAccentedHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs @@ -8,7 +8,7 @@ using osu.Framework.Input; namespace osu.Game.Modes.Taiko.Objects.Drawable { - public abstract class DrawableAccentedHit : DrawableHit + public abstract class DrawableStrongHit : DrawableHit { /// /// The lenience for the second key press. @@ -20,7 +20,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable private bool firstKeyHeld; private Key firstHitKey; - protected DrawableAccentedHit(Hit hit) + protected DrawableStrongHit(Hit hit) : base(hit) { } @@ -71,7 +71,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable if (!HitKeys.Contains(key)) return false; - // Assume the intention was to hit the accented hit with both keys only if the first key is still being held down + // Assume the intention was to hit the strong hit with both keys only if the first key is still being held down return firstKeyHeld && UpdateJudgement(true); } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/AccentedCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/StrongCirclePiece.cs similarity index 64% rename from osu.Game.Modes.Taiko/Objects/Drawable/Pieces/AccentedCirclePiece.cs rename to osu.Game.Modes.Taiko/Objects/Drawable/Pieces/StrongCirclePiece.cs index c02cbc572a..319ca17cb8 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/AccentedCirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/StrongCirclePiece.cs @@ -6,20 +6,20 @@ using OpenTK; namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces { /// - /// A type of circle piece which is drawn at a higher scale as an "accent". + /// A type of circle piece which is drawn at a higher scale to represent a "strong" piece. /// - public class AccentedCirclePiece : CirclePiece + public class StrongCirclePiece : CirclePiece { /// - /// The amount to scale up the base circle to show it as an "accented" piece. + /// The amount to scale up the base circle to show it as a "strong" piece. /// - private const float accent_scale = 1.5f; + private const float strong_scale = 1.5f; - public AccentedCirclePiece() + public StrongCirclePiece() { - SymbolContainer.Scale = new Vector2(accent_scale); + SymbolContainer.Scale = new Vector2(strong_scale); } - public override Vector2 Size => new Vector2(base.Size.X, base.Size.Y * accent_scale); + public override Vector2 Size => new Vector2(base.Size.X, base.Size.Y * strong_scale); } } diff --git a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs index 0ec1c2b93c..28077db1ba 100644 --- a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs +++ b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs @@ -20,10 +20,10 @@ namespace osu.Game.Modes.Taiko.Objects public double PreEmpt; /// - /// Whether this HitObject is accented. - /// Accented hit objects give more points for hitting the hit object with both keys. + /// Whether this HitObject is a "strong" type. + /// Strong hit objects give more points for hitting the hit object with both keys. /// - public bool Accented; + public bool IsStrong; /// /// Whether this HitObject is in Kiai time. diff --git a/osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs index a3759d9c81..2ab31c5efb 100644 --- a/osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs @@ -128,7 +128,7 @@ namespace osu.Game.Modes.Taiko.Scoring hpIncreaseGood = hpMultiplierNormal * hp_hit_good; hpIncreaseMiss = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.Difficulty.DrainRate, hp_miss_min, hp_miss_mid, hp_miss_max); - var accentedHits = beatmap.HitObjects.FindAll(o => o is Hit && o.Accented); + var accentedHits = beatmap.HitObjects.FindAll(o => o is Hit && o.IsStrong); // This is a linear function that awards: // 10 times bonus points for hitting an accented hit object with both keys with 30 accented hit objects in the map @@ -143,7 +143,7 @@ namespace osu.Game.Modes.Taiko.Scoring { Result = HitResult.Hit, TaikoResult = TaikoHitResult.Great, - SecondHit = obj.Accented + SecondHit = obj.IsStrong }); } else if (obj is DrumRoll) @@ -154,7 +154,7 @@ namespace osu.Game.Modes.Taiko.Scoring { Result = HitResult.Hit, TaikoResult = TaikoHitResult.Great, - SecondHit = obj.Accented + SecondHit = obj.IsStrong }); } @@ -162,7 +162,7 @@ namespace osu.Game.Modes.Taiko.Scoring { Result = HitResult.Hit, TaikoResult = TaikoHitResult.Great, - SecondHit = obj.Accented + SecondHit = obj.IsStrong }); } else if (obj is Swell) diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index b32288c2d9..fa09ae2c82 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -53,8 +53,8 @@ - - + + From 542cff0976fdbc5e0a8e8d9edcc2ada87599bd25 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 10:32:01 +0900 Subject: [PATCH 17/19] Move consts to CirclePiece. --- osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs index 453ab7a05d..ec98feddae 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs @@ -20,6 +20,10 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces /// public class CirclePiece : Container { + public const float SYMBOL_SIZE = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f; + public const float SYMBOL_BORDER = 8; + public const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER; + private Color4 accentColour; /// /// The colour of the inner circle and outer glows. From 2211c084416802a9b98af717a0e356de3170cb2d Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 10:32:27 +0900 Subject: [PATCH 18/19] Properly set playfield scale. --- 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 b7fac507d6..d4abdb5ead 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs @@ -173,6 +173,7 @@ namespace osu.Game.Modes.Taiko.UI public override void Add(DrawableHitObject h) { h.Depth = (float)h.HitObject.StartTime; + h.Scale = new Vector2(PLAYFIELD_SCALE); base.Add(h); } From ae4cabccefe7695787ad572e5bffd1de1c284eba Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 16:00:39 +0900 Subject: [PATCH 19/19] 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;