From 39b6425c3e7923730fd08fa09b81fd1148654aa6 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 19:55:15 +0900 Subject: [PATCH] Use a grid container to position the stages Should be more flexible in the future + provides a more dual-stage feel. --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 27 +++++--------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 9a148b6770..ba4909615d 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -3,13 +3,11 @@ using osu.Framework.Graphics; using osu.Game.Rulesets.Mania.Objects; -using OpenTK; using osu.Framework.Graphics.Containers; using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Configuration; -using osu.Framework.Extensions.IEnumerableExtensions; using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI.Scrolling; @@ -18,11 +16,6 @@ namespace osu.Game.Rulesets.Mania.UI { public class ManiaPlayfield : ScrollingPlayfield { - /// - /// s contained by this . - /// - private readonly FillFlowContainer stages; - /// /// Whether this playfield should be inverted. This flips everything inside the playfield. /// @@ -34,6 +27,7 @@ namespace osu.Game.Rulesets.Mania.UI public Bindable SpecialColumnPosition = new Bindable(); public List Columns => stages.SelectMany(x => x.Columns).ToList(); + private readonly List stages = new List(); public ManiaPlayfield(List stageDefinitions) : base(ScrollingDirection.Up) @@ -46,20 +40,11 @@ namespace osu.Game.Rulesets.Mania.UI Inverted.Value = true; - var stageSpacing = 300 / stageDefinitions.Count; - - InternalChildren = new Drawable[] + GridContainer playfieldGrid; + InternalChild = playfieldGrid = new GridContainer { - stages = new FillFlowContainer - { - Name = "Stages", - Direction = FillDirection.Horizontal, - RelativeSizeAxes = Axes.Y, - AutoSizeAxes = Axes.X, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Spacing = new Vector2(stageSpacing), - } + RelativeSizeAxes = Axes.Both, + Content = new[] { new Drawable[stageDefinitions.Count] } }; int firstColumnIndex = 0; @@ -70,6 +55,8 @@ namespace osu.Game.Rulesets.Mania.UI newStage.VisibleTimeRange.BindTo(VisibleTimeRange); newStage.Inverted.BindTo(Inverted); + playfieldGrid.Content[0][i] = newStage; + stages.Add(newStage); AddNested(newStage);