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); }