From f26cf7bf68599f2ea84c8b020df832c6a5a8c694 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 16:55:57 +0900 Subject: [PATCH 01/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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/83] 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 55df07a8720da80706fb32d8a993db0cdcc3d8c4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Mar 2017 00:03:09 +0900 Subject: [PATCH 45/83] Fix username being cleared when it shouldn't be. --- osu.Game/Online/API/APIAccess.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index f39dec47e1..087bae3071 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -118,7 +118,7 @@ namespace osu.Game.Online.API //todo: this fails even on network-related issues. we should probably handle those differently. //NotificationManager.ShowMessage("Login failed!"); log.Add(@"Login failed!"); - clearCredentials(); + Password = null; continue; } From 039f4a65dc5b83c2f437b00ecec3a14e263ebd4b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Mar 2017 00:04:07 +0900 Subject: [PATCH 46/83] Combine user models. --- osu.Game/Online/API/APIAccess.cs | 1 + .../Online/API/Requests/GetUserRequest.cs | 2 ++ osu.Game/Online/Chat/Drawables/ChatLine.cs | 2 +- osu.Game/Online/Chat/Message.cs | 1 + osu.Game/Online/User.cs | 19 ------------------- osu.Game/Users/User.cs | 12 +++++++++++- osu.Game/osu.Game.csproj | 3 +-- 7 files changed, 17 insertions(+), 23 deletions(-) delete mode 100644 osu.Game/Online/User.cs diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index 087bae3071..c4b679fc92 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -12,6 +12,7 @@ using osu.Framework.Configuration; using osu.Framework.Logging; using osu.Framework.Threading; using osu.Game.Online.API.Requests; +using osu.Game.Users; namespace osu.Game.Online.API { diff --git a/osu.Game/Online/API/Requests/GetUserRequest.cs b/osu.Game/Online/API/Requests/GetUserRequest.cs index e396c56b53..2fd1ee5efc 100644 --- a/osu.Game/Online/API/Requests/GetUserRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserRequest.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Users; + namespace osu.Game.Online.API.Requests { public class GetUserRequest : APIRequest diff --git a/osu.Game/Online/Chat/Drawables/ChatLine.cs b/osu.Game/Online/Chat/Drawables/ChatLine.cs index 9f78be92d1..bfbcf3d707 100644 --- a/osu.Game/Online/Chat/Drawables/ChatLine.cs +++ b/osu.Game/Online/Chat/Drawables/ChatLine.cs @@ -91,7 +91,7 @@ namespace osu.Game.Online.Chat.Drawables new OsuSpriteText { Font = @"Exo2.0-BoldItalic", - Text = $@"{Message.User.Name}:", + Text = $@"{Message.User.Username}:", Colour = getUsernameColour(Message), TextSize = text_size, Origin = Anchor.TopRight, diff --git a/osu.Game/Online/Chat/Message.cs b/osu.Game/Online/Chat/Message.cs index 3081653c34..b267cf63ac 100644 --- a/osu.Game/Online/Chat/Message.cs +++ b/osu.Game/Online/Chat/Message.cs @@ -3,6 +3,7 @@ using System; using Newtonsoft.Json; +using osu.Game.Users; namespace osu.Game.Online.Chat { diff --git a/osu.Game/Online/User.cs b/osu.Game/Online/User.cs deleted file mode 100644 index 0059f940a5..0000000000 --- a/osu.Game/Online/User.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using Newtonsoft.Json; - -namespace osu.Game.Online -{ - public class User - { - [JsonProperty(@"username")] - public string Name; - - [JsonProperty(@"id")] - public int Id; - - [JsonProperty(@"colour")] - public string Colour; - } -} diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index 2763b3100f..6e1de7e3ac 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.cs @@ -1,13 +1,23 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using Newtonsoft.Json; + namespace osu.Game.Users { public class User { - public int Id; + [JsonProperty(@"id")] + public long Id = 1; + + [JsonProperty(@"username")] public string Username; + public Country Country; + public Team Team; + + [JsonProperty(@"colour")] + public string Colour; } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 32dd814fdc..7cb55aaa89 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -247,7 +247,6 @@ - @@ -396,4 +395,4 @@ --> - + \ No newline at end of file From 13272e699575203fdbc87c4367886d7dd7995ff9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Mar 2017 00:04:51 +0900 Subject: [PATCH 47/83] Make Avatar accept a user. Add UpdateableAvatar to handle the toolbar use-case. --- .../Overlays/Toolbar/ToolbarUserButton.cs | 8 +- .../Select/Leaderboards/LeaderboardScore.cs | 3 +- osu.Game/Users/Avatar.cs | 103 +++++++----------- osu.Game/Users/UpdateableAvatar.cs | 43 ++++++++ osu.Game/osu.Game.csproj | 1 + 5 files changed, 87 insertions(+), 71 deletions(-) create mode 100644 osu.Game/Users/UpdateableAvatar.cs diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index 7e266a2b43..4e59f87bee 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -14,7 +14,7 @@ namespace osu.Game.Overlays.Toolbar { internal class ToolbarUserButton : ToolbarButton, IOnlineComponent { - private readonly Avatar avatar; + private readonly UpdateableAvatar avatar; public ToolbarUserButton() { @@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Toolbar Add(new OpaqueBackground { Depth = 1 }); - Flow.Add(avatar = new Avatar + Flow.Add(avatar = new UpdateableAvatar { Masking = true, Size = new Vector2(32), @@ -52,11 +52,11 @@ namespace osu.Game.Overlays.Toolbar { default: Text = @"Guest"; - avatar.UserId = 1; + avatar.User = new User(); break; case APIState.Online: Text = api.Username; - avatar.UserId = api.LocalUser.Value.Id; + avatar.User = api.LocalUser; break; } } diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 1df6d2b55c..c31ebc6095 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -142,7 +142,7 @@ namespace osu.Game.Screens.Select.Leaderboards Padding = new MarginPadding(edge_margin), Children = new Drawable[] { - avatar = new Avatar + avatar = new Avatar(Score.User ?? new User { Id = Score.UserID }) { Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2), CornerRadius = corner_radius, @@ -153,7 +153,6 @@ namespace osu.Game.Screens.Select.Leaderboards Radius = 1, Colour = Color4.Black.Opacity(0.2f), }, - UserId = Score.User?.Id ?? Score.UserID, }, new Container { diff --git a/osu.Game/Users/Avatar.cs b/osu.Game/Users/Avatar.cs index a6ce9f1e41..2ac17cd23f 100644 --- a/osu.Game/Users/Avatar.cs +++ b/osu.Game/Users/Avatar.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Diagnostics; +using System; using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Graphics; @@ -13,68 +13,60 @@ namespace osu.Game.Users { public class Avatar : Container { - public Drawable Sprite; + private const int time_before_load = 500; - private long userId; - private OsuGameBase game; - private Texture guestTexture; + private Drawable sprite; + private readonly User user; + private readonly bool delayedLoad; - [BackgroundDependencyLoader(permitNulls: true)] - private void load(OsuGameBase game, TextureStore textures) + /// + /// An avatar for specified user. + /// + /// The user. A null value will get a placeholder avatar. + /// Whether we should delay the load of the avatar until it has been on-screen for a specified duration. + public Avatar(User user = null, bool delayedLoad = true) { - this.game = game; - guestTexture = textures.Get(@"Online/avatar-guest"); - } - - public long UserId - { - get { return userId; } - set - { - if (userId == value) - return; - - userId = value; - invalidateSprite(); - } + this.user = user; + this.delayedLoad = delayedLoad; } + private Action performLoad; private Task loadTask; - private void invalidateSprite() + [BackgroundDependencyLoader(permitNulls: true)] + private void load(TextureStore textures) { - Sprite?.FadeOut(100); - Sprite?.Expire(); - Sprite = null; - } - - private void updateSprite() - { - if (loadTask != null || Sprite != null) return; - - var newSprite = userId > 1 ? new OnlineSprite($@"https://a.ppy.sh/{userId}", guestTexture) : new Sprite { Texture = guestTexture }; - - newSprite.FillMode = FillMode.Fill; - - loadTask = newSprite.LoadAsync(game, s => + performLoad = () => { - Sprite = s; - Add(Sprite); + Texture texture = null; + if (user?.Id > 1) texture = textures.Get($@"https://a.ppy.sh/{user.Id}"); + if (texture == null) texture = textures.Get(@"Online/avatar-guest"); - Sprite.FadeInFromZero(200); - loadTask = null; - }); + sprite = new Sprite + { + Texture = texture, + FillMode = FillMode.Fit, + Anchor = Anchor.Centre, + Origin = Anchor.Centre + }; + + Schedule(() => + { + Add(sprite); + sprite.FadeInFromZero(150); + }); + }; } private double timeVisible; - private bool shouldUpdate => Sprite != null || timeVisible > 500; + private bool shouldLoad => !delayedLoad || timeVisible > time_before_load; protected override void Update() { base.Update(); - if (!shouldUpdate) + if (!shouldLoad) { //Special optimisation to not start loading until we are within bounds of our closest ScrollContainer parent. ScrollContainer scroll = null; @@ -88,27 +80,8 @@ namespace osu.Game.Users timeVisible = 0; } - if (shouldUpdate) - updateSprite(); - } - - public class OnlineSprite : Sprite - { - private readonly string url; - private readonly Texture fallbackTexture; - - public OnlineSprite(string url, Texture fallbackTexture = null) - { - Debug.Assert(url != null); - this.url = url; - this.fallbackTexture = fallbackTexture; - } - - [BackgroundDependencyLoader] - private void load(TextureStore textures) - { - Texture = textures.Get(url) ?? fallbackTexture; - } + if (shouldLoad && loadTask == null) + (loadTask = Task.Factory.StartNew(performLoad, TaskCreationOptions.LongRunning)).ConfigureAwait(false); } } } diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs new file mode 100644 index 0000000000..cf6448dac7 --- /dev/null +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -0,0 +1,43 @@ +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; + +namespace osu.Game.Users +{ + /// + /// An avatar which can update to a new user when needed. + /// + public class UpdateableAvatar : Container + { + private Avatar displayedAvatar; + + private User user; + + public User User + { + get { return user; } + set + { + if (user?.Id == value?.Id) + return; + + user = value; + + if (IsLoaded) + updateAvatar(); + } + } + + protected override void LoadComplete() + { + base.LoadComplete(); + updateAvatar(); + } + + private void updateAvatar() + { + displayedAvatar?.FadeOut(300); + displayedAvatar?.Expire(); + Add(displayedAvatar = new Avatar(user, false) { RelativeSizeAxes = Axes.Both }); + } + } +} \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 7cb55aaa89..a5bdf1df69 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -266,6 +266,7 @@ + From 768b3c4b4b554a5cbd6dc8d2fc1267921d422abd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Mar 2017 00:05:11 +0900 Subject: [PATCH 48/83] Add better focus handling in the login form. --- osu.Game/Overlays/LoginOverlay.cs | 2 ++ .../Options/Sections/General/LoginOptions.cs | 27 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/LoginOverlay.cs b/osu.Game/Overlays/LoginOverlay.cs index fec1c5ec6e..4ceb8092a1 100644 --- a/osu.Game/Overlays/LoginOverlay.cs +++ b/osu.Game/Overlays/LoginOverlay.cs @@ -67,6 +67,8 @@ namespace osu.Game.Overlays optionsSection.Bounding = true; FadeIn(transition_time, EasingTypes.OutQuint); + + optionsSection.TriggerFocus(); } protected override void PopOut() diff --git a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs index f95d3a026e..a5e38dd284 100644 --- a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs +++ b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs @@ -11,12 +11,14 @@ using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; using OpenTK; +using osu.Framework.Input; namespace osu.Game.Overlays.Options.Sections.General { public class LoginOptions : OptionsSubsection, IOnlineComponent { private bool bounding = true; + private LoginForm form; protected override string Header => "Account"; @@ -40,12 +42,14 @@ namespace osu.Game.Overlays.Options.Sections.General public void APIStateChanged(APIAccess api, APIState state) { + form = null; + switch (state) { case APIState.Offline: Children = new Drawable[] { - new LoginForm() + form = new LoginForm() }; break; case APIState.Failing: @@ -82,6 +86,14 @@ namespace osu.Game.Overlays.Options.Sections.General }; break; } + + form?.TriggerFocus(); + } + + protected override bool OnFocus(InputState state) + { + form?.TriggerFocus(); + return base.OnFocus(state); } private class LoginForm : FillFlowContainer @@ -144,6 +156,19 @@ namespace osu.Game.Overlays.Options.Sections.General } }; } + + protected override bool OnFocus(InputState state) + { + Schedule(() => + { + if (string.IsNullOrEmpty(username.Text)) + username.TriggerFocus(); + else + password.TriggerFocus(); + }); + + return base.OnFocus(state); + } } } } From 36af868f447d72f29641b61fbac609df837e26b2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Mar 2017 00:13:38 +0900 Subject: [PATCH 49/83] Add missing licence header. --- osu.Game/Users/UpdateableAvatar.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index cf6448dac7..265c177ced 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; namespace osu.Game.Users From 4bb60607e16498bc6b5527faeab2deb87c06d3ff Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 09:50:43 +0900 Subject: [PATCH 50/83] 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 51/83] 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 52/83] 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 53/83] 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 621bcaed59ac9257d4e85cc1a586a7db6e3ff7f5 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 10:33:23 +0900 Subject: [PATCH 54/83] Add drawable Hits/StrongHits. --- .../Tests/TestCaseTaikoHitObjects.cs | 43 +++------------- .../Tests/TestCaseTaikoPlayfield.cs | 10 ++++ .../Objects/Drawable/CentreHitCirclePiece.cs | 49 +++++++++++++++++++ .../Objects/Drawable/DrawableCentreHit.cs | 17 +++++++ .../Objects/Drawable/DrawableHit.cs | 34 +++++++++++++ .../Drawable/DrawableStrongCentreHit.cs | 17 +++++++ .../osu.Game.Modes.Taiko.csproj | 3 ++ 7 files changed, 136 insertions(+), 37 deletions(-) create mode 100644 osu.Game.Modes.Taiko/Objects/Drawable/CentreHitCirclePiece.cs create mode 100644 osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs create mode 100644 osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs index 0204058b8a..48d7017f78 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Screens.Testing; using osu.Game.Graphics; using osu.Game.Modes.Taiko.Objects; +using osu.Game.Modes.Taiko.Objects.Drawable; using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; namespace osu.Desktop.VisualTests.Tests @@ -30,7 +31,7 @@ namespace osu.Desktop.VisualTests.Tests Reset(); }); - Add(new CentreHitCircle(new CirclePiece() + Add(new CentreHitCirclePiece(new CirclePiece() { KiaiMode = kiai }) @@ -38,7 +39,7 @@ namespace osu.Desktop.VisualTests.Tests Position = new Vector2(100, 100) }); - Add(new CentreHitCircle(new StrongCirclePiece() + Add(new CentreHitCirclePiece(new StrongCirclePiece() { KiaiMode = kiai }) @@ -106,7 +107,7 @@ namespace osu.Desktop.VisualTests.Tests { Anchor = Anchor.Centre, Origin = Anchor.Centre, - TextSize = SYMBOL_INNER_SIZE, + TextSize = CirclePiece.SYMBOL_INNER_SIZE, Icon = FontAwesome.fa_asterisk, Shadow = false }); @@ -133,34 +134,6 @@ namespace osu.Desktop.VisualTests.Tests } } - private class CentreHitCircle : BaseCircle - { - public CentreHitCircle(CirclePiece piece) - : base(piece) - { - Piece.Add(new CircularContainer - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Size = new Vector2(SYMBOL_INNER_SIZE), - Masking = true, - Children = new[] - { - new Box - { - RelativeSizeAxes = Axes.Both - } - } - }); - } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - Piece.AccentColour = colours.PinkDarker; - } - } - private class RimHitCircle : BaseCircle { public RimHitCircle(CirclePiece piece) @@ -170,8 +143,8 @@ namespace osu.Desktop.VisualTests.Tests { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(SYMBOL_SIZE), - BorderThickness = SYMBOL_BORDER, + Size = new Vector2(CirclePiece.SYMBOL_SIZE), + BorderThickness = CirclePiece.SYMBOL_BORDER, BorderColour = Color4.White, Masking = true, Children = new[] @@ -195,10 +168,6 @@ 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) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 395a0cab13..483c156ea5 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -6,6 +6,7 @@ using osu.Framework.Screens.Testing; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; using osu.Game.Modes.Taiko.Objects; +using osu.Game.Modes.Taiko.Objects.Drawable; using osu.Game.Modes.Taiko.UI; namespace osu.Desktop.VisualTests.Tests @@ -22,6 +23,15 @@ namespace osu.Desktop.VisualTests.Tests AddButton("Hit!", addHitJudgement); AddButton("Miss :(", addMissJudgement); + AddButton("Centre", () => + { + playfield.Add(new DrawableCentreHit(new Hit + { + StartTime = Time.Current + 1000, + PreEmpt = 1000, + IsStrong = false + })); + }); Add(playfield = new TaikoPlayfield { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/CentreHitCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/CentreHitCirclePiece.cs new file mode 100644 index 0000000000..e476430aab --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/CentreHitCirclePiece.cs @@ -0,0 +1,49 @@ +using OpenTK; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; +using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + /// + /// A circle piece used for centre hits. + /// + public class CentreHitCirclePiece : Container + { + private CirclePiece circle; + + public CentreHitCirclePiece(CirclePiece piece) + { + Add(circle = piece); + + circle.Add(new CircularContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Size = new Vector2(CirclePiece.SYMBOL_INNER_SIZE), + Masking = true, + Children = new[] + { + new Box + { + RelativeSizeAxes = Axes.Both + } + } + }); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + circle.AccentColour = colours.PinkDarker; + } + } +} diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs new file mode 100644 index 0000000000..363ffdd451 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using OpenTK.Input; +using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + public class DrawableCentreHit : DrawableHit + { + protected override List HitKeys { get; } = new List(new Key[] { Key.F, Key.J }); + + public DrawableCentreHit(Hit hit) + : base(hit) + { + Add(new CentreHitCirclePiece(new CirclePiece())); + } + } +} diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs index a3ea9e36b9..f455fc8d5b 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs @@ -2,6 +2,9 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Input; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Transforms; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; using System; @@ -16,6 +19,8 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable /// protected abstract List HitKeys { get; } + protected override Container Content => bodyContainer; + private readonly Hit hit; /// @@ -23,10 +28,18 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable /// private bool validKeyPressed; + private Container bodyContainer; + protected DrawableHit(Hit hit) : base(hit) { this.hit = hit; + + AddInternal(bodyContainer = new Container + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + }); } protected override void CheckJudgement(bool userTriggered) @@ -63,5 +76,26 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable return UpdateJudgement(true); } + + protected override void UpdateState(ArmedState state) + { + switch (State) + { + case ArmedState.Idle: + break; + case ArmedState.Miss: + bodyContainer.FadeOut(100); + break; + case ArmedState.Hit: + bodyContainer.ScaleTo(0.8f, 400, EasingTypes.OutQuad); + bodyContainer.FadeOut(600, EasingTypes.OutQuint); + bodyContainer.MoveToY(-200, 250, EasingTypes.Out); + + bodyContainer.Delay(250); + + bodyContainer.MoveToY(0, 500, EasingTypes.In); + break; + } + } } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs new file mode 100644 index 0000000000..19a1eec618 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using OpenTK.Input; +using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + public class DrawableStrongCentreHit : DrawableStrongHit + { + protected override List HitKeys { get; } = new List(new Key[] { Key.F, Key.J }); + + public DrawableStrongCentreHit(Hit hit) + : base(hit) + { + Add(new CentreHitCirclePiece(new StrongCirclePiece())); + } + } +} diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index fa09ae2c82..1272c7b079 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -52,7 +52,10 @@ + + + From 3f1e8ddcd16324558cd7e553861eae3015a1afca Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 28 Mar 2017 10:51:22 +0900 Subject: [PATCH 55/83] License headers + general fixes. --- .../Tests/TestCaseTaikoHitObjects.cs | 1 - .../Objects/Drawable/CentreHitCirclePiece.cs | 12 +++++------- .../Objects/Drawable/DrawableCentreHit.cs | 7 +++++-- osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs | 2 +- .../Objects/Drawable/DrawableStrongCentreHit.cs | 7 +++++-- osu.Game.Modes.Taiko/packages.config | 1 - 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs index 48d7017f78..96d5ece693 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs @@ -9,7 +9,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Screens.Testing; using osu.Game.Graphics; -using osu.Game.Modes.Taiko.Objects; using osu.Game.Modes.Taiko.Objects.Drawable; using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/CentreHitCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/CentreHitCirclePiece.cs index e476430aab..580541546f 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/CentreHitCirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/CentreHitCirclePiece.cs @@ -1,15 +1,13 @@ -using OpenTK; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace osu.Game.Modes.Taiko.Objects.Drawable { @@ -18,7 +16,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable /// public class CentreHitCirclePiece : Container { - private CirclePiece circle; + private readonly CirclePiece circle; public CentreHitCirclePiece(CirclePiece piece) { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs index 363ffdd451..b3f9974c15 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs @@ -1,4 +1,7 @@ -using System.Collections.Generic; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; using OpenTK.Input; using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; @@ -6,7 +9,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { public class DrawableCentreHit : DrawableHit { - protected override List HitKeys { get; } = new List(new Key[] { Key.F, Key.J }); + protected override List HitKeys { get; } = new List(new[] { Key.F, Key.J }); public DrawableCentreHit(Hit hit) : base(hit) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs index f455fc8d5b..f48993fd45 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs @@ -28,7 +28,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable /// private bool validKeyPressed; - private Container bodyContainer; + private readonly Container bodyContainer; protected DrawableHit(Hit hit) : base(hit) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs index 19a1eec618..2ad4537bce 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs @@ -1,4 +1,7 @@ -using System.Collections.Generic; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; using OpenTK.Input; using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; @@ -6,7 +9,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { public class DrawableStrongCentreHit : DrawableStrongHit { - protected override List HitKeys { get; } = new List(new Key[] { Key.F, Key.J }); + protected override List HitKeys { get; } = new List(new[] { Key.F, Key.J }); public DrawableStrongCentreHit(Hit hit) : base(hit) diff --git a/osu.Game.Modes.Taiko/packages.config b/osu.Game.Modes.Taiko/packages.config index 08fca09c35..4031dd62a8 100644 --- a/osu.Game.Modes.Taiko/packages.config +++ b/osu.Game.Modes.Taiko/packages.config @@ -1,5 +1,4 @@  - - + \ No newline at end of file From e518508f2d0e86a28dd466e01fcf08b0e49b811b Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 29 Mar 2017 09:11:07 +0900 Subject: [PATCH 68/83] Better life time ends. --- osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs | 9 +++++---- .../Objects/Drawable/DrawableTaikoHitObject.cs | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs index 56e2f329bf..504e3c7c19 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs @@ -83,16 +83,17 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable case ArmedState.Idle: break; case ArmedState.Miss: - bodyContainer.FadeOut(100); + FadeOut(100); + Expire(); break; case ArmedState.Hit: bodyContainer.ScaleTo(0.8f, 400, EasingTypes.OutQuad); - bodyContainer.FadeOut(600, EasingTypes.OutQuint); bodyContainer.MoveToY(-200, 250, EasingTypes.Out); - bodyContainer.Delay(250); - bodyContainer.MoveToY(0, 500, EasingTypes.In); + + FadeOut(600); + Expire(); break; } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs index c14dc6d7b0..5d6d669dc1 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs @@ -30,7 +30,6 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable protected override void LoadComplete() { LifetimeStart = HitObject.StartTime - HitObject.PreEmpt * 2; - LifetimeEnd = HitObject.StartTime + HitObject.PreEmpt; base.LoadComplete(); } From ab97967237ae3fbe10fca376fa59a42892b070da Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 28 Mar 2017 21:03:34 +0900 Subject: [PATCH 69/83] Update references and framework. --- osu.Desktop.VisualTests/Benchmark.cs | 2 +- .../Tests/TestCaseBeatmapDetailArea.cs | 2 +- .../Tests/TestCaseBeatmapOptionsOverlay.cs | 2 +- .../Tests/TestCaseChatDisplay.cs | 2 +- .../Tests/TestCaseDialogOverlay.cs | 2 +- .../Tests/TestCaseDrawings.cs | 2 +- .../Tests/TestCaseGamefield.cs | 2 +- .../Tests/TestCaseHitObjects.cs | 2 +- .../Tests/TestCaseKeyCounter.cs | 2 +- .../Tests/TestCaseLeaderboard.cs | 2 +- .../Tests/TestCaseMenuButtonSystem.cs | 2 +- .../Tests/TestCaseModSelectOverlay.cs | 2 +- .../Tests/TestCaseMusicController.cs | 2 +- .../Tests/TestCaseNotificationManager.cs | 2 +- .../Tests/TestCaseOptions.cs | 2 +- .../Tests/TestCasePauseOverlay.cs | 2 +- .../Tests/TestCasePlaySongSelect.cs | 2 +- .../Tests/TestCasePlayer.cs | 2 +- .../Tests/TestCaseScoreCounter.cs | 2 +- .../Tests/TestCaseTabControl.cs | 2 +- .../Tests/TestCaseTaikoHitObjects.cs | 2 +- .../Tests/TestCaseTaikoPlayfield.cs | 2 +- .../Tests/TestCaseTextAwesome.cs | 2 +- .../Tests/TestCaseTwoLayerButton.cs | 2 +- osu.Desktop.VisualTests/VisualTestGame.cs | 2 +- .../osu.Desktop.VisualTests.csproj | 8 +++++--- osu.Game/Screens/Menu/MainMenu.cs | 2 -- osu.sln | 19 ++++++++++++++----- 28 files changed, 44 insertions(+), 35 deletions(-) diff --git a/osu.Desktop.VisualTests/Benchmark.cs b/osu.Desktop.VisualTests/Benchmark.cs index 0a15b38fc2..884dff9f7a 100644 --- a/osu.Desktop.VisualTests/Benchmark.cs +++ b/osu.Desktop.VisualTests/Benchmark.cs @@ -3,7 +3,7 @@ using System; using osu.Framework.Allocation; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game; namespace osu.Desktop.VisualTests diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetailArea.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetailArea.cs index bb7df19202..e755924a15 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetailArea.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetailArea.cs @@ -3,7 +3,7 @@ using OpenTK; using osu.Framework.Graphics; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game.Screens.Select; namespace osu.Desktop.VisualTests.Tests diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatmapOptionsOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatmapOptionsOverlay.cs index a13f6005bf..3fc6ce10e7 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatmapOptionsOverlay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatmapOptionsOverlay.cs @@ -3,7 +3,7 @@ using OpenTK.Graphics; using OpenTK.Input; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game.Graphics; using osu.Game.Screens.Select.Options; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs b/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs index 08765a9b0f..2cb63ba7a0 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Framework.Graphics.Containers; using osu.Framework.Threading; using osu.Game.Overlays; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseDialogOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCaseDialogOverlay.cs index c9edcb8a54..3ae5929ecc 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseDialogOverlay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseDialogOverlay.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game.Graphics; using osu.Game.Overlays; using osu.Game.Overlays.Dialog; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseDrawings.cs b/osu.Desktop.VisualTests/Tests/TestCaseDrawings.cs index 00e41de254..a0463516de 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseDrawings.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseDrawings.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game.Screens.Tournament; using osu.Game.Screens.Tournament.Teams; using osu.Game.Users; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs index e876c21a12..3129cade63 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs @@ -5,7 +5,7 @@ using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.MathUtils; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Framework.Timing; using osu.Game.Beatmaps; using osu.Game.Database; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs index 2a20cad2db..8818240b2d 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Framework.Timing; using osu.Game.Modes.Objects; using osu.Game.Modes.Objects.Drawables; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs b/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs index 83ad49fcd2..051db489e9 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Framework.Graphics; using OpenTK.Input; using osu.Framework.Graphics.UserInterface; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseLeaderboard.cs b/osu.Desktop.VisualTests/Tests/TestCaseLeaderboard.cs index 329d5c5687..c985375873 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseLeaderboard.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseLeaderboard.cs @@ -3,7 +3,7 @@ using OpenTK; using osu.Framework.Graphics; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game.Modes.Mods; using osu.Game.Modes.Osu.Mods; using osu.Game.Modes.Scoring; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseMenuButtonSystem.cs b/osu.Desktop.VisualTests/Tests/TestCaseMenuButtonSystem.cs index 36dc3945e2..ddb62598cf 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseMenuButtonSystem.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseMenuButtonSystem.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Sprites; using osu.Game.Screens.Menu; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs index eaaa531691..73f8ed6242 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseModSelectOverlay.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics; using osu.Game.Overlays.Mods; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game.Modes; namespace osu.Desktop.VisualTests.Tests diff --git a/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs b/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs index f44f662321..305aa24252 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Framework.Graphics; using osu.Framework.Timing; using osu.Game.Overlays; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseNotificationManager.cs b/osu.Desktop.VisualTests/Tests/TestCaseNotificationManager.cs index 13f89153e9..990052012f 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseNotificationManager.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseNotificationManager.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using osu.Framework.Graphics; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Framework.MathUtils; using osu.Game.Overlays; using System.Linq; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseOptions.cs b/osu.Desktop.VisualTests/Tests/TestCaseOptions.cs index 1b4ecd726a..ff6bdc8a5a 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseOptions.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game.Overlays; namespace osu.Desktop.VisualTests.Tests diff --git a/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs b/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs index ad8039bc66..09e2dc38aa 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePauseOverlay.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Logging; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game.Screens.Play; namespace osu.Desktop.VisualTests.Tests diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs index c97ea929f3..16f7881dcd 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using osu.Desktop.VisualTests.Platform; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Framework.MathUtils; using osu.Game.Database; using osu.Game.Modes; diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs index a08cb3e97e..f36889b02a 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game.Beatmaps; using OpenTK; using osu.Framework.Graphics.Sprites; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs b/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs index be313efed3..cca87cd12b 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.MathUtils; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game.Graphics.UserInterface; using osu.Game.Modes.UI; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs b/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs index da807d5e53..23e7f8a74d 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs @@ -3,7 +3,7 @@ using OpenTK; using osu.Framework.Graphics.Primitives; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Select.Filter; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs index edd9c74485..e406fe3a60 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs @@ -7,7 +7,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game.Graphics; using osu.Game.Modes.Taiko.Objects; using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 395a0cab13..5a988c54e1 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.MathUtils; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; using osu.Game.Modes.Taiko.Objects; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs b/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs index 3ba657d60a..7182ee7c06 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.MathUtils; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTwoLayerButton.cs b/osu.Desktop.VisualTests/Tests/TestCaseTwoLayerButton.cs index 4694a6c6ea..2427b6d12c 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTwoLayerButton.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTwoLayerButton.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Play; diff --git a/osu.Desktop.VisualTests/VisualTestGame.cs b/osu.Desktop.VisualTests/VisualTestGame.cs index c41bdeef66..bdce72b3f5 100644 --- a/osu.Desktop.VisualTests/VisualTestGame.cs +++ b/osu.Desktop.VisualTests/VisualTestGame.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Platform; -using osu.Framework.Screens.Testing; +using osu.Framework.Testing; using osu.Game; using osu.Game.Screens.Backgrounds; diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index f1b4a99510..9f3cd6b3c4 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -150,6 +150,10 @@ {65dc628f-a640-4111-ab35-3a5652bc1e17} osu.Framework.Desktop + + {007b2356-ab6f-4bd9-96d5-116fc2dce69a} + osu.Framework.Testing + {c76bf5b3-985e-4d39-95fe-97c9c879b83a} osu.Framework @@ -212,9 +216,7 @@ - - - +