2019-01-24 16:43:03 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-11-13 15:42:40 +08:00
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2021-06-15 14:14:14 +08:00
|
|
|
using System.Collections.Generic;
|
2018-11-13 15:42:40 +08:00
|
|
|
using osu.Framework.Allocation;
|
2018-11-15 20:37:22 +08:00
|
|
|
using osu.Framework.Graphics;
|
2021-06-15 14:14:14 +08:00
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
2018-11-15 20:37:22 +08:00
|
|
|
using osu.Game.Rulesets.Mania.UI;
|
2021-06-15 14:14:14 +08:00
|
|
|
using osu.Game.Rulesets.UI;
|
|
|
|
using osu.Game.Rulesets.UI.Scrolling;
|
2018-11-13 15:42:40 +08:00
|
|
|
using osu.Game.Tests.Visual;
|
|
|
|
|
2020-09-25 17:48:04 +08:00
|
|
|
namespace osu.Game.Rulesets.Mania.Tests.Editor
|
2018-11-13 15:42:40 +08:00
|
|
|
{
|
2021-06-17 09:07:52 +08:00
|
|
|
public abstract partial class ManiaSelectionBlueprintTestScene : SelectionBlueprintTestScene
|
2018-11-13 15:42:40 +08:00
|
|
|
{
|
2021-06-15 14:14:14 +08:00
|
|
|
protected override Container<Drawable> Content => blueprints ?? base.Content;
|
|
|
|
|
|
|
|
private readonly Container blueprints;
|
|
|
|
|
2021-06-17 09:07:52 +08:00
|
|
|
[Cached(typeof(Playfield))]
|
2021-06-15 14:14:14 +08:00
|
|
|
public Playfield Playfield { get; }
|
|
|
|
|
|
|
|
private readonly ScrollingTestContainer scrollingTestContainer;
|
|
|
|
|
|
|
|
protected ScrollingDirection Direction
|
|
|
|
{
|
|
|
|
set => scrollingTestContainer.Direction = value;
|
|
|
|
}
|
2018-11-15 20:37:22 +08:00
|
|
|
|
2021-06-15 14:22:36 +08:00
|
|
|
protected ManiaSelectionBlueprintTestScene(int columns)
|
2018-11-15 20:37:22 +08:00
|
|
|
{
|
2022-10-05 18:14:31 +08:00
|
|
|
var stageDefinitions = new List<StageDefinition> { new StageDefinition(columns) };
|
2021-06-15 14:22:36 +08:00
|
|
|
base.Content.Child = scrollingTestContainer = new ScrollingTestContainer(ScrollingDirection.Up)
|
2018-11-15 20:37:22 +08:00
|
|
|
{
|
2021-06-15 14:14:14 +08:00
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
|
|
|
Playfield = new ManiaPlayfield(stageDefinitions)
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
},
|
|
|
|
blueprints = new Container
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2021-06-15 14:22:36 +08:00
|
|
|
|
|
|
|
AddToggleStep("Downward scroll", b => Direction = b ? ScrollingDirection.Down : ScrollingDirection.Up);
|
2018-11-15 20:37:22 +08:00
|
|
|
}
|
2018-11-13 15:42:40 +08:00
|
|
|
}
|
|
|
|
}
|