2021-05-12 07:26:12 +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.
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
using osuTK;
|
|
|
|
|
2021-05-12 15:53:49 +08:00
|
|
|
namespace osu.Game.Screens.Edit
|
2021-05-12 07:26:12 +08:00
|
|
|
{
|
2021-05-12 15:53:49 +08:00
|
|
|
public abstract class EditorRoundedScreenSettingsSection : CompositeDrawable
|
2021-05-12 07:26:12 +08:00
|
|
|
{
|
|
|
|
private const int header_height = 50;
|
|
|
|
|
2021-05-13 12:45:10 +08:00
|
|
|
protected abstract string HeaderText { get; }
|
|
|
|
|
|
|
|
protected FillFlowContainer Flow { get; private set; }
|
2021-05-12 07:26:12 +08:00
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2022-01-15 08:06:39 +08:00
|
|
|
private void load()
|
2021-05-12 07:26:12 +08:00
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
Masking = true;
|
|
|
|
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
{
|
|
|
|
new Container
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
Height = header_height,
|
|
|
|
Padding = new MarginPadding { Horizontal = 20 },
|
|
|
|
Child = new OsuSpriteText
|
|
|
|
{
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreLeft,
|
2021-05-13 12:45:10 +08:00
|
|
|
Text = HeaderText,
|
2021-05-12 07:26:12 +08:00
|
|
|
Font = new FontUsage(size: 25, weight: "bold")
|
|
|
|
}
|
|
|
|
},
|
|
|
|
new Container
|
|
|
|
{
|
|
|
|
Y = header_height,
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
Child = Flow = new FillFlowContainer
|
|
|
|
{
|
|
|
|
Padding = new MarginPadding { Horizontal = 20 },
|
|
|
|
Spacing = new Vector2(10),
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|