From f26cf7bf68599f2ea84c8b020df832c6a5a8c694 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 16:55:57 +0900 Subject: [PATCH 01/49] Add basic DrawableHit (no graphics yet, just input). --- .../Objects/Drawable/DrawableHit.cs | 82 +++++++++++++++++++ .../osu.Game.Modes.Taiko.csproj | 1 + 2 files changed, 83 insertions(+) create mode 100644 osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs new file mode 100644 index 0000000000..caf4fee335 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs @@ -0,0 +1,82 @@ +using OpenTK.Input; +using osu.Framework.Input; +using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Taiko.Judgements; +using System; +using System.Collections.Generic; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + public abstract class DrawableHit : DrawableTaikoHitObject + { + /// + /// A list of keys which can result in hits for this HitObject. + /// + protected abstract List HitKeys { get; } + + /// + /// A list of keys which this hit object 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 }); + + /// + /// Whether the last key pressed is a valid hit key. + /// + private bool validKeyPressed; + + protected DrawableHit(TaikoHitObject hitObject) + : base(hitObject) + { + } + + protected override void CheckJudgement(bool userTriggered) + { + if (!userTriggered) + { + if (Judgement.TimeOffset > HitObject.HitWindowGood) + Judgement.Result = HitResult.Miss; + return; + } + + double hitOffset = Math.Abs(Judgement.TimeOffset); + + if (hitOffset > HitObject.HitWindowMiss) + return; + + if (!validKeyPressed) + Judgement.Result = HitResult.Miss; + else if (hitOffset < HitObject.HitWindowGood) + { + Judgement.Result = HitResult.Hit; + Judgement.Score = hitOffset < HitObject.HitWindowGreat ? TaikoScoreResult.Great : TaikoScoreResult.Good; + } + else + Judgement.Result = HitResult.Miss; + } + + protected virtual bool HandleKeyPress(Key key) + { + if (Judgement.Result.HasValue) + return false; + + validKeyPressed = HitKeys.Contains(key); + + return UpdateJudgement(true); + } + + protected sealed override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + // Make sure we don't handle held-down keys + if (args.Repeat) + return false; + + // Check if we've pressed a valid taiko key + if (!validKeys.Contains(args.Key)) + return false; + + // Handle it! + return HandleKeyPress(args.Key); + } + } +} diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index aab9a17276..dbd58d4666 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -50,6 +50,7 @@ + From 863d4959af1f4c7153b2c4f4763446cfc7aea845 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 17:38:24 +0900 Subject: [PATCH 02/49] Make OnKeyDown non-sealed. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs index caf4fee335..46cf9e5f87 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs @@ -65,7 +65,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable return UpdateJudgement(true); } - protected sealed override bool OnKeyDown(InputState state, KeyDownEventArgs args) + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { // Make sure we don't handle held-down keys if (args.Repeat) From 1892d869215b5a525e734adc220a8e69b0672bf6 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 17:38:49 +0900 Subject: [PATCH 03/49] Add basic DrawableHitFinisher (no graphics yet, just input). --- .../Objects/Drawable/DrawableHitFinisher.cs | 80 +++++++++++++++++++ .../osu.Game.Modes.Taiko.csproj | 1 + 2 files changed, 81 insertions(+) create mode 100644 osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs new file mode 100644 index 0000000000..22fc83874b --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs @@ -0,0 +1,80 @@ +using OpenTK.Input; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using osu.Framework.Input; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + public abstract class DrawableHitFinisher : DrawableHit + { + /// + /// The lenience for the second key press. + /// This does not adjust by map difficulty in ScoreV2 yet. + /// + private const double second_hit_window = 30; + + private double firstHitTime; + private Key firstHitKey; + + protected DrawableHitFinisher(TaikoHitObject hitObject) + : base(hitObject) + { + } + + protected override void CheckJudgement(bool userTriggered) + { + if (!Judgement.Result.HasValue) + { + base.CheckJudgement(userTriggered); + return; + } + + if (!userTriggered) + return; + + // If we get here, we're assured that the key pressed is the correct secondary key + + if (Math.Abs(firstHitTime - Time.Current) < second_hit_window) + Judgement.SecondHit = true; + } + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + // Check if we've handled the initial key + if (!Judgement.Result.HasValue) + { + bool result = base.OnKeyDown(state, args); + + if (result) + { + firstHitTime = Time.Current; + firstHitKey = args.Key; + } + + return result; + } + + // If we've already hit the second key, don't handle this object any further + if (Judgement.SecondHit) + return false; + + // Don't handle represses of the same key + if (firstHitKey == args.Key) + return false; + + // Don't handle invalid hit key presses + if (!HitKeys.Contains(args.Key)) + return false; + + // If we're not holding the first key down still, assume the intention + // was not to hit the finisher with both keys simultaneously + if (!state.Keyboard.Keys.Contains(firstHitKey)) + 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 3a79d721c6..5b8a1fd2b8 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 891bd011c6fe86e9d7380544470b64c32de2ffa7 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 18:54:44 +0900 Subject: [PATCH 04/49] Add basic DrawableBash (no graphics yet, just input). --- .../Objects/Drawable/DrawableBash.cs | 79 +++++++++++++++++++ .../osu.Game.Modes.Taiko.csproj | 1 + 2 files changed, 80 insertions(+) create mode 100644 osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs new file mode 100644 index 0000000000..b69546e1aa --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs @@ -0,0 +1,79 @@ +// 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.Framework.Input; +using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Taiko.Judgements; +using System; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + public class DrawableBash : 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 { get; } = new List(new[] { Key.D, Key.F, Key.J, Key.K }); + + /// + /// The amount of times the user has hit this bash. + /// + private int userHits; + + public DrawableBash(TaikoHitObject hitObject) + : base(hitObject) + { + } + + protected override void CheckJudgement(bool userTriggered) + { + if (userTriggered) + { + if (Time.Current < HitObject.StartTime) + return; + + userHits++; + + if (userHits == HitObject.RequiredHits) + { + Judgement.Result = HitResult.Hit; + Judgement.Score = TaikoScoreResult.Great; + } + } + else + { + if (Judgement.TimeOffset < 0) + return; + + if (userHits > HitObject.RequiredHits / 2) + { + Judgement.Result = HitResult.Hit; + Judgement.Score = TaikoScoreResult.Good; + } + else + Judgement.Result = HitResult.Miss; + } + } + + protected override void Update() + { + UpdateScrollPosition(Math.Min(Time.Current, HitObject.StartTime)); + } + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + if (Judgement.Result.HasValue) + return false; + + if (!validKeys.Contains(args.Key)) + return false; + + UpdateJudgement(true); + + return true; + } + } +} diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index bdc8edb62e..73963a828c 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -51,6 +51,7 @@ + From 938da01540c5b836baadb8fd06efae3c070d7859 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 18:56:58 +0900 Subject: [PATCH 05/49] Fix post-merge errors. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs index 46cf9e5f87..dc5d846ebc 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs @@ -7,7 +7,7 @@ using System.Collections.Generic; namespace osu.Game.Modes.Taiko.Objects.Drawable { - public abstract class DrawableHit : DrawableTaikoHitObject + public abstract class DrawableHit : DrawableTaikoHitObject { /// /// A list of keys which can result in hits for this HitObject. From a2d07acb4b6089d67852b00d2cb28c6c27439c16 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 18:59:21 +0900 Subject: [PATCH 06/49] Fix post-merge errors. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs index b69546e1aa..4e848c76c3 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs @@ -10,7 +10,7 @@ using System; namespace osu.Game.Modes.Taiko.Objects.Drawable { - public class DrawableBash : DrawableTaikoHitObject + public class DrawableBash : DrawableTaikoHitObject { /// /// A list of keys which this HitObject will accept. These are the standard Taiko keys for now. @@ -23,8 +23,8 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable /// private int userHits; - public DrawableBash(TaikoHitObject hitObject) - : base(hitObject) + public DrawableBash(Bash bash) + : base(bash) { } From 1ede12d847468d9b5e2826df79b17dc8d906c2db Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 19:08:50 +0900 Subject: [PATCH 07/49] 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 ad396c65ee6e9c6774d15e5bc4abdb52394c1375 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 19:24:39 +0900 Subject: [PATCH 08/49] Fix post-merge errors. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs index dc5d846ebc..46cf9e5f87 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs @@ -7,7 +7,7 @@ using System.Collections.Generic; namespace osu.Game.Modes.Taiko.Objects.Drawable { - public abstract class DrawableHit : DrawableTaikoHitObject + public abstract class DrawableHit : DrawableTaikoHitObject { /// /// A list of keys which can result in hits for this HitObject. From e3afa9bf715603a6ecd5f8e5decf82ea2507eab0 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 19:25:55 +0900 Subject: [PATCH 09/49] Fix post-merge errors. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs index 4e848c76c3..00abd3017d 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs @@ -10,7 +10,7 @@ using System; namespace osu.Game.Modes.Taiko.Objects.Drawable { - public class DrawableBash : DrawableTaikoHitObject + public class DrawableBash : DrawableTaikoHitObject { /// /// A list of keys which this HitObject will accept. These are the standard Taiko keys for now. @@ -23,9 +23,12 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable /// private int userHits; + private Bash bash; + public DrawableBash(Bash bash) : base(bash) { + this.bash = bash; } protected override void CheckJudgement(bool userTriggered) @@ -37,7 +40,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable userHits++; - if (userHits == HitObject.RequiredHits) + if (userHits == bash.RequiredHits) { Judgement.Result = HitResult.Hit; Judgement.Score = TaikoScoreResult.Great; @@ -48,7 +51,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable if (Judgement.TimeOffset < 0) return; - if (userHits > HitObject.RequiredHits / 2) + if (userHits > bash.RequiredHits / 2) { Judgement.Result = HitResult.Hit; Judgement.Score = TaikoScoreResult.Good; From 7860199fbda8360182d15019d41e7efb488bde74 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 19:27:06 +0900 Subject: [PATCH 10/49] 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 11/49] 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 12/49] 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 75d09e7038c4b42cfe70bc25ff0fabbc27bfb153 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 20 Mar 2017 18:18:25 +0900 Subject: [PATCH 13/49] Fix unused usings. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs index 22fc83874b..2e5281839a 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs @@ -1,9 +1,6 @@ using OpenTK.Input; using System; -using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using osu.Framework.Input; namespace osu.Game.Modes.Taiko.Objects.Drawable From 34b734275b640f0f770468a679235e3202d08716 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 20 Mar 2017 18:24:28 +0900 Subject: [PATCH 14/49] 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 ed9c7c800877187bb0cde71aea922b904b0c4a7b Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 20 Mar 2017 18:25:12 +0900 Subject: [PATCH 15/49] Add license headers. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs | 5 ++++- osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs index 46cf9e5f87..483f6a31d5 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.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 osu.Framework.Input; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs index 2e5281839a..c72b520cc4 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.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; using System.Linq; using osu.Framework.Input; From e4926d54ab735cbe24e5f640644aae6282a0d4be Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 22 Mar 2017 01:48:51 +0900 Subject: [PATCH 16/49] Fix post-merge errors. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs index 483f6a31d5..4f3e06cd6d 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs @@ -52,7 +52,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable else if (hitOffset < HitObject.HitWindowGood) { Judgement.Result = HitResult.Hit; - Judgement.Score = hitOffset < HitObject.HitWindowGreat ? TaikoScoreResult.Great : TaikoScoreResult.Good; + Judgement.TaikoResult = hitOffset < HitObject.HitWindowGreat ? TaikoHitResult.Great : TaikoHitResult.Good; } else Judgement.Result = HitResult.Miss; From b3e8a2257cd90a4927b9cbc2fa43ed479008368d Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 22 Mar 2017 01:51:44 +0900 Subject: [PATCH 17/49] 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 18/49] 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 19/49] 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 1532ae78a4801cc1563c458a1f2f31b6beed0d5b Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 22 Mar 2017 01:55:31 +0900 Subject: [PATCH 20/49] Fix post-merge errors. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs index 00abd3017d..5b3b31f74e 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs @@ -43,7 +43,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable if (userHits == bash.RequiredHits) { Judgement.Result = HitResult.Hit; - Judgement.Score = TaikoScoreResult.Great; + Judgement.TaikoResult = TaikoHitResult.Great; } } else @@ -54,7 +54,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable if (userHits > bash.RequiredHits / 2) { Judgement.Result = HitResult.Hit; - Judgement.Score = TaikoScoreResult.Good; + Judgement.TaikoResult = TaikoHitResult.Good; } else Judgement.Result = HitResult.Miss; From a72ae319a1f3a07c8aa91f240bba8f26fcd11e50 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 22 Mar 2017 01:55:41 +0900 Subject: [PATCH 21/49] Override UpdateScrollPosition instead of Update. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs index 5b3b31f74e..41433fc61c 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs @@ -61,9 +61,9 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable } } - protected override void Update() + protected override void UpdateScrollPosition(double time) { - UpdateScrollPosition(Math.Min(Time.Current, HitObject.StartTime)); + base.UpdateScrollPosition(Math.Min(time, HitObject.StartTime)); } protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) From 315deb6f12cc88f62483b2283557a7b5fa50c856 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Thu, 23 Mar 2017 19:43:00 +0900 Subject: [PATCH 22/49] 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 23/49] 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 93029aec3ef4dbaefeda922a8c3b788527062d17 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 24 Mar 2017 13:58:45 +0900 Subject: [PATCH 24/49] Change accessibilities to make replays more extensible. --- osu.Game.Modes.Osu/OsuAutoReplay.cs | 2 +- osu.Game/Modes/LegacyReplay.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game.Modes.Osu/OsuAutoReplay.cs b/osu.Game.Modes.Osu/OsuAutoReplay.cs index 61b7466d86..b3fece2b84 100644 --- a/osu.Game.Modes.Osu/OsuAutoReplay.cs +++ b/osu.Game.Modes.Osu/OsuAutoReplay.cs @@ -29,7 +29,7 @@ namespace osu.Game.Modes.Osu createAutoReplay(); } - internal class LegacyReplayFrameComparer : IComparer + private class LegacyReplayFrameComparer : IComparer { public int Compare(LegacyReplayFrame f1, LegacyReplayFrame f2) { diff --git a/osu.Game/Modes/LegacyReplay.cs b/osu.Game/Modes/LegacyReplay.cs index 4b77550cbc..cd777ff434 100644 --- a/osu.Game/Modes/LegacyReplay.cs +++ b/osu.Game/Modes/LegacyReplay.cs @@ -52,7 +52,7 @@ namespace osu.Game.Modes /// The ReplayHandler will take a replay and handle the propagation of updates to the input stack. /// It handles logic of any frames which *must* be executed. /// - public class LegacyReplayInputHandler : ReplayInputHandler + protected class LegacyReplayInputHandler : ReplayInputHandler { private readonly List replayContent; @@ -163,7 +163,7 @@ namespace osu.Game.Modes return currentTime = time; } - private class ReplayMouseState : MouseState + protected class ReplayMouseState : MouseState { public ReplayMouseState(Vector2 position, IEnumerable list) { @@ -172,7 +172,7 @@ namespace osu.Game.Modes } } - private class ReplayKeyboardState : KeyboardState + protected class ReplayKeyboardState : KeyboardState { public ReplayKeyboardState(List keys) { @@ -182,7 +182,7 @@ namespace osu.Game.Modes } [Flags] - public enum LegacyButtonState + protected enum LegacyButtonState { None = 0, Left1 = 1, @@ -192,7 +192,7 @@ namespace osu.Game.Modes Smoke = 16 } - public class LegacyReplayFrame + protected class LegacyReplayFrame { public Vector2 Position => new Vector2(MouseX, MouseY); From b225ae82beadbf3d6fb0ff304f5db9b084af6493 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 24 Mar 2017 13:59:05 +0900 Subject: [PATCH 25/49] GetInputHandler -> CreateInputHandler. --- osu.Game/Modes/LegacyReplay.cs | 2 +- osu.Game/Modes/Mods/Mod.cs | 2 +- osu.Game/Modes/Replay.cs | 2 +- osu.Game/OsuGame.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Modes/LegacyReplay.cs b/osu.Game/Modes/LegacyReplay.cs index cd777ff434..d57d4a15d2 100644 --- a/osu.Game/Modes/LegacyReplay.cs +++ b/osu.Game/Modes/LegacyReplay.cs @@ -46,7 +46,7 @@ namespace osu.Game.Modes } } - public override ReplayInputHandler GetInputHandler() => new LegacyReplayInputHandler(Frames); + public override ReplayInputHandler CreateInputHandler() => new LegacyReplayInputHandler(Frames); /// /// The ReplayHandler will take a replay and handle the propagation of updates to the input stack. diff --git a/osu.Game/Modes/Mods/Mod.cs b/osu.Game/Modes/Mods/Mod.cs index 8416ae6211..c53c6faa21 100644 --- a/osu.Game/Modes/Mods/Mod.cs +++ b/osu.Game/Modes/Mods/Mod.cs @@ -157,7 +157,7 @@ namespace osu.Game.Modes.Mods public void Apply(HitRenderer hitRenderer) { - hitRenderer.InputManager.ReplayInputHandler = CreateReplayScore(hitRenderer.Beatmap)?.Replay?.GetInputHandler(); + hitRenderer.InputManager.ReplayInputHandler = CreateReplayScore(hitRenderer.Beatmap)?.Replay?.CreateInputHandler(); } } diff --git a/osu.Game/Modes/Replay.cs b/osu.Game/Modes/Replay.cs index 0a41a12335..6d93afdeb9 100644 --- a/osu.Game/Modes/Replay.cs +++ b/osu.Game/Modes/Replay.cs @@ -7,6 +7,6 @@ namespace osu.Game.Modes { public abstract class Replay { - public virtual ReplayInputHandler GetInputHandler() => null; + public virtual ReplayInputHandler CreateInputHandler() => null; } } \ No newline at end of file diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 8ac809e591..e6abdab729 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -126,7 +126,7 @@ namespace osu.Game Beatmap.Value = BeatmapDatabase.GetWorkingBeatmap(s.Beatmap); - menu.Push(new PlayerLoader(new Player { ReplayInputHandler = s.Replay.GetInputHandler() })); + menu.Push(new PlayerLoader(new Player { ReplayInputHandler = s.Replay.CreateInputHandler() })); } protected override void LoadComplete() From 136665e52e16304c51539602dce1c148ec56535a Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 24 Mar 2017 14:03:46 +0900 Subject: [PATCH 26/49] Add virtual method to instantiate legacy replays. --- osu.Game/Database/ScoreDatabase.cs | 2 +- osu.Game/Modes/Scoring/Score.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Database/ScoreDatabase.cs b/osu.Game/Database/ScoreDatabase.cs index 665ae8649e..096c0dcc29 100644 --- a/osu.Game/Database/ScoreDatabase.cs +++ b/osu.Game/Database/ScoreDatabase.cs @@ -101,7 +101,7 @@ namespace osu.Game.Database using (var lzma = new LzmaStream(properties, replayInStream, compressedSize, outSize)) using (var reader = new StreamReader(lzma)) - score.Replay = new LegacyReplay(reader); + score.Replay = score.CreateLegacyReplayFrom(reader); } } diff --git a/osu.Game/Modes/Scoring/Score.cs b/osu.Game/Modes/Scoring/Score.cs index fa74fba279..75c243278d 100644 --- a/osu.Game/Modes/Scoring/Score.cs +++ b/osu.Game/Modes/Scoring/Score.cs @@ -6,6 +6,7 @@ using Newtonsoft.Json; using osu.Game.Database; using osu.Game.Modes.Mods; using osu.Game.Users; +using System.IO; namespace osu.Game.Modes.Scoring { @@ -43,6 +44,13 @@ namespace osu.Game.Modes.Scoring [JsonProperty(@"date")] public DateTime Date; + /// + /// Creates a legacy replay which is read from a stream. + /// + /// The stream reader. + /// The replay. + public virtual Replay CreateLegacyReplayFrom(StreamReader reader) => new LegacyReplay(reader); + // [JsonProperty(@"count50")] 0, //[JsonProperty(@"count100")] 0, //[JsonProperty(@"count300")] 100, From 45b013c85fff493edadb060b37c2e745af4ee129 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 24 Mar 2017 14:59:59 +0900 Subject: [PATCH 27/49] Fix post-merge errors. --- .../Objects/Drawable/DrawableHit.cs | 17 ++++++++++------- .../Objects/Drawable/DrawableHitFinisher.cs | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs index 4f3e06cd6d..cc017ab376 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs @@ -21,38 +21,41 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable /// A list of keys which this hit object 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 readonly Hit hit; /// /// Whether the last key pressed is a valid hit key. /// private bool validKeyPressed; - protected DrawableHit(TaikoHitObject hitObject) - : base(hitObject) + protected DrawableHit(Hit hit) + : base(hit) { + this.hit = hit; } protected override void CheckJudgement(bool userTriggered) { if (!userTriggered) { - if (Judgement.TimeOffset > HitObject.HitWindowGood) + if (Judgement.TimeOffset > hit.HitWindowGood) Judgement.Result = HitResult.Miss; return; } double hitOffset = Math.Abs(Judgement.TimeOffset); - if (hitOffset > HitObject.HitWindowMiss) + if (hitOffset > hit.HitWindowMiss) return; if (!validKeyPressed) Judgement.Result = HitResult.Miss; - else if (hitOffset < HitObject.HitWindowGood) + else if (hitOffset < hit.HitWindowGood) { Judgement.Result = HitResult.Hit; - Judgement.TaikoResult = hitOffset < HitObject.HitWindowGreat ? TaikoHitResult.Great : TaikoHitResult.Good; + Judgement.TaikoResult = hitOffset < hit.HitWindowGreat ? TaikoHitResult.Great : TaikoHitResult.Good; } else Judgement.Result = HitResult.Miss; diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs index c72b520cc4..3f7361b62c 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs @@ -19,8 +19,8 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable private double firstHitTime; private Key firstHitKey; - protected DrawableHitFinisher(TaikoHitObject hitObject) - : base(hitObject) + protected DrawableHitFinisher(Hit hit) + : base(hit) { } From 79fa9daec82c0561c8769569d91416a5eb16160e Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 24 Mar 2017 15:05:54 +0900 Subject: [PATCH 28/49] Fix post-merge errors. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs index 41433fc61c..1aa962be12 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs @@ -23,7 +23,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable /// private int userHits; - private Bash bash; + private readonly Bash bash; public DrawableBash(Bash bash) : base(bash) @@ -61,6 +61,10 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable } } + protected override void UpdateState(ArmedState state) + { + } + protected override void UpdateScrollPosition(double time) { base.UpdateScrollPosition(Math.Min(time, HitObject.StartTime)); From c03bf4a5c368fc1d3abdeb7c16956ba183e3a426 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 24 Mar 2017 22:11:11 +0900 Subject: [PATCH 29/49] Use less scaling factors. --- .../Tests/TestCaseTaikoHitObjects.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs index 0bfd191556..cdcbd3fc1a 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs @@ -6,6 +6,7 @@ using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Screens.Testing; using osu.Game.Graphics; @@ -99,8 +100,6 @@ namespace osu.Desktop.VisualTests.Tests private class SwellCircle : BaseCircle { - private const float symbol_size = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.35f; - public SwellCircle(CirclePiece piece) : base(piece) { @@ -108,7 +107,8 @@ namespace osu.Desktop.VisualTests.Tests { Anchor = Anchor.Centre, Origin = Anchor.Centre, - TextSize = symbol_size, + TextSize = SYMBOL_INNER_SIZE, + Icon = FontAwesome.fa_asterisk, Shadow = false }); } @@ -136,8 +136,6 @@ namespace osu.Desktop.VisualTests.Tests private class CentreHitCircle : BaseCircle { - private const float symbol_size = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.35f; - public CentreHitCircle(CirclePiece piece) : base(piece) { @@ -145,7 +143,7 @@ namespace osu.Desktop.VisualTests.Tests { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(symbol_size), + Size = new Vector2(SYMBOL_INNER_SIZE), Masking = true, Children = new[] { @@ -166,8 +164,6 @@ namespace osu.Desktop.VisualTests.Tests private class RimHitCircle : BaseCircle { - private const float symbol_size = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f; - public RimHitCircle(CirclePiece piece) : base(piece) { @@ -175,8 +171,8 @@ namespace osu.Desktop.VisualTests.Tests { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(symbol_size), - BorderThickness = 8, + Size = new Vector2(SYMBOL_SIZE), + BorderThickness = SYMBOL_BORDER, BorderColour = Color4.White, Masking = true, Children = new[] @@ -200,6 +196,10 @@ namespace osu.Desktop.VisualTests.Tests private abstract class BaseCircle : Container { + protected const float SYMBOL_SIZE = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f; + protected const float SYMBOL_BORDER = 8; + protected const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER; + protected readonly CirclePiece Piece; protected BaseCircle(CirclePiece piece) From 7a220e7348c59bb66ee4456aee81a6b7b99abadd Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 24 Mar 2017 22:17:18 +0900 Subject: [PATCH 30/49] Using. --- osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs index cdcbd3fc1a..edd9c74485 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs @@ -6,7 +6,6 @@ using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Screens.Testing; using osu.Game.Graphics; From 0678274118ce0844e8bcca01941dfac9d00937a9 Mon Sep 17 00:00:00 2001 From: ElegantMonkey Date: Sat, 25 Mar 2017 07:45:04 -0300 Subject: [PATCH 31/49] Rename OptionDropdown and OptionEnumDropdown files --- osu.Game/osu.Game.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 989e605c16..32dd814fdc 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -160,7 +160,7 @@ - + @@ -320,7 +320,7 @@ - + @@ -396,4 +396,4 @@ --> - \ No newline at end of file + From be4ab13f4d567190d0d614021b64fb92665a24b9 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 25 Mar 2017 20:30:26 +0900 Subject: [PATCH 32/49] Rename finisher -> accented. --- .../{DrawableHitFinisher.cs => DrawableAccentedHit.cs} | 6 +++--- osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename osu.Game.Modes.Taiko/Objects/Drawable/{DrawableHitFinisher.cs => DrawableAccentedHit.cs} (89%) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableAccentedHit.cs similarity index 89% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs rename to osu.Game.Modes.Taiko/Objects/Drawable/DrawableAccentedHit.cs index 3f7361b62c..e251daae7d 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHitFinisher.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableAccentedHit.cs @@ -8,7 +8,7 @@ using osu.Framework.Input; namespace osu.Game.Modes.Taiko.Objects.Drawable { - public abstract class DrawableHitFinisher : DrawableHit + public abstract class DrawableAccentedHit : DrawableHit { /// /// The lenience for the second key press. @@ -19,7 +19,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable private double firstHitTime; private Key firstHitKey; - protected DrawableHitFinisher(Hit hit) + protected DrawableAccentedHit(Hit hit) : base(hit) { } @@ -70,7 +70,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable return false; // If we're not holding the first key down still, assume the intention - // was not to hit the finisher with both keys simultaneously + // was not to hit the accented hit with both keys simultaneously if (!state.Keyboard.Keys.Contains(firstHitKey)) return false; diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index fcabccc9ca..d6b2fb6364 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -53,7 +53,7 @@ - + From 5bd9147661c4cace5dfa61bbf1756b3ac94307cf Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 25 Mar 2017 20:53:28 +0900 Subject: [PATCH 33/49] 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 e7941859e4ef1b5b102d047ffafc7968c9057545 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 25 Mar 2017 20:57:49 +0900 Subject: [PATCH 34/49] Rename bash -> swell. --- .../Beatmaps/TaikoBeatmapConverter.cs | 2 +- .../{DrawableBash.cs => DrawableSwell.cs} | 16 ++++++++-------- .../Objects/{Bash.cs => Swell.cs} | 4 ++-- .../Scoring/TaikoScoreProcessor.cs | 2 +- osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) rename osu.Game.Modes.Taiko/Objects/Drawable/{DrawableBash.cs => DrawableSwell.cs} (82%) rename osu.Game.Modes.Taiko/Objects/{Bash.cs => Swell.cs} (84%) diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs index b2676bf28a..9b143e9fde 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -61,7 +61,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps if (endTimeData != null) { // We compute the end time manually to add in the Bash convert factor - return new Bash + return new Swell { StartTime = original.StartTime, Sample = original.Sample, diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs similarity index 82% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs rename to osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs index 1aa962be12..9d0e23553d 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBash.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs @@ -10,7 +10,7 @@ using System; namespace osu.Game.Modes.Taiko.Objects.Drawable { - public class DrawableBash : DrawableTaikoHitObject + public class DrawableSwell : DrawableTaikoHitObject { /// /// A list of keys which this HitObject will accept. These are the standard Taiko keys for now. @@ -19,16 +19,16 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable private List validKeys { get; } = new List(new[] { Key.D, Key.F, Key.J, Key.K }); /// - /// The amount of times the user has hit this bash. + /// The amount of times the user has hit this swell. /// private int userHits; - private readonly Bash bash; + private readonly Swell swell; - public DrawableBash(Bash bash) - : base(bash) + public DrawableSwell(Swell swell) + : base(swell) { - this.bash = bash; + this.swell = swell; } protected override void CheckJudgement(bool userTriggered) @@ -40,7 +40,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable userHits++; - if (userHits == bash.RequiredHits) + if (userHits == swell.RequiredHits) { Judgement.Result = HitResult.Hit; Judgement.TaikoResult = TaikoHitResult.Great; @@ -51,7 +51,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable if (Judgement.TimeOffset < 0) return; - if (userHits > bash.RequiredHits / 2) + if (userHits > swell.RequiredHits / 2) { Judgement.Result = HitResult.Hit; Judgement.TaikoResult = TaikoHitResult.Good; diff --git a/osu.Game.Modes.Taiko/Objects/Bash.cs b/osu.Game.Modes.Taiko/Objects/Swell.cs similarity index 84% rename from osu.Game.Modes.Taiko/Objects/Bash.cs rename to osu.Game.Modes.Taiko/Objects/Swell.cs index b8b4eea6a9..20b9a6effb 100644 --- a/osu.Game.Modes.Taiko/Objects/Bash.cs +++ b/osu.Game.Modes.Taiko/Objects/Swell.cs @@ -8,14 +8,14 @@ using osu.Game.Modes.Objects.Types; namespace osu.Game.Modes.Taiko.Objects { - public class Bash : TaikoHitObject, IHasEndTime + public class Swell : TaikoHitObject, IHasEndTime { public double EndTime { get; set; } public double Duration => EndTime - StartTime; /// - /// The number of hits required to complete the bash successfully. + /// The number of hits required to complete the swell successfully. /// public int RequiredHits { get; protected set; } diff --git a/osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs index 3007411230..a3759d9c81 100644 --- a/osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs @@ -165,7 +165,7 @@ namespace osu.Game.Modes.Taiko.Scoring SecondHit = obj.Accented }); } - else if (obj is Bash) + else if (obj is Swell) { AddJudgement(new TaikoJudgement { diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index b1f47832c0..7780230ede 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -52,9 +52,9 @@ - + - + From cbb6930f76991bc23dbf551043d98fa0e40b8c46 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 25 Mar 2017 20:53:28 +0900 Subject: [PATCH 35/49] 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 989a6ab02be514a04c270c07247652b1065e6866 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 25 Mar 2017 23:43:41 +0900 Subject: [PATCH 36/49] Move validKeys to DrawableTaikoHitObject. Cleanup + reword comments. --- .../Objects/Drawable/DrawableAccentedHit.cs | 33 +++++++++++-------- .../Objects/Drawable/DrawableHit.cs | 23 +------------ .../Drawable/DrawableTaikoHitObject.cs | 25 ++++++++++++++ 3 files changed, 45 insertions(+), 36 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableAccentedHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableAccentedHit.cs index e251daae7d..9d9c67a7f4 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableAccentedHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableAccentedHit.cs @@ -17,6 +17,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable private const double second_hit_window = 30; private double firstHitTime; + private bool firstKeyHeld; private Key firstHitKey; protected DrawableAccentedHit(Hit hit) @@ -41,40 +42,44 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable Judgement.SecondHit = true; } - protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + protected override bool HandleKeyPress(Key key) { - // Check if we've handled the initial key + // Check if we've handled the first key if (!Judgement.Result.HasValue) { - bool result = base.OnKeyDown(state, args); + // First key hasn't been handled yet, attempt to handle it + bool handled = base.HandleKeyPress(key); - if (result) + if (handled) { firstHitTime = Time.Current; - firstHitKey = args.Key; + firstHitKey = key; } - return result; + return handled; } // If we've already hit the second key, don't handle this object any further if (Judgement.SecondHit) return false; - // Don't handle represses of the same key - if (firstHitKey == args.Key) + // Don't handle represses of the first key + if (firstHitKey == key) return false; // Don't handle invalid hit key presses - if (!HitKeys.Contains(args.Key)) + if (!HitKeys.Contains(key)) return false; - // If we're not holding the first key down still, assume the intention - // was not to hit the accented hit with both keys simultaneously - if (!state.Keyboard.Keys.Contains(firstHitKey)) - return false; + // Assume the intention was to hit the accented hit with both keys only if the first key is still being held down + return firstKeyHeld && UpdateJudgement(true); + } - return UpdateJudgement(true); + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + firstKeyHeld = state.Keyboard.Keys.Contains(firstHitKey); + + return base.OnKeyDown(state, args); } } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs index cc017ab376..a3ea9e36b9 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Input; -using osu.Framework.Input; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; using System; @@ -17,12 +16,6 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable /// protected abstract List HitKeys { get; } - /// - /// A list of keys which this hit object 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 Hit hit; /// @@ -61,7 +54,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable Judgement.Result = HitResult.Miss; } - protected virtual bool HandleKeyPress(Key key) + protected override bool HandleKeyPress(Key key) { if (Judgement.Result.HasValue) return false; @@ -70,19 +63,5 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable return UpdateJudgement(true); } - - protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) - { - // Make sure we don't handle held-down keys - if (args.Repeat) - return false; - - // Check if we've pressed a valid taiko key - if (!validKeys.Contains(args.Key)) - return false; - - // Handle it! - return HandleKeyPress(args.Key); - } } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs index e165f40442..bb6ca627da 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs @@ -1,15 +1,24 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using OpenTK.Input; using osu.Framework.Graphics; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; +using System.Collections.Generic; +using osu.Framework.Input; namespace osu.Game.Modes.Taiko.Objects.Drawable { public abstract class DrawableTaikoHitObject : DrawableHitObject { + /// + /// A list of keys which this hit object 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 }); + protected DrawableTaikoHitObject(TaikoHitObject hitObject) : base(hitObject) { @@ -49,6 +58,22 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable UpdateScrollPosition(Time.Current); } + protected virtual bool HandleKeyPress(Key key) { return false; } + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + // Make sure we don't handle held-down keys + if (args.Repeat) + return false; + + // Check if we've pressed a valid taiko key + if (!validKeys.Contains(args.Key)) + return false; + + // Handle it! + return HandleKeyPress(args.Key); + } + protected abstract CirclePiece CreateCircle(); } } From 9b0a15cd6ccf83b977c32def44c14e69e254969f Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 25 Mar 2017 23:48:00 +0900 Subject: [PATCH 37/49] Fix post-merge errors. --- osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj | 2 -- 1 file changed, 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 f11b9c24d1..b32288c2d9 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -54,11 +54,9 @@ - - From d9ecb430ede96463a314fc2637e7f27f179867c1 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 25 Mar 2017 23:48:13 +0900 Subject: [PATCH 38/49] Remove validKeys (now in DrawableTaikoHitObject). --- .../Objects/Drawable/DrawableSwell.cs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs index 9d0e23553d..15584ac73f 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs @@ -2,8 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Input; -using System.Collections.Generic; -using osu.Framework.Input; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; using System; @@ -12,12 +10,6 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { public class DrawableSwell : 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 { get; } = new List(new[] { Key.D, Key.F, Key.J, Key.K }); - /// /// The amount of times the user has hit this swell. /// @@ -70,14 +62,11 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable base.UpdateScrollPosition(Math.Min(time, HitObject.StartTime)); } - protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + protected override bool HandleKeyPress(Key key) { if (Judgement.Result.HasValue) return false; - if (!validKeys.Contains(args.Key)) - return false; - UpdateJudgement(true); return true; From 7c9900376f952035828193e3febee6f7310b9c31 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 25 Mar 2017 23:54:50 +0900 Subject: [PATCH 39/49] 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 bcaf2f97582d03c36904937c47ed6af31f293706 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sun, 26 Mar 2017 00:01:00 +0900 Subject: [PATCH 40/49] Use lambda expression. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs index bb6ca627da..5f63a956e1 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs @@ -58,7 +58,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable UpdateScrollPosition(Time.Current); } - protected virtual bool HandleKeyPress(Key key) { return false; } + protected virtual bool HandleKeyPress(Key key) => false; protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { From d0b1fda24f4e48cabca2febe3d4ecc09d84a5851 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Mar 2017 12:33:15 +0900 Subject: [PATCH 41/49] 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 b8c8ca2f0e63ae08c78c6897a4237cd32c7a3950 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Mar 2017 15:49:32 +0900 Subject: [PATCH 42/49] Adjust input drum transition slightly. --- osu.Game.Modes.Taiko/UI/InputDrum.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/UI/InputDrum.cs b/osu.Game.Modes.Taiko/UI/InputDrum.cs index 1787670c7a..2e4c2232fa 100644 --- a/osu.Game.Modes.Taiko/UI/InputDrum.cs +++ b/osu.Game.Modes.Taiko/UI/InputDrum.cs @@ -139,7 +139,7 @@ namespace osu.Game.Modes.Taiko.UI { target.FadeTo(Math.Min(target.Alpha + 0.4f, 1), 40, EasingTypes.OutQuint); target.Delay(40); - target.FadeOut(600, EasingTypes.OutQuint); + target.FadeOut(1000, EasingTypes.OutQuint); } return false; From cc5154dd12bee125b5d0371dd0babbce7de0e6aa Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Mar 2017 17:48:18 +0900 Subject: [PATCH 43/49] Fix regression in mouse dragging behaviour. --- osu.Game/Graphics/Cursor/MenuCursor.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs index 3ab6fa7093..39d0cf181c 100644 --- a/osu.Game/Graphics/Cursor/MenuCursor.cs +++ b/osu.Game/Graphics/Cursor/MenuCursor.cs @@ -20,9 +20,11 @@ namespace osu.Game.Graphics.Cursor { protected override Drawable CreateCursor() => new Cursor(); + private bool dragging; + protected override bool OnMouseMove(InputState state) { - if (state.Mouse.HasMainButtonPressed) + if (dragging) { Vector2 offset = state.Mouse.Position - state.Mouse.PositionMouseDown ?? state.Mouse.Delta; float degrees = (float)MathHelper.RadiansToDegrees(Math.Atan2(-offset.X, offset.Y)) + 24.3f; @@ -39,6 +41,12 @@ namespace osu.Game.Graphics.Cursor return base.OnMouseMove(state); } + protected override bool OnDragStart(InputState state) + { + dragging = true; + return base.OnDragStart(state); + } + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) { ActiveCursor.Scale = new Vector2(1); @@ -53,6 +61,8 @@ namespace osu.Game.Graphics.Cursor { if (!state.Mouse.HasMainButtonPressed) { + dragging = false; + ((Cursor)ActiveCursor).AdditiveLayer.FadeOut(500, EasingTypes.OutQuint); ActiveCursor.RotateTo(0, 600 * (1 + Math.Abs(ActiveCursor.Rotation / 720)), EasingTypes.OutElasticHalf); ActiveCursor.ScaleTo(1, 500, EasingTypes.OutElastic); From 0ad070c2d83101d4d820c31755f21d794f598723 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Mar 2017 22:22:34 +0900 Subject: [PATCH 44/49] 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 45/49] 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 46/49] 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 47/49] 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 48/49] 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 49/49] 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;