diff --git a/osu.Game.Rulesets.Mania/Objects/BarLine.cs b/osu.Game.Rulesets.Mania/Objects/BarLine.cs index b635977fd1..50e326086e 100644 --- a/osu.Game.Rulesets.Mania/Objects/BarLine.cs +++ b/osu.Game.Rulesets.Mania/Objects/BarLine.cs @@ -1,5 +1,4 @@ using osu.Game.Beatmaps.ControlPoints; -using osu.Game.Rulesets.Objects; namespace osu.Game.Rulesets.Mania.Objects { @@ -12,7 +11,7 @@ namespace osu.Game.Rulesets.Mania.Objects /// /// The index of the beat which this bar line represents within the control point. - /// This is a "major" beat at % == 0. + /// This is a "major" bar line if % == 0. /// public int BeatIndex; } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs index e253989ebc..7554472507 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs @@ -1,10 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using OpenTK; -using OpenTK.Input; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Game.Rulesets.Objects.Drawables; @@ -17,18 +14,28 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables /// public class DrawableBarLine : DrawableManiaHitObject { + /// + /// Height of major bar line triangles. + /// + private const float triangle_height = 12; + + /// + /// Offset of the major bar line triangles from the sides of the bar line. + /// + private const float triangle_offset = 9; + public DrawableBarLine(BarLine barLine) - : base(barLine, null) + : base(barLine) { - AutoSizeAxes = Axes.Y; RelativeSizeAxes = Axes.X; + Height = 1; Add(new Box { + Name = "Bar line", Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, - RelativeSizeAxes = Axes.X, - Height = 1 + RelativeSizeAxes = Axes.Both, }); bool isMajor = barLine.BeatIndex % (int)barLine.ControlPoint.TimeSignature == 0; @@ -40,10 +47,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables Name = "Left triangle", Anchor = Anchor.BottomLeft, Origin = Anchor.TopCentre, - Size = new Vector2(12), - X = -9, - Rotation = 90, - BypassAutoSizeAxes = Axes.Both + Size = new Vector2(triangle_height), + X = -triangle_offset, + Rotation = 90 }); Add(new EquilateralTriangle @@ -51,10 +57,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables Name = "Right triangle", Anchor = Anchor.BottomRight, Origin = Anchor.TopCentre, - Size = new Vector2(12), - X = 9, - Rotation = -90, - BypassAutoSizeAxes = Axes.Both, + Size = new Vector2(triangle_height), + X = triangle_offset, + Rotation = -90 }); } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaHitRenderer.cs b/osu.Game.Rulesets.Mania/UI/ManiaHitRenderer.cs index 4ddb7ad42a..57477147d5 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaHitRenderer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaHitRenderer.cs @@ -99,6 +99,7 @@ namespace osu.Game.Rulesets.Mania.UI { TimingControlPoint point = timingPoints[i]; + // Stop on the beat before the next timing point, or if there is no next timing point stop slightly past the last object double endTime = i < timingPoints.Count - 1 ? timingPoints[i + 1].Time - point.BeatLength : lastObjectTime + point.BeatLength * (int)point.TimeSignature; int index = 0;