diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs index 70270af6c9..6e5290e277 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs @@ -9,7 +9,6 @@ using osu.Game.Rulesets.Mods; using osu.Game.Graphics; using osu.Game.Rulesets.Mania.Timing; using osu.Game.Rulesets.Timing; -using osu.Game.Rulesets.Mania.Objects.Drawables; namespace osu.Game.Rulesets.Mania.Mods { @@ -35,9 +34,9 @@ namespace osu.Game.Rulesets.Mania.Mods } // Like with hit objects, we need to generate one speed adjustment per bar line - foreach (DrawableBarLine barLine in rulesetContainer.BarLines) + foreach (BarLine barLine in rulesetContainer.BarLines) { - var controlPoint = rulesetContainer.CreateControlPointAt(barLine.HitObject.StartTime); + var controlPoint = rulesetContainer.CreateControlPointAt(barLine.StartTime); // Beat length has too large of an effect for gravity, so we'll force it to a constant value for now controlPoint.TimingPoint.BeatLength = 1000; @@ -45,4 +44,4 @@ namespace osu.Game.Rulesets.Mania.Mods } } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs index 03886f5784..48974b4bb8 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs @@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Mania.Tests RelativeChildSize = new Vector2(1, 10000), Children = new[] { - new DrawableHoldNote(new HoldNote(), ManiaAction.Key1) + new DrawableHoldNote(new HoldNote(){Duration = 1000}, ManiaAction.Key1) { Y = 5000, Height = 1000, diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index b5890b289f..37161a7d3d 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -2,12 +2,13 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; using System.Linq; using NUnit.Framework; using osu.Framework.Allocation; -using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Timing; +using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects.Drawables; @@ -40,6 +41,36 @@ namespace osu.Game.Rulesets.Mania.Tests AddStep("Right special style", () => createPlayfield(4, SpecialColumnPosition.Right)); AddStep("5 columns", () => createPlayfield(5, SpecialColumnPosition.Normal)); AddStep("8 columns", () => createPlayfield(8, SpecialColumnPosition.Normal)); + AddStep("4 + 4 columns", () => + { + var stages = new List() + { + new StageDefinition() { Columns = 4 }, + new StageDefinition() { Columns = 4 }, + }; + createPlayfield(stages, SpecialColumnPosition.Normal); + }); + AddStep("2 + 4 + 2 columns", () => + { + var stages = new List() + { + new StageDefinition() { Columns = 2 }, + new StageDefinition() { Columns = 4 }, + new StageDefinition() { Columns = 2 }, + }; + createPlayfield(stages, SpecialColumnPosition.Normal); + }); + AddStep("1 + 1 + 8 columns", () => + { + var stages = new List() + { + new StageDefinition() { Columns = 1 }, + new StageDefinition() { Columns = 8 }, + new StageDefinition() { Columns = 1 }, + }; + createPlayfield(stages, SpecialColumnPosition.Normal); + }); + AddStep("Left special style", () => createPlayfield(8, SpecialColumnPosition.Left)); AddStep("Right special style", () => createPlayfield(8, SpecialColumnPosition.Right)); AddStep("Reversed", () => createPlayfield(4, SpecialColumnPosition.Normal, true)); @@ -76,14 +107,24 @@ namespace osu.Game.Rulesets.Mania.Tests }, gravity ? ScrollingAlgorithm.Gravity : ScrollingAlgorithm.Basic); private ManiaPlayfield createPlayfield(int cols, SpecialColumnPosition specialPos, bool inverted = false) + { + var stages = new List() + { + new StageDefinition() { Columns = cols }, + }; + return createPlayfield(stages, specialPos, inverted); + } + + private ManiaPlayfield createPlayfield(List stages, SpecialColumnPosition specialPos, bool inverted = false) { Clear(); - var inputManager = new ManiaInputManager(maniaRuleset, cols) { RelativeSizeAxes = Axes.Both }; + var inputManager = new ManiaInputManager(maniaRuleset, stages.Sum(g => g.Columns)) { RelativeSizeAxes = Axes.Both }; Add(inputManager); ManiaPlayfield playfield; - inputManager.Add(playfield = new ManiaPlayfield(cols) + + inputManager.Add(playfield = new ManiaPlayfield(stages) { Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -105,7 +146,11 @@ namespace osu.Game.Rulesets.Mania.Tests Add(inputManager); ManiaPlayfield playfield; - inputManager.Add(playfield = new ManiaPlayfield(4) + var stages = new List() + { + new StageDefinition() { Columns = 4 }, + }; + inputManager.Add(playfield = new ManiaPlayfield(stages) { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 2d553f8639..f9535bd58c 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Mania.UI { Name = "Hit target + hit objects", RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = ManiaPlayfield.HIT_TARGET_POSITION }, + Padding = new MarginPadding { Top = ManiaColumnStage.HIT_TARGET_POSITION }, Children = new Drawable[] { new Container @@ -115,7 +115,7 @@ namespace osu.Game.Rulesets.Mania.UI { Name = "Key", RelativeSizeAxes = Axes.X, - Height = ManiaPlayfield.HIT_TARGET_POSITION, + Height = ManiaColumnStage.HIT_TARGET_POSITION, Children = new Drawable[] { new Box diff --git a/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs b/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs index 08478cef33..6a8e904537 100644 --- a/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs +++ b/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Mania.UI internal class DrawableManiaJudgement : DrawableJudgement { public DrawableManiaJudgement(Judgement judgement) - : base(judgement) + : base(judgement) { JudgementText.TextSize = 25; } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs new file mode 100644 index 0000000000..c0ee3536ff --- /dev/null +++ b/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs @@ -0,0 +1,210 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.UI; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Rulesets.Mania.UI +{ + /// + /// A collection of s. + /// + internal class ManiaColumnStage : ScrollingPlayfield + { + public const float HIT_TARGET_POSITION = 50; + + private SpecialColumnPosition specialColumnPosition; + + /// + /// The style to use for the special column. + /// + public SpecialColumnPosition SpecialColumnPosition + { + get { return specialColumnPosition; } + set + { + if (IsLoaded) + throw new InvalidOperationException($"Setting {nameof(SpecialColumnPosition)} after the playfield is loaded requires re-creating the playfield."); + specialColumnPosition = value; + } + } + + public IEnumerable Columns => columns.Children; + private readonly FillFlowContainer columns; + + protected override Container Content => content; + private readonly Container content; + + public Container Judgements => judgements; + private readonly Container judgements; + + private readonly Container topLevelContainer; + + private List normalColumnColours = new List(); + private Color4 specialColumnColour; + + public readonly int ColumnCount; + + public ManiaColumnStage(int columnCount) + : base(Axes.Y) + { + ColumnCount = columnCount; + Name = "Playfield elements"; + Anchor = Anchor.TopCentre; + Origin = Anchor.TopCentre; + //RelativeSizeAxes = Axes.Y; + //AutoSizeAxes = Axes.X; + InternalChildren = new Drawable[] + { + new Container + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, + Children = new Drawable[] + { + new Container + { + Name = "Columns mask", + RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, + Masking = true, + Children = new Drawable[] + { + new Box + { + Name = "Background", + RelativeSizeAxes = Axes.Both, + Colour = new Color4(0, 0, 0, 0.8f) + }, + columns = new FillFlowContainer + { + Name = "Columns", + RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, + Direction = FillDirection.Horizontal, + Padding = new MarginPadding { Left = 1, Right = 1 }, + Spacing = new Vector2(1, 0) + }, + } + }, + new Container + { + Name = "Barlines mask", + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.Y, + Width = 1366, // Bar lines should only be masked on the vertical axis + BypassAutoSizeAxes = Axes.Both, + Masking = true, + Child = content = new Container + { + Name = "Bar lines", + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.Y, + Padding = new MarginPadding { Top = HIT_TARGET_POSITION } + } + }, + judgements = new Container + { + Anchor = Anchor.TopCentre, + Origin = Anchor.Centre, + AutoSizeAxes = Axes.Both, + Y = HIT_TARGET_POSITION + 150, + BypassAutoSizeAxes = Axes.Both + }, + topLevelContainer = new Container { RelativeSizeAxes = Axes.Both } + } + } + }; + } + + /// + /// Whether the column index is a special column for this playfield. + /// + /// The 0-based column index. + /// Whether the column is a special column. + private bool isSpecialColumn(int column) + { + switch (SpecialColumnPosition) + { + default: + case SpecialColumnPosition.Normal: + return ColumnCount % 2 == 1 && column == ColumnCount / 2; + case SpecialColumnPosition.Left: + return column == 0; + case SpecialColumnPosition.Right: + return column == ColumnCount - 1; + } + } + + public void AddColumn(Column c) + { + c.VisibleTimeRange.BindTo(VisibleTimeRange); + topLevelContainer.Add(c.TopLevelContainer.CreateProxy()); + columns.Add(c); + } + + public void AddJudgement(Judgement judgement) + { + judgements.Clear(); + judgements.Add(new DrawableManiaJudgement(judgement) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + normalColumnColours = new List + { + colours.RedDark, + colours.GreenDark + }; + + specialColumnColour = colours.BlueDark; + + // Set the special column + colour + key + foreach (var column in Columns) + { + if (!column.IsSpecial) + continue; + + column.AccentColour = specialColumnColour; + } + + var nonSpecialColumns = Columns.Where(c => !c.IsSpecial).ToList(); + + // We'll set the colours of the non-special columns in a separate loop, because the non-special + // column colours are mirrored across their centre and special styles mess with this + for (int i = 0; i < Math.Ceiling(nonSpecialColumns.Count / 2f); i++) + { + Color4 colour = normalColumnColours[i % normalColumnColours.Count]; + nonSpecialColumns[i].AccentColour = colour; + nonSpecialColumns[nonSpecialColumns.Count - 1 - i].AccentColour = colour; + } + } + + + protected override void Update() + { + // 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 + content.Width = columns.Width; + } + } +} diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 6c164a34f0..66e866af38 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -1,153 +1,103 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Configuration; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mania.Objects.Drawables; +using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI; using OpenTK; -using OpenTK.Graphics; -using osu.Framework.Graphics.Containers; -using System; -using osu.Game.Graphics; -using osu.Framework.Allocation; -using System.Linq; -using System.Collections.Generic; -using osu.Framework.Configuration; -using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Mania.Objects.Drawables; -using osu.Framework.Graphics.Shapes; -using osu.Game.Rulesets.Judgements; namespace osu.Game.Rulesets.Mania.UI { public class ManiaPlayfield : ScrollingPlayfield { - public const float HIT_TARGET_POSITION = 50; - - private SpecialColumnPosition specialColumnPosition; /// - /// The style to use for the special column. + /// list mania column stages /// - public SpecialColumnPosition SpecialColumnPosition - { - get { return specialColumnPosition; } - set - { - if (IsLoaded) - throw new InvalidOperationException($"Setting {nameof(SpecialColumnPosition)} after the playfield is loaded requires re-creating the playfield."); - specialColumnPosition = value; - } - } + private readonly FillFlowContainer listColumnStages; /// /// Whether this playfield should be inverted. This flips everything inside the playfield. /// public readonly Bindable Inverted = new Bindable(true); - private readonly FlowContainer columns; - public IEnumerable Columns => columns.Children; + /// + /// The style to use for the special column. + /// + public SpecialColumnPosition SpecialColumnPosition + { + get => listColumnStages.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal; + set + { + foreach (var singleStage in listColumnStages) + { + singleStage.SpecialColumnPosition = value; + } + } + } - protected override Container Content => content; - private readonly Container content; + public List Columns + { + get + { + var list = new List(); + foreach (var stage in listColumnStages) + { + list.AddRange(stage.Columns); + } + return list; + } + } - private List normalColumnColours = new List(); - private Color4 specialColumnColour; - - private readonly Container judgements; - - private readonly int columnCount; - - public ManiaPlayfield(int columnCount) + public ManiaPlayfield(List stages) : base(Axes.Y) { - this.columnCount = columnCount; - - if (columnCount <= 0) + if (stages.Count <= 0) throw new ArgumentException("Can't have zero or fewer columns."); Inverted.Value = true; - Container topLevelContainer; InternalChildren = new Drawable[] { - new Container + listColumnStages = new FillFlowContainer { - Name = "Playfield elements", - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, + Direction = FillDirection.Horizontal, RelativeSizeAxes = Axes.Y, - AutoSizeAxes = Axes.X, - Children = new Drawable[] - { - new Container - { - Name = "Columns mask", - RelativeSizeAxes = Axes.Y, - AutoSizeAxes = Axes.X, - Masking = true, - Children = new Drawable[] - { - new Box - { - Name = "Background", - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black - }, - columns = new FillFlowContainer - { - Name = "Columns", - RelativeSizeAxes = Axes.Y, - AutoSizeAxes = Axes.X, - Direction = FillDirection.Horizontal, - Padding = new MarginPadding { Left = 1, Right = 1 }, - Spacing = new Vector2(1, 0) - }, - } - }, - new Container - { - Name = "Barlines mask", - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.Y, - Width = 1366, // Bar lines should only be masked on the vertical axis - BypassAutoSizeAxes = Axes.Both, - Masking = true, - Child = content = new Container - { - Name = "Bar lines", - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.Y, - Padding = new MarginPadding { Top = HIT_TARGET_POSITION } - } - }, - judgements = new Container - { - Anchor = Anchor.TopCentre, - Origin = Anchor.Centre, - AutoSizeAxes = Axes.Both, - Y = HIT_TARGET_POSITION + 150, - BypassAutoSizeAxes = Axes.Both - }, - topLevelContainer = new Container { RelativeSizeAxes = Axes.Both } - } + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Spacing = new Vector2(400), } }; var currentAction = ManiaAction.Key1; - for (int i = 0; i < columnCount; i++) + + foreach (var stage in stages) { - var c = new Column(); - c.VisibleTimeRange.BindTo(VisibleTimeRange); + var drawableStage = new ManiaColumnStage(stage.Columns); + drawableStage.VisibleTimeRange.BindTo(VisibleTimeRange); - c.IsSpecial = isSpecialColumn(i); - c.Action = c.IsSpecial ? ManiaAction.Special : currentAction++; + listColumnStages.Add(drawableStage); + AddNested(drawableStage); - topLevelContainer.Add(c.TopLevelContainer.CreateProxy()); + for (int i = 0; i < stage.Columns; i++) + { + var c = new Column + { + //c.Action = c.IsSpecial ? ManiaAction.Special : currentAction++; + Action = currentAction++ + }; - columns.Add(c); - AddNested(c); + drawableStage.AddColumn(c); + AddNested(c); + } } Inverted.ValueChanged += invertedChanged; @@ -157,82 +107,45 @@ namespace osu.Game.Rulesets.Mania.UI private void invertedChanged(bool newValue) { Scale = new Vector2(1, newValue ? -1 : 1); - judgements.Scale = Scale; - } - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - normalColumnColours = new List + foreach (var single in listColumnStages) { - colours.RedDark, - colours.GreenDark - }; - - specialColumnColour = colours.BlueDark; - - // Set the special column + colour + key - foreach (var column in Columns) - { - if (!column.IsSpecial) - continue; - - column.AccentColour = specialColumnColour; - } - - var nonSpecialColumns = Columns.Where(c => !c.IsSpecial).ToList(); - - // We'll set the colours of the non-special columns in a separate loop, because the non-special - // column colours are mirrored across their centre and special styles mess with this - for (int i = 0; i < Math.Ceiling(nonSpecialColumns.Count / 2f); i++) - { - Color4 colour = normalColumnColours[i % normalColumnColours.Count]; - nonSpecialColumns[i].AccentColour = colour; - nonSpecialColumns[nonSpecialColumns.Count - 1 - i].AccentColour = colour; + single.Judgements.Scale = Scale; } } public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { var maniaObject = (ManiaHitObject)judgedObject.HitObject; - columns[maniaObject.Column].OnJudgement(judgedObject, judgement); + int column = maniaObject.Column; + Columns[column].OnJudgement(judgedObject, judgement); - judgements.Clear(); - judgements.Add(new DrawableManiaJudgement(judgement) - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - }); - } - - /// - /// Whether the column index is a special column for this playfield. - /// - /// The 0-based column index. - /// Whether the column is a special column. - private bool isSpecialColumn(int column) - { - switch (SpecialColumnPosition) - { - default: - case SpecialColumnPosition.Normal: - return columnCount % 2 == 1 && column == columnCount / 2; - case SpecialColumnPosition.Left: - return column == 0; - case SpecialColumnPosition.Right: - return column == columnCount - 1; - } + getFallDownControlContainerByActualColumn(column).AddJudgement(judgement); } public override void Add(DrawableHitObject h) => Columns.ElementAt(((ManiaHitObject)h.HitObject).Column).Add(h); - public void Add(DrawableBarLine barline) => HitObjects.Add(barline); - - protected override void Update() + public void Add(BarLine barline) { - // 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 - content.Width = columns.Width; + foreach (var single in listColumnStages) + { + single.HitObjects.Add(new DrawableBarLine(barline)); + } + } + + private ManiaColumnStage getFallDownControlContainerByActualColumn(int actualColumn) + { + int sum = 0; + foreach (var single in listColumnStages) + { + sum = sum + single.ColumnCount; + if (sum > actualColumn) + { + return single; + } + } + + return null; } } } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 91ebd08838..26db5aa5b0 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; -using OpenTK; using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; @@ -23,6 +22,7 @@ using osu.Game.Rulesets.Replays; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Timing; using osu.Game.Rulesets.UI; +using OpenTK; namespace osu.Game.Rulesets.Mania.UI { @@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Mania.UI { public new ManiaBeatmap Beatmap => (ManiaBeatmap)base.Beatmap; - public IEnumerable BarLines; + public IEnumerable BarLines; public ManiaRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset, beatmap, isForCurrentRuleset) @@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Mania.UI double lastObjectTime = (Objects.LastOrDefault() as IHasEndTime)?.EndTime ?? Objects.LastOrDefault()?.StartTime ?? double.MaxValue; var timingPoints = Beatmap.ControlPointInfo.TimingPoints; - var barLines = new List(); + var barLines = new List(); for (int i = 0; i < timingPoints.Count; i++) { @@ -51,12 +51,12 @@ namespace osu.Game.Rulesets.Mania.UI int index = 0; for (double t = timingPoints[i].Time; Precision.DefinitelyBigger(endTime, t); t += point.BeatLength, index++) { - barLines.Add(new DrawableBarLine(new BarLine + barLines.Add(new BarLine { StartTime = t, ControlPoint = point, BeatIndex = index - })); + }); } } @@ -69,7 +69,7 @@ namespace osu.Game.Rulesets.Mania.UI BarLines.ForEach(Playfield.Add); } - protected sealed override Playfield CreatePlayfield() => new ManiaPlayfield(Beatmap.TotalColumns) + protected sealed override Playfield CreatePlayfield() => new ManiaPlayfield(Beatmap.Stages) { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index e9a572835b..1a8211b719 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -94,6 +94,7 @@ +