2020-03-30 22:02:07 +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.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2020-03-30 22:02:07 +08:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2020-04-01 11:04:33 +08:00
|
|
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
2020-03-30 22:02:07 +08:00
|
|
|
using osu.Game.Rulesets.Mania.UI;
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// A container to be used in a <see cref="ManiaSkinnableTestScene"/> to provide a resolvable <see cref="Column"/> dependency.
|
|
|
|
/// </summary>
|
|
|
|
public class ColumnTestContainer : Container
|
|
|
|
{
|
|
|
|
protected override Container<Drawable> Content => content;
|
|
|
|
|
|
|
|
private readonly Container content;
|
|
|
|
|
|
|
|
[Cached]
|
|
|
|
private readonly Column column;
|
|
|
|
|
2022-10-04 17:24:49 +08:00
|
|
|
[Cached]
|
2022-10-04 18:49:07 +08:00
|
|
|
private readonly StageDefinition stageDefinition = new StageDefinition { Columns = 2 };
|
2022-10-04 17:24:49 +08:00
|
|
|
|
2020-08-26 19:00:38 +08:00
|
|
|
public ColumnTestContainer(int column, ManiaAction action, bool showColumn = false)
|
2020-03-30 22:02:07 +08:00
|
|
|
{
|
2020-08-26 19:00:38 +08:00
|
|
|
InternalChildren = new[]
|
2020-03-30 22:02:07 +08:00
|
|
|
{
|
2022-10-04 17:24:49 +08:00
|
|
|
this.column = new Column(column, false)
|
2020-08-26 19:00:38 +08:00
|
|
|
{
|
|
|
|
Action = { Value = action },
|
|
|
|
AccentColour = Color4.Orange,
|
|
|
|
Alpha = showColumn ? 1 : 0
|
|
|
|
},
|
|
|
|
content = new ManiaInputManager(new ManiaRuleset().RulesetInfo, 4)
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both
|
|
|
|
},
|
|
|
|
this.column.TopLevelContainer.CreateProxy()
|
2020-03-30 22:02:07 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|