2016-11-03 12:45:16 +08:00
|
|
|
|
using System;
|
|
|
|
|
using OpenTK;
|
|
|
|
|
using OpenTK.Graphics;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Primitives;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2016-11-08 07:04:49 +08:00
|
|
|
|
using osu.Game.Graphics;
|
2016-11-03 12:45:16 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Options
|
|
|
|
|
{
|
2016-11-04 11:01:11 +08:00
|
|
|
|
public abstract class OptionsSection : Container
|
2016-11-03 12:45:16 +08:00
|
|
|
|
{
|
2016-11-04 11:01:11 +08:00
|
|
|
|
protected FlowContainer content;
|
2016-11-03 12:45:16 +08:00
|
|
|
|
protected override Container Content => content;
|
|
|
|
|
|
2016-11-08 07:04:49 +08:00
|
|
|
|
public abstract FontAwesome Icon { get; }
|
2016-11-04 11:01:11 +08:00
|
|
|
|
protected abstract string Header { get; }
|
2016-11-03 12:45:16 +08:00
|
|
|
|
|
|
|
|
|
public OptionsSection()
|
|
|
|
|
{
|
|
|
|
|
const int headerSize = 30, headerMargin = 25;
|
|
|
|
|
const int borderSize = 2;
|
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
|
AddInternal(new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
2016-11-05 07:27:41 +08:00
|
|
|
|
Colour = new Color4(30, 30, 30, 255),
|
2016-11-03 12:45:16 +08:00
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
Height = borderSize,
|
|
|
|
|
},
|
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
Padding = new MarginPadding
|
|
|
|
|
{
|
|
|
|
|
Top = 10 + borderSize,
|
|
|
|
|
Left = OptionsOverlay.SideMargins,
|
|
|
|
|
Right = OptionsOverlay.SideMargins,
|
|
|
|
|
Bottom = 10,
|
|
|
|
|
},
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
2016-11-04 11:01:11 +08:00
|
|
|
|
new SpriteText
|
2016-11-03 12:45:16 +08:00
|
|
|
|
{
|
|
|
|
|
TextSize = headerSize,
|
|
|
|
|
Colour = new Color4(247, 198, 35, 255),
|
2016-11-04 11:01:11 +08:00
|
|
|
|
Text = Header,
|
2016-11-03 12:45:16 +08:00
|
|
|
|
},
|
|
|
|
|
content = new FlowContainer
|
|
|
|
|
{
|
|
|
|
|
Margin = new MarginPadding { Top = headerSize + headerMargin },
|
|
|
|
|
Direction = FlowDirection.VerticalOnly,
|
|
|
|
|
Spacing = new Vector2(0, 25),
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|