1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

Fix mania bar lines not working.

This commit is contained in:
smoogipooo 2017-08-07 17:45:45 +09:00
parent 62ee613da3
commit 12f9793fec

View File

@ -48,8 +48,8 @@ namespace osu.Game.Rulesets.Mania.UI
private readonly FlowContainer<Column> columns; private readonly FlowContainer<Column> columns;
public IEnumerable<Column> Columns => columns.Children; public IEnumerable<Column> Columns => columns.Children;
protected override Container<Drawable> Content => barLineContainer; protected override Container<Drawable> Content => content;
private readonly Container<Drawable> barLineContainer; private readonly Container<Drawable> content;
private List<Color4> normalColumnColours = new List<Color4>(); private List<Color4> normalColumnColours = new List<Color4>();
private Color4 specialColumnColour; private Color4 specialColumnColour;
@ -108,7 +108,7 @@ namespace osu.Game.Rulesets.Mania.UI
Padding = new MarginPadding { Top = HIT_TARGET_POSITION }, Padding = new MarginPadding { Top = HIT_TARGET_POSITION },
Children = new[] Children = new[]
{ {
barLineContainer = new Container content = new Container
{ {
Name = "Bar lines", Name = "Bar lines",
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
@ -201,13 +201,13 @@ namespace osu.Game.Rulesets.Mania.UI
} }
public override void Add(DrawableHitObject<ManiaHitObject, ManiaJudgement> h) => Columns.ElementAt(h.HitObject.Column).Add(h); public override void Add(DrawableHitObject<ManiaHitObject, ManiaJudgement> h) => Columns.ElementAt(h.HitObject.Column).Add(h);
public void Add(DrawableBarLine barline) => barLineContainer.Add(barline); public void Add(DrawableBarLine barline) => HitObjects.Add(barline);
protected override void Update() protected override void Update()
{ {
// Due to masking differences, it is not possible to get the width of the columns container automatically // 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 // 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; content.Width = columns.Width;
} }
} }
} }