From b05a12372a2ef916ad81a0103563f84bad3c1681 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 18:44:07 +0900 Subject: [PATCH 01/13] Add base barline. --- osu.Game.Modes.Taiko/Objects/BarLine.cs | 28 +++++++++++++++++++ .../osu.Game.Modes.Taiko.csproj | 1 + 2 files changed, 29 insertions(+) create mode 100644 osu.Game.Modes.Taiko/Objects/BarLine.cs diff --git a/osu.Game.Modes.Taiko/Objects/BarLine.cs b/osu.Game.Modes.Taiko/Objects/BarLine.cs new file mode 100644 index 0000000000..6c79d2172c --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/BarLine.cs @@ -0,0 +1,28 @@ +using osu.Game.Beatmaps.Timing; +using osu.Game.Database; + +namespace osu.Game.Modes.Taiko.Objects +{ + public class BarLine + { + /// + /// The start time of the control point this bar line represents. + /// + public double StartTime; + + /// + /// The time to scroll in the bar line. + /// + public double PreEmpt; + + /// + /// Whether this is a major bar line (affects display). + /// + public bool IsMajor; + + public void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty) + { + PreEmpt = 600 / (timing.SliderVelocityAt(StartTime) * difficulty.SliderMultiplier) * 1000; + } + } +} diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index 7ea6dfeadb..39b18e23dc 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 b602b7a3eaf47b6e898fb5080ea40eea3e0a7fb9 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 20:39:18 +0900 Subject: [PATCH 02/13] Add barline drawables. --- .../Tests/TestCaseTaikoPlayfield.cs | 1 + .../Objects/Drawable/DrawableBarLine.cs | 73 +++++++++++++++++++ .../Objects/Drawable/DrawableMajorBarLine.cs | 55 ++++++++++++++ osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs | 11 +-- .../osu.Game.Modes.Taiko.csproj | 2 + 5 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs create mode 100644 osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 787bca5832..289e105f71 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 diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs new file mode 100644 index 0000000000..17c869d739 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs @@ -0,0 +1,73 @@ +// 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; +using osu.Framework.Graphics.Sprites; +using osu.Game.Modes.Taiko.UI; +using OpenTK; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + /// + /// A line that scrolls alongside hit objects in the playfield and visualises control points. + /// + public class DrawableBarLine : Container + { + /// + /// The line. + /// + protected Box Tracker; + + /// + /// The + /// + protected readonly BarLine BarLine; + + public DrawableBarLine(BarLine barLine) + { + BarLine = barLine; + + Anchor = Anchor.CentreLeft; + Origin = Anchor.Centre; + + RelativePositionAxes = Axes.X; + RelativeSizeAxes = Axes.Y; + + Width = 2f; + + Children = new[] + { + Tracker = new Box + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + + RelativeSizeAxes = Axes.Both, + + EdgeSmoothness = new Vector2(0.5f, 0), + Alpha = 0.75f + } + }; + + LifetimeStart = BarLine.StartTime - BarLine.PreEmpt * 2; + LifetimeEnd = BarLine.StartTime + BarLine.PreEmpt; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + Delay(BarLine.StartTime); + FadeOut(100 * BarLine.PreEmpt / 1000); + } + + private void moveToTimeOffset(double time) => MoveToX((float)((BarLine.StartTime - time) / BarLine.PreEmpt)); + + protected override void Update() + { + base.Update(); + moveToTimeOffset(Time.Current); + } + } +} \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs new file mode 100644 index 0000000000..ca5a6f9299 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs @@ -0,0 +1,55 @@ +// 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; +using osu.Framework.Graphics.Sprites; +using OpenTK; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + public class DrawableMajorBarLine : DrawableBarLine + { + public DrawableMajorBarLine(BarLine barLine) + : base(barLine) + { + Add(new Container + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + + RelativeSizeAxes = Axes.Both, + + Children = new[] + { + new EquilateralTriangle + { + Name = "Top", + + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + + Position = new Vector2(0, -10), + Size = new Vector2(-20), + + EdgeSmoothness = new Vector2(1), + }, + new EquilateralTriangle + { + Name = "Bottom", + + Anchor = Anchor.BottomCentre, + Origin = Anchor.TopCentre, + + Position = new Vector2(0, 10), + Size = new Vector2(20), + + EdgeSmoothness = new Vector2(1), + } + } + }); + + Tracker.Alpha = 1f; + } + } +} \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs index b2248e2c3e..7ba3561cd4 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs @@ -14,6 +14,7 @@ using osu.Game.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics.Primitives; +using osu.Game.Modes.Taiko.Objects.Drawable; namespace osu.Game.Modes.Taiko.UI { @@ -47,7 +48,7 @@ namespace osu.Game.Modes.Taiko.UI protected override Container Content => hitObjectContainer; private Container ringExplosionContainer; - //private Container barLineContainer; + private Container barLineContainer; private Container judgementContainer; private Container hitObjectContainer; @@ -105,10 +106,10 @@ namespace osu.Game.Modes.Taiko.UI Scale = new Vector2(PLAYFIELD_SCALE), BlendingMode = BlendingMode.Additive }, - //barLineContainer = new Container - //{ - // RelativeSizeAxes = Axes.Both, - //}, + barLineContainer = new Container + { + RelativeSizeAxes = Axes.Both, + }, new HitTarget { Anchor = Anchor.CentreLeft, diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index a9b0babfe5..84c7d83d6a 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -52,6 +52,8 @@ + + From 507e4534094be93b50bf5423e6d4bda08c4846cf Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 21:26:01 +0900 Subject: [PATCH 03/13] Implement barline conversion from control points. --- osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs | 79 +++++++++++++++++++++ osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs | 5 ++ 2 files changed, 84 insertions(+) diff --git a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs index 80e42cb976..d88ffa7ae2 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs @@ -1,11 +1,16 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Allocation; +using osu.Framework.MathUtils; using osu.Game.Beatmaps; +using osu.Game.Beatmaps.Timing; using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Objects.Types; using osu.Game.Modes.Taiko.Beatmaps; using osu.Game.Modes.Taiko.Judgements; using osu.Game.Modes.Taiko.Objects; +using osu.Game.Modes.Taiko.Objects.Drawable; using osu.Game.Modes.UI; namespace osu.Game.Modes.Taiko.UI @@ -17,6 +22,80 @@ namespace osu.Game.Modes.Taiko.UI { } + [BackgroundDependencyLoader] + private void load() + { + loadBarLines(); + } + + private void loadBarLines() + { + var taikoPlayfield = Playfield as TaikoPlayfield; + + if (taikoPlayfield == null) + return; + + TaikoHitObject lastObject = Beatmap.HitObjects[Beatmap.HitObjects.Count - 1]; + // ReSharper disable once SuspiciousTypeConversion.Global (will be fixed with hitobjects) + double lastHitTime = 1 + (lastObject as IHasEndTime)?.EndTime ?? lastObject.StartTime; + + var timingPoints = Beatmap.TimingInfo.ControlPoints.FindAll(cp => cp.TimingChange); + + if (timingPoints == null || timingPoints.Count == 0) + return; + + int currentIndex = 0; + + while (currentIndex < timingPoints.Count && Precision.AlmostEquals(timingPoints[currentIndex].BeatLength, 0)) + currentIndex++; + + double time = timingPoints[currentIndex].Time; + double measureLength = timingPoints[currentIndex].BeatLength * (int)timingPoints[currentIndex].TimeSignature; + + // Find the bar line time closest to 0 + time -= measureLength * (int)(time / measureLength); + + // Always start barlines from a positive time + while (time < 0) + time += measureLength; + + int currentBeat = 0; + while (time <= lastHitTime) + { + ControlPoint current = timingPoints[currentIndex]; + + if (time > current.Time || current.OmitFirstBarLine) + { + bool isMajor = currentBeat % (int)current.TimeSignature == 0; + + BarLine barLine = new BarLine + { + StartTime = time, + }; + + barLine.ApplyDefaults(Beatmap.TimingInfo, Beatmap.BeatmapInfo.Difficulty); + + taikoPlayfield.AddBarLine(isMajor ? new DrawableMajorBarLine(barLine) : new DrawableBarLine(barLine)); + + currentBeat++; + } + + double bl = current.BeatLength; + + if (bl < 800) + bl *= (int)current.TimeSignature; + + time += bl; + + if (currentIndex + 1 >= timingPoints.Count || time < timingPoints[currentIndex + 1].Time) + continue; + + currentBeat = 0; + currentIndex++; + time = timingPoints[currentIndex].Time; + } + } + public override ScoreProcessor CreateScoreProcessor() => new TaikoScoreProcessor(this); protected override IBeatmapConverter CreateBeatmapConverter() => new TaikoBeatmapConverter(); diff --git a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs index 7ba3561cd4..993eaaabe7 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs @@ -181,6 +181,11 @@ namespace osu.Game.Modes.Taiko.UI base.Add(h); } + public void AddBarLine(DrawableBarLine barLine) + { + barLineContainer.Add(barLine); + } + public override void OnJudgement(DrawableHitObject judgedObject) { if (judgedObject.Judgement.Result == HitResult.Hit) From e1f8f44b32688d53716b3ad53ad7605590695c6b Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 21:26:55 +0900 Subject: [PATCH 04/13] Woops forgot to commit framework. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index e6394035d4..fd31d7451a 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit e6394035d443d4498b71e845e5763dd3faf98c7c +Subproject commit fd31d7451aa2f892bdb832f5f6dbc73b2959e57c From 9f3def05ef77440f782e16e305ab14e5670cc8ca Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 21:27:20 +0900 Subject: [PATCH 05/13] Add test case for bar lines. --- .../Tests/TestCaseTaikoPlayfield.cs | 22 +++++++++++++++++++ osu.Game.Modes.Taiko/Objects/BarLine.cs | 10 ++++----- .../Objects/Drawable/DrawableBarLine.cs | 9 ++++---- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 289e105f71..741520a798 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -3,6 +3,7 @@ using osu.Framework.MathUtils; using osu.Framework.Screens.Testing; +using osu.Framework.Timing; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; using osu.Game.Modes.Taiko.Objects; @@ -17,12 +18,20 @@ namespace osu.Desktop.VisualTests.Tests private TaikoPlayfield playfield; + public TestCaseTaikoPlayfield() + { + Clock = new FramedClock(); + } + public override void Reset() { base.Reset(); + Clock.ProcessFrame(); + AddButton("Hit!", addHitJudgement); AddButton("Miss :(", addMissJudgement); + AddButton("Add bar line", addBarLine); Add(playfield = new TaikoPlayfield { @@ -61,6 +70,19 @@ namespace osu.Desktop.VisualTests.Tests }); } + private void addBarLine() + { + bool isMajor = RNG.Next(8) == 0; + + BarLine bl = new BarLine + { + StartTime = Time.Current + 1000, + PreEmpt = 1000 + }; + + playfield.AddBarLine(isMajor ? new DrawableMajorBarLine(bl) : new DrawableBarLine(bl)); + } + private class DrawableTestHit : DrawableHitObject { public DrawableTestHit(TaikoHitObject hitObject) diff --git a/osu.Game.Modes.Taiko/Objects/BarLine.cs b/osu.Game.Modes.Taiko/Objects/BarLine.cs index 6c79d2172c..0af36d0603 100644 --- a/osu.Game.Modes.Taiko/Objects/BarLine.cs +++ b/osu.Game.Modes.Taiko/Objects/BarLine.cs @@ -1,4 +1,7 @@ -using osu.Game.Beatmaps.Timing; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Beatmaps.Timing; using osu.Game.Database; namespace osu.Game.Modes.Taiko.Objects @@ -15,11 +18,6 @@ namespace osu.Game.Modes.Taiko.Objects /// public double PreEmpt; - /// - /// Whether this is a major bar line (affects display). - /// - public bool IsMajor; - public void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty) { PreEmpt = 600 / (timing.SliderVelocityAt(StartTime) * difficulty.SliderMultiplier) * 1000; diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs index 17c869d739..958197ef03 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs @@ -4,7 +4,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -using osu.Game.Modes.Taiko.UI; using OpenTK; namespace osu.Game.Modes.Taiko.Objects.Drawable @@ -49,16 +48,16 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable Alpha = 0.75f } }; - - LifetimeStart = BarLine.StartTime - BarLine.PreEmpt * 2; - LifetimeEnd = BarLine.StartTime + BarLine.PreEmpt; } protected override void LoadComplete() { base.LoadComplete(); - Delay(BarLine.StartTime); + LifetimeStart = BarLine.StartTime - BarLine.PreEmpt * 2; + LifetimeEnd = BarLine.StartTime + BarLine.PreEmpt; + + Delay(BarLine.StartTime - Time.Current); FadeOut(100 * BarLine.PreEmpt / 1000); } From 38bbf2ac77492298771b4ba4bc2122f66a959552 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 1 Apr 2017 23:59:44 +0900 Subject: [PATCH 06/13] Fix post-merge errors. --- osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs | 2 +- osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs | 4 +++- osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 99ca025ae4..28e25ac81e 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -35,9 +35,9 @@ namespace osu.Desktop.VisualTests.Tests AddStep("Swell", addSwell); AddStep("Centre", () => addCentreHit(false)); AddStep("Strong Centre", () => addCentreHit(true)); - AddButton("Add bar line", addBarLine); AddStep("Rim", () => addRimHit(false)); AddStep("Strong Rim", () => addRimHit(true)); + AddStep("Add bar line", addBarLine); Add(new Container { diff --git a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs index 7086dcfbc6..50bcc791ae 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs @@ -6,11 +6,13 @@ using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Timing; using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Objects.Types; using osu.Game.Modes.Replays; using osu.Game.Modes.Scoring; using osu.Game.Modes.Taiko.Beatmaps; using osu.Game.Modes.Taiko.Judgements; using osu.Game.Modes.Taiko.Objects; +using osu.Game.Modes.Taiko.Objects.Drawable; using osu.Game.Modes.Taiko.Replays; using osu.Game.Modes.Taiko.Scoring; using osu.Game.Modes.UI; @@ -70,7 +72,7 @@ namespace osu.Game.Modes.Taiko.UI { bool isMajor = currentBeat % (int)current.TimeSignature == 0; - BarLine barLine = new BarLine + var barLine = new BarLine { StartTime = time, }; diff --git a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs index d9eae9a773..0e46f9bc73 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs @@ -39,7 +39,7 @@ namespace osu.Game.Modes.Taiko.UI protected override Container Content => hitObjectContainer; private readonly Container hitExplosionContainer; - private Container barLineContainer; + private readonly Container barLineContainer; private readonly Container judgementContainer; private readonly Container hitObjectContainer; From 2510a9fd3297f98944445f869644b2a4f6515cb3 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sun, 2 Apr 2017 02:06:58 +0900 Subject: [PATCH 07/13] Cleanups. --- osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs | 6 ------ osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs | 9 +++++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 28e25ac81e..17edb017ab 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -6,7 +6,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.MathUtils; using osu.Framework.Testing; -using osu.Framework.Timing; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; using osu.Game.Modes.Taiko.Objects; @@ -21,11 +20,6 @@ namespace osu.Desktop.VisualTests.Tests private TaikoPlayfield playfield; - public TestCaseTaikoPlayfield() - { - Clock = new FramedClock(); - } - public override void Reset() { base.Reset(); diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs index 958197ef03..10ac10e269 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs @@ -14,12 +14,12 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable public class DrawableBarLine : Container { /// - /// The line. + /// The visual line tracker. /// protected Box Tracker; /// - /// The + /// The bar line. /// protected readonly BarLine BarLine; @@ -61,12 +61,13 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable FadeOut(100 * BarLine.PreEmpt / 1000); } - private void moveToTimeOffset(double time) => MoveToX((float)((BarLine.StartTime - time) / BarLine.PreEmpt)); + private void updateScrollPosition(double time) => MoveToX((float)((BarLine.StartTime - time) / BarLine.PreEmpt)); protected override void Update() { base.Update(); - moveToTimeOffset(Time.Current); + + updateScrollPosition(Time.Current); } } } \ No newline at end of file From 0745098783e52759bf2e67696de3d78435fda523 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 3 Apr 2017 10:04:13 +0900 Subject: [PATCH 08/13] Cleanup. --- .../Tests/TestCaseTaikoPlayfield.cs | 9 +++---- .../Objects/Drawable/DrawableBarLine.cs | 16 +++++++++--- .../Objects/Drawable/DrawableMajorBarLine.cs | 26 ++++++++++--------- 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 17edb017ab..11855953c7 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -31,7 +31,8 @@ namespace osu.Desktop.VisualTests.Tests AddStep("Strong Centre", () => addCentreHit(true)); AddStep("Rim", () => addRimHit(false)); AddStep("Strong Rim", () => addRimHit(true)); - AddStep("Add bar line", addBarLine); + AddStep("Add bar line", () => addBarLine(false)); + AddStep("Add major bar line", () => addBarLine(true)); Add(new Container { @@ -74,17 +75,15 @@ namespace osu.Desktop.VisualTests.Tests }); } - private void addBarLine() + private void addBarLine(bool major) { - bool isMajor = RNG.Next(8) == 0; - BarLine bl = new BarLine { StartTime = Time.Current + 1000, PreEmpt = 1000 }; - playfield.AddBarLine(isMajor ? new DrawableMajorBarLine(bl) : new DrawableBarLine(bl)); + playfield.AddBarLine(major ? new DrawableMajorBarLine(bl) : new DrawableBarLine(bl)); } private void addSwell() diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs index 10ac10e269..8c963a8e4f 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs @@ -13,6 +13,16 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable /// public class DrawableBarLine : Container { + /// + /// The width of the line tracker. + /// + private const float tracker_width = 2f; + + /// + /// Fade out time calibrated to a pre-empt of 1000ms. + /// + private const float base_fadeout_time = 100f; + /// /// The visual line tracker. /// @@ -33,7 +43,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable RelativePositionAxes = Axes.X; RelativeSizeAxes = Axes.Y; - Width = 2f; + Width = tracker_width; Children = new[] { @@ -41,9 +51,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { Anchor = Anchor.Centre, Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - EdgeSmoothness = new Vector2(0.5f, 0), Alpha = 0.75f } @@ -58,7 +66,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable LifetimeEnd = BarLine.StartTime + BarLine.PreEmpt; Delay(BarLine.StartTime - Time.Current); - FadeOut(100 * BarLine.PreEmpt / 1000); + FadeOut(base_fadeout_time * BarLine.PreEmpt / 1000); } private void updateScrollPosition(double time) => MoveToX((float)((BarLine.StartTime - time) / BarLine.PreEmpt)); diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs index ca5a6f9299..684ea93dec 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs @@ -10,6 +10,16 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { public class DrawableMajorBarLine : DrawableBarLine { + /// + /// The vertical offset of the triangles from the line tracker. + /// + private const float triangle_offfset = 10f; + + /// + /// The size of the triangles. + /// + private const float triangle_size = 20f; + public DrawableMajorBarLine(BarLine barLine) : base(barLine) { @@ -17,33 +27,25 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { Anchor = Anchor.Centre, Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - Children = new[] { new EquilateralTriangle { Name = "Top", - Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - - Position = new Vector2(0, -10), - Size = new Vector2(-20), - + Position = new Vector2(0, -triangle_offfset), + Size = new Vector2(-triangle_size), EdgeSmoothness = new Vector2(1), }, new EquilateralTriangle { Name = "Bottom", - Anchor = Anchor.BottomCentre, Origin = Anchor.TopCentre, - - Position = new Vector2(0, 10), - Size = new Vector2(20), - + Position = new Vector2(0, triangle_offfset), + Size = new Vector2(triangle_size), EdgeSmoothness = new Vector2(1), } } From e7b55f9beabbe6113c1a7d464988dea04afb9946 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 3 Apr 2017 14:49:26 +0900 Subject: [PATCH 09/13] Fix bar line pre empt time calculation. --- osu.Game.Modes.Taiko/Objects/BarLine.cs | 2 +- osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/BarLine.cs b/osu.Game.Modes.Taiko/Objects/BarLine.cs index 0af36d0603..a6eceb2e48 100644 --- a/osu.Game.Modes.Taiko/Objects/BarLine.cs +++ b/osu.Game.Modes.Taiko/Objects/BarLine.cs @@ -20,7 +20,7 @@ namespace osu.Game.Modes.Taiko.Objects public void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty) { - PreEmpt = 600 / (timing.SliderVelocityAt(StartTime) * difficulty.SliderMultiplier) * 1000; + PreEmpt = TaikoHitObject.BASE_SCROLL_TIME / difficulty.SliderMultiplier * timing.BeatLengthAt(StartTime) * timing.SpeedMultiplierAt(StartTime) / 1000; } } } diff --git a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs index 327c0402ab..bc7e3d82d6 100644 --- a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs +++ b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs @@ -17,7 +17,7 @@ namespace osu.Game.Modes.Taiko.Objects /// /// Time (in milliseconds) to scroll in the hit object with a speed-adjusted beat length of 1 second. /// - private const double base_scroll_time = 6000; + public const double BASE_SCROLL_TIME = 6000; /// /// The time to scroll in the HitObject. @@ -39,7 +39,7 @@ namespace osu.Game.Modes.Taiko.Objects { base.ApplyDefaults(timing, difficulty); - PreEmpt = base_scroll_time / difficulty.SliderMultiplier * timing.BeatLengthAt(StartTime) * timing.SpeedMultiplierAt(StartTime) / 1000; + PreEmpt = BASE_SCROLL_TIME / difficulty.SliderMultiplier * timing.BeatLengthAt(StartTime) * timing.SpeedMultiplierAt(StartTime) / 1000; ControlPoint overridePoint; Kiai = timing.TimingPointAt(StartTime, out overridePoint).KiaiMode; From 7edabe730a920266fa1e27ec567c2ff905546655 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 3 Apr 2017 21:10:39 +0900 Subject: [PATCH 10/13] Cleanup. --- osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs index a22ef11f7d..a44410c4a4 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs @@ -14,10 +14,8 @@ using osu.Game.Modes.Taiko.Beatmaps; using osu.Game.Modes.Taiko.Judgements; using osu.Game.Modes.Taiko.Objects; using osu.Game.Modes.Taiko.Objects.Drawable; -using osu.Game.Modes.Taiko.Replays; using osu.Game.Modes.Taiko.Scoring; using osu.Game.Modes.UI; -using osu.Game.Modes.Replays; using osu.Game.Modes.Taiko.Replays; namespace osu.Game.Modes.Taiko.UI @@ -48,7 +46,7 @@ namespace osu.Game.Modes.Taiko.UI var timingPoints = Beatmap.TimingInfo.ControlPoints.FindAll(cp => cp.TimingChange); - if (timingPoints == null || timingPoints.Count == 0) + if (timingPoints.Count == 0) return; int currentIndex = 0; From 353cf2a0264b530ec8067ab93aedf25716b907d5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 4 Apr 2017 10:32:57 +0900 Subject: [PATCH 11/13] Adjust timings to make TestCase more usable. --- osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 14af26dbe4..7d606d7dd3 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -19,6 +19,8 @@ namespace osu.Desktop.VisualTests.Tests private TaikoPlayfield playfield; + protected override double TimePerAction => 500; + public override void Reset() { base.Reset(); @@ -91,7 +93,7 @@ namespace osu.Desktop.VisualTests.Tests playfield.Add(new DrawableSwell(new Swell { StartTime = Time.Current + 1000, - EndTime = Time.Current + 5000, + EndTime = Time.Current + 1000, PreEmpt = 1000 })); } @@ -101,7 +103,7 @@ namespace osu.Desktop.VisualTests.Tests var d = new DrumRoll { StartTime = Time.Current + 1000, - Distance = 20000, + Distance = 1000, PreEmpt = 1000, }; From 2df360a5e9daa9926b951709907bd5373754b2df Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 4 Apr 2017 12:38:55 +0900 Subject: [PATCH 12/13] Fix clashing namespace. --- .../Tests/TestCaseTaikoHitObjects.cs | 2 +- .../Tests/TestCaseTaikoPlayfield.cs | 2 +- .../DrawableBarLine.cs | 2 +- .../DrawableCentreHit.cs | 8 ++--- .../DrawableDrumRoll.cs | 10 +++--- .../DrawableDrumRollTick.cs | 10 +++--- .../{Drawable => Drawables}/DrawableHit.cs | 12 +++---- .../DrawableMajorBarLine.cs | 2 +- .../{Drawable => Drawables}/DrawableRimHit.cs | 4 +-- .../DrawableStrongCentreHit.cs | 6 ++-- .../DrawableStrongDrumRoll.cs | 4 +-- .../DrawableStrongHit.cs | 4 +-- .../DrawableStrongRimHit.cs | 4 +-- .../{Drawable => Drawables}/DrawableSwell.cs | 20 +++++------ .../DrawableTaikoHitObject.cs | 8 ++--- .../Pieces/CentreHitSymbolPiece.cs | 4 +-- .../Pieces/CirclePiece.cs | 12 +++---- .../Pieces/RimHitSymbolPiece.cs | 4 +-- .../Pieces/StrongCirclePiece.cs | 2 +- .../Pieces/SwellSymbolPiece.cs | 4 +-- osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs | 2 +- osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs | 2 +- .../osu.Game.Modes.Taiko.csproj | 36 +++++++++---------- 23 files changed, 82 insertions(+), 82 deletions(-) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/DrawableBarLine.cs (94%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/DrawableCentreHit.cs (85%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/DrawableDrumRoll.cs (94%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/DrawableDrumRollTick.cs (95%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/DrawableHit.cs (91%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/DrawableMajorBarLine.cs (94%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/DrawableRimHit.cs (85%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/DrawableStrongCentreHit.cs (85%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/DrawableStrongDrumRoll.cs (82%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/DrawableStrongHit.cs (95%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/DrawableStrongRimHit.cs (85%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/DrawableSwell.cs (94%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/DrawableTaikoHitObject.cs (95%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/Pieces/CentreHitSymbolPiece.cs (90%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/Pieces/CirclePiece.cs (92%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/Pieces/RimHitSymbolPiece.cs (91%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/Pieces/StrongCirclePiece.cs (90%) rename osu.Game.Modes.Taiko/Objects/{Drawable => Drawables}/Pieces/SwellSymbolPiece.cs (88%) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs index 7aeb75ef8d..1f0bdf40e0 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs @@ -6,7 +6,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Testing; -using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; +using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; namespace osu.Desktop.VisualTests.Tests { diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs index 7d606d7dd3..c7ef33c573 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoPlayfield.cs @@ -8,7 +8,7 @@ using osu.Framework.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.Objects.Drawables; using osu.Game.Modes.Taiko.UI; namespace osu.Desktop.VisualTests.Tests diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableBarLine.cs similarity index 94% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/DrawableBarLine.cs index 8c963a8e4f..6567975796 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableBarLine.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableBarLine.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using OpenTK; -namespace osu.Game.Modes.Taiko.Objects.Drawable +namespace osu.Game.Modes.Taiko.Objects.Drawables { /// /// A line that scrolls alongside hit objects in the playfield and visualises control points. diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableCentreHit.cs similarity index 85% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/DrawableCentreHit.cs index 76eb6bb77d..c79351f4d9 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableCentreHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableCentreHit.cs @@ -1,12 +1,12 @@ // 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.Game.Modes.Taiko.Objects.Drawable.Pieces; -using osu.Game.Graphics; using osu.Framework.Allocation; +using osu.Game.Graphics; +using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Objects.Drawable +namespace osu.Game.Modes.Taiko.Objects.Drawables { public class DrawableCentreHit : DrawableHit { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableDrumRoll.cs similarity index 94% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/DrawableDrumRoll.cs index ea6b0043d7..4e8d75315d 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableDrumRoll.cs @@ -1,18 +1,18 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using OpenTK.Graphics; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.MathUtils; using osu.Game.Graphics; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; -using System.Linq; +using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using OpenTK; +using OpenTK.Graphics; -namespace osu.Game.Modes.Taiko.Objects.Drawable +namespace osu.Game.Modes.Taiko.Objects.Drawables { public class DrawableDrumRoll : DrawableTaikoHitObject { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableDrumRollTick.cs similarity index 95% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/DrawableDrumRollTick.cs index b7509bc51d..85f9e32c6c 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableDrumRollTick.cs @@ -1,17 +1,17 @@ // 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.Game.Modes.Taiko.Judgements; using System; -using osu.Game.Modes.Objects.Drawables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Taiko.Judgements; using OpenTK; using OpenTK.Graphics; -using osu.Framework.Graphics.Sprites; +using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Objects.Drawable +namespace osu.Game.Modes.Taiko.Objects.Drawables { public class DrawableDrumRollTick : DrawableTaikoHitObject { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableHit.cs similarity index 91% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/DrawableHit.cs index 87f0e76f60..25ecd5ac84 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableHit.cs @@ -1,16 +1,16 @@ // 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.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; -using System; -using System.Linq; +using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Objects.Drawable +namespace osu.Game.Modes.Taiko.Objects.Drawables { public abstract class DrawableHit : DrawableTaikoHitObject { @@ -19,7 +19,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable /// protected abstract Key[] HitKeys { get; } - protected override Container Content => bodyContainer; + protected override Container Content => bodyContainer; protected readonly CirclePiece Circle; diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableMajorBarLine.cs similarity index 94% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/DrawableMajorBarLine.cs index 684ea93dec..14d3d84f4b 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableMajorBarLine.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableMajorBarLine.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using OpenTK; -namespace osu.Game.Modes.Taiko.Objects.Drawable +namespace osu.Game.Modes.Taiko.Objects.Drawables { public class DrawableMajorBarLine : DrawableBarLine { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableRimHit.cs b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableRimHit.cs similarity index 85% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableRimHit.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/DrawableRimHit.cs index 893a6fbb4d..0fa51b1661 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableRimHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableRimHit.cs @@ -3,10 +3,10 @@ using osu.Framework.Allocation; using osu.Game.Graphics; +using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; using OpenTK.Input; -using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; -namespace osu.Game.Modes.Taiko.Objects.Drawable +namespace osu.Game.Modes.Taiko.Objects.Drawables { public class DrawableRimHit : DrawableHit { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableStrongCentreHit.cs similarity index 85% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/DrawableStrongCentreHit.cs index bac44f48fb..815c19779a 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongCentreHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableStrongCentreHit.cs @@ -1,12 +1,12 @@ // 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.Game.Modes.Taiko.Objects.Drawable.Pieces; using osu.Framework.Allocation; using osu.Game.Graphics; +using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Objects.Drawable +namespace osu.Game.Modes.Taiko.Objects.Drawables { public class DrawableStrongCentreHit : DrawableStrongHit { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongDrumRoll.cs b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableStrongDrumRoll.cs similarity index 82% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongDrumRoll.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/DrawableStrongDrumRoll.cs index e9723a0162..bb7e197502 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongDrumRoll.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableStrongDrumRoll.cs @@ -2,9 +2,9 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; +using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; -namespace osu.Game.Modes.Taiko.Objects.Drawable +namespace osu.Game.Modes.Taiko.Objects.Drawables { public class DrawableStrongDrumRoll : DrawableDrumRoll { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableStrongHit.cs similarity index 95% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/DrawableStrongHit.cs index a6cb6ae7fa..116ef94ee4 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableStrongHit.cs @@ -1,14 +1,14 @@ // 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; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; +using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Objects.Drawable +namespace osu.Game.Modes.Taiko.Objects.Drawables { public abstract class DrawableStrongHit : DrawableHit { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongRimHit.cs b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableStrongRimHit.cs similarity index 85% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongRimHit.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/DrawableStrongRimHit.cs index 985ba1c2df..3af0ff399b 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongRimHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableStrongRimHit.cs @@ -3,10 +3,10 @@ using osu.Framework.Allocation; using osu.Game.Graphics; +using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; using OpenTK.Input; -using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; -namespace osu.Game.Modes.Taiko.Objects.Drawable +namespace osu.Game.Modes.Taiko.Objects.Drawables { public class DrawableStrongRimHit : DrawableStrongHit { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableSwell.cs similarity index 94% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/DrawableSwell.cs index ec1ab42bfc..717cda9126 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableSwell.cs @@ -1,9 +1,8 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using OpenTK.Graphics; -using OpenTK.Input; +using System; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; @@ -12,11 +11,12 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; -using System; -using System.Linq; +using osu.Game.Modes.Taiko.Objects.Drawables.Pieces; +using OpenTK; +using OpenTK.Graphics; +using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Objects.Drawable +namespace osu.Game.Modes.Taiko.Objects.Drawables { public class DrawableSwell : DrawableTaikoHitObject { @@ -56,11 +56,11 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { this.swell = swell; - Children = new Framework.Graphics.Drawable[] + Children = new Drawable[] { bodyContainer = new Container { - Children = new Framework.Graphics.Drawable[] + Children = new Drawable[] { expandingRing = new CircularContainer { @@ -89,7 +89,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable Masking = true, BorderThickness = target_ring_thick_border, BlendingMode = BlendingMode.Additive, - Children = new Framework.Graphics.Drawable[] + Children = new Drawable[] { new Box { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs similarity index 95% rename from osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs index 8da05d8bed..5f85903827 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs @@ -1,14 +1,14 @@ // 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.Graphics; +using osu.Framework.Input; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; -using System.Collections.Generic; -using osu.Framework.Input; +using OpenTK.Input; -namespace osu.Game.Modes.Taiko.Objects.Drawable +namespace osu.Game.Modes.Taiko.Objects.Drawables { public abstract class DrawableTaikoHitObject : DrawableHitObject { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CentreHitSymbolPiece.cs b/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs similarity index 90% rename from osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CentreHitSymbolPiece.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs index e62ca6b073..0cf4e97b41 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CentreHitSymbolPiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs @@ -1,12 +1,12 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics.Containers; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using OpenTK; -namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces +namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces { /// /// The symbol used for centre hit pieces. diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CirclePiece.cs similarity index 92% rename from osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CirclePiece.cs index d51c06bcad..941ef3b37f 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/CirclePiece.cs @@ -1,16 +1,16 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; using osu.Game.Graphics.Backgrounds; using OpenTK.Graphics; -using System; -using osu.Game.Graphics; -namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces +namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces { /// /// A circle piece which is used uniformly through osu!taiko to visualise hitobjects. @@ -63,7 +63,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces set { throw new InvalidOperationException($"{nameof(CirclePiece)} must always use CentreLeft origin."); } } - protected override Container Content => SymbolContainer; + protected override Container Content => SymbolContainer; protected readonly Container SymbolContainer; private readonly Container background; @@ -81,7 +81,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Y, - Children = new Framework.Graphics.Drawable[] + Children = new Drawable[] { background = new CircularContainer { @@ -90,7 +90,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Masking = true, - Children = new Framework.Graphics.Drawable[] + Children = new Drawable[] { new Box { diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/RimHitSymbolPiece.cs b/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs similarity index 91% rename from osu.Game.Modes.Taiko/Objects/Drawable/Pieces/RimHitSymbolPiece.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs index 6999634108..6e19497978 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/RimHitSymbolPiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs @@ -1,13 +1,13 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics.Containers; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; -namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces +namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces { /// /// The symbol used for rim hit pieces. diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/StrongCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/StrongCirclePiece.cs similarity index 90% rename from osu.Game.Modes.Taiko/Objects/Drawable/Pieces/StrongCirclePiece.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/Pieces/StrongCirclePiece.cs index 319ca17cb8..9676c4a19f 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/StrongCirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/StrongCirclePiece.cs @@ -3,7 +3,7 @@ using OpenTK; -namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces +namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces { /// /// A type of circle piece which is drawn at a higher scale to represent a "strong" piece. diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/SwellSymbolPiece.cs b/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs similarity index 88% rename from osu.Game.Modes.Taiko/Objects/Drawable/Pieces/SwellSymbolPiece.cs rename to osu.Game.Modes.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs index 2bd86406a7..e491793902 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/SwellSymbolPiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs @@ -1,10 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Graphics; using osu.Framework.Graphics; +using osu.Game.Graphics; -namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces +namespace osu.Game.Modes.Taiko.Objects.Drawables.Pieces { /// /// The symbol used for swell pieces. diff --git a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs index a44410c4a4..9399994078 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs @@ -13,7 +13,7 @@ using osu.Game.Modes.Scoring; using osu.Game.Modes.Taiko.Beatmaps; using osu.Game.Modes.Taiko.Judgements; using osu.Game.Modes.Taiko.Objects; -using osu.Game.Modes.Taiko.Objects.Drawable; +using osu.Game.Modes.Taiko.Objects.Drawables; using osu.Game.Modes.Taiko.Scoring; using osu.Game.Modes.UI; using osu.Game.Modes.Taiko.Replays; diff --git a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs index 65cb0db33e..958055d768 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs @@ -14,8 +14,8 @@ using osu.Game.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics.Primitives; -using osu.Game.Modes.Taiko.Objects.Drawable; using System.Linq; +using osu.Game.Modes.Taiko.Objects.Drawables; namespace osu.Game.Modes.Taiko.UI { diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index 261dda95ed..1fbf1b27a1 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -54,25 +54,25 @@ - - + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + From 1654e7423559496a6a6d09411097b490af1b7eda Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 4 Apr 2017 16:37:10 +0900 Subject: [PATCH 13/13] Remove unnecessary CI override. --- osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs index 9399994078..c1ee1f6691 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs @@ -41,7 +41,6 @@ namespace osu.Game.Modes.Taiko.UI return; TaikoHitObject lastObject = Beatmap.HitObjects[Beatmap.HitObjects.Count - 1]; - // ReSharper disable once SuspiciousTypeConversion.Global (will be fixed with hitobjects) double lastHitTime = 1 + (lastObject as IHasEndTime)?.EndTime ?? lastObject.StartTime; var timingPoints = Beatmap.TimingInfo.ControlPoints.FindAll(cp => cp.TimingChange);