2019-03-04 12:24:19 +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-08 02:51:39 +08:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
2019-03-04 11:06:41 +08:00
|
|
|
|
using osu.Game.Graphics;
|
2018-11-22 09:25:30 +08:00
|
|
|
|
using osuTK;
|
|
|
|
|
using osuTK.Graphics;
|
2018-11-08 02:51:39 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tournament.Components
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// An element anchored to the right-hand area of a screen that provides streamer level controls.
|
|
|
|
|
/// Should be off-screen.
|
|
|
|
|
/// </summary>
|
2022-11-24 13:32:20 +08:00
|
|
|
|
public partial class ControlPanel : Container
|
2018-11-08 02:51:39 +08:00
|
|
|
|
{
|
|
|
|
|
private readonly FillFlowContainer buttons;
|
|
|
|
|
|
|
|
|
|
protected override Container<Drawable> Content => buttons;
|
|
|
|
|
|
|
|
|
|
public ControlPanel()
|
|
|
|
|
{
|
2020-03-13 14:44:13 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Y;
|
2018-11-08 02:51:39 +08:00
|
|
|
|
AlwaysPresent = true;
|
2020-03-13 14:44:13 +08:00
|
|
|
|
Width = TournamentSceneManager.CONTROL_AREA_WIDTH;
|
2018-11-08 02:51:39 +08:00
|
|
|
|
Anchor = Anchor.TopRight;
|
|
|
|
|
|
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Colour = new Color4(54, 54, 54, 255)
|
|
|
|
|
},
|
2020-03-03 18:14:44 +08:00
|
|
|
|
new TournamentSpriteText
|
2018-11-08 02:51:39 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Text = "Control Panel",
|
2019-03-04 11:06:41 +08:00
|
|
|
|
Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 22)
|
2018-11-08 02:51:39 +08:00
|
|
|
|
},
|
|
|
|
|
buttons = new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Position = new Vector2(0, 35f),
|
2020-03-13 14:44:13 +08:00
|
|
|
|
Padding = new MarginPadding(5),
|
2018-11-08 02:51:39 +08:00
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
|
Spacing = new Vector2(0, 5f),
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-24 13:32:20 +08:00
|
|
|
|
public partial class Spacer : CompositeDrawable
|
2018-11-08 02:51:39 +08:00
|
|
|
|
{
|
|
|
|
|
public Spacer(float height = 20)
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
|
Height = height;
|
|
|
|
|
AlwaysPresent = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|