2020-10-06 06:17:15 +00: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.
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2021-04-03 17:02:33 +00:00
|
|
|
using osu.Framework.Localisation;
|
2020-10-06 06:17:15 +00:00
|
|
|
using osu.Game.Graphics;
|
2021-04-03 17:02:33 +00:00
|
|
|
using osu.Game.Graphics.Sprites;
|
2021-06-08 15:14:26 +00:00
|
|
|
using osu.Game.Graphics.UserInterfaceV2;
|
2020-10-06 06:17:15 +00:00
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Edit.Setup
|
|
|
|
{
|
2021-08-22 14:40:17 +00:00
|
|
|
public abstract class SetupSection : Container
|
2020-10-06 06:17:15 +00:00
|
|
|
{
|
2021-08-22 14:40:17 +00:00
|
|
|
private FillFlowContainer flow;
|
2020-10-06 06:17:15 +00:00
|
|
|
|
2021-06-08 15:14:26 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Used to align some of the child <see cref="LabelledDrawable{T}"/>s together to achieve a grid-like look.
|
|
|
|
/// </summary>
|
|
|
|
protected const float LABEL_WIDTH = 160;
|
|
|
|
|
2020-10-06 06:17:15 +00:00
|
|
|
[Resolved]
|
|
|
|
protected OsuColour Colours { get; private set; }
|
|
|
|
|
|
|
|
[Resolved]
|
2021-01-04 07:47:08 +00:00
|
|
|
protected EditorBeatmap Beatmap { get; private set; }
|
2020-10-06 06:17:15 +00:00
|
|
|
|
2020-10-06 10:26:57 +00:00
|
|
|
protected override Container<Drawable> Content => flow;
|
2020-10-06 06:17:15 +00:00
|
|
|
|
2021-04-03 17:02:33 +00:00
|
|
|
public abstract LocalisableString Title { get; }
|
|
|
|
|
2021-08-22 14:40:17 +00:00
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
2020-10-06 06:17:15 +00:00
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
|
2021-04-03 17:02:33 +00:00
|
|
|
Padding = new MarginPadding
|
|
|
|
{
|
|
|
|
Vertical = 10,
|
2021-05-12 07:53:49 +00:00
|
|
|
Horizontal = EditorRoundedScreen.HORIZONTAL_PADDING
|
2021-04-03 17:02:33 +00:00
|
|
|
};
|
2020-10-06 06:17:15 +00:00
|
|
|
|
2021-04-03 17:02:33 +00:00
|
|
|
InternalChild = new FillFlowContainer
|
2020-10-06 06:17:15 +00:00
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
Spacing = new Vector2(20),
|
|
|
|
Direction = FillDirection.Vertical,
|
2021-04-03 17:02:33 +00:00
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
|
|
|
new OsuSpriteText
|
|
|
|
{
|
|
|
|
Font = OsuFont.GetFont(weight: FontWeight.Bold),
|
|
|
|
Text = Title
|
|
|
|
},
|
|
|
|
flow = new FillFlowContainer
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
2021-06-10 12:02:17 +00:00
|
|
|
Spacing = new Vector2(10),
|
2021-04-03 17:02:33 +00:00
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
}
|
|
|
|
}
|
2020-10-06 06:17:15 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|