diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs index 9b1e1e4e3d..e253989ebc 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs @@ -17,8 +17,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables /// public class DrawableBarLine : DrawableManiaHitObject { - public DrawableBarLine(BarLine hitObject) - : base(hitObject, null) + public DrawableBarLine(BarLine barLine) + : base(barLine, null) { AutoSizeAxes = Axes.Y; RelativeSizeAxes = Axes.X; @@ -31,38 +31,35 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables Height = 1 }); - int signatureRelativeIndex = hitObject.BeatIndex % (int)hitObject.ControlPoint.TimeSignature; + bool isMajor = barLine.BeatIndex % (int)barLine.ControlPoint.TimeSignature == 0; - switch (signatureRelativeIndex) + if (isMajor) { - case 0: - Add(new EquilateralTriangle - { - Name = "Left triangle", - Anchor = Anchor.BottomLeft, - Origin = Anchor.TopCentre, - Size = new Vector2(12), - X = -9, - Rotation = 90, - BypassAutoSizeAxes = Axes.Both - }); + Add(new EquilateralTriangle + { + Name = "Left triangle", + Anchor = Anchor.BottomLeft, + Origin = Anchor.TopCentre, + Size = new Vector2(12), + X = -9, + Rotation = 90, + BypassAutoSizeAxes = Axes.Both + }); - Add(new EquilateralTriangle - { - Name = "Right triangle", - Anchor = Anchor.BottomRight, - Origin = Anchor.TopCentre, - Size = new Vector2(12), - X = 9, - Rotation = -90, - BypassAutoSizeAxes = Axes.Both, - }); - break; - case 1: - case 3: - Alpha = 0.2f; - break; + Add(new EquilateralTriangle + { + Name = "Right triangle", + Anchor = Anchor.BottomRight, + Origin = Anchor.TopCentre, + Size = new Vector2(12), + X = 9, + Rotation = -90, + BypassAutoSizeAxes = Axes.Both, + }); } + + if (!isMajor && barLine.BeatIndex % 2 == 1) + Alpha = 0.2f; } protected override void UpdateState(ArmedState state) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index d1b6fbaf7c..2e6b63579e 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Mania.UI private readonly FlowContainer columns; public IEnumerable Columns => columns.Children; - private readonly ControlPointContainer barlineContainer; + private readonly ControlPointContainer barLineContainer; private List normalColumnColours = new List(); private Color4 specialColumnColour; @@ -116,7 +116,7 @@ namespace osu.Game.Rulesets.Mania.UI Padding = new MarginPadding { Top = HIT_TARGET_POSITION }, Children = new[] { - barlineContainer = new ControlPointContainer(timingChanges) + barLineContainer = new ControlPointContainer(timingChanges) { Name = "Bar lines", Anchor = Anchor.TopCentre, @@ -207,7 +207,7 @@ namespace osu.Game.Rulesets.Mania.UI } public override void Add(DrawableHitObject h) => Columns.ElementAt(h.HitObject.Column).Add(h); - public void Add(DrawableBarLine barline) => barlineContainer.Add(barline); + public void Add(DrawableBarLine barline) => barLineContainer.Add(barline); protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { @@ -242,7 +242,7 @@ namespace osu.Game.Rulesets.Mania.UI timeSpan = MathHelper.Clamp(timeSpan, time_span_min, time_span_max); - barlineContainer.TimeSpan = value; + barLineContainer.TimeSpan = value; Columns.ForEach(c => c.ControlPointContainer.TimeSpan = value); } } @@ -256,7 +256,7 @@ namespace osu.Game.Rulesets.Mania.UI { // Due to masking differences, it is not possible to get the width of the columns container automatically // While masking on effectively only the Y-axis, so we need to set the width of the bar line container manually - barlineContainer.Width = columns.Width; + barLineContainer.Width = columns.Width; } private class TransformTimeSpan : Transform