osu/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.6 KiB
C#
Raw Normal View History

// 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-04-13 09:19:50 +00:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2018-11-20 07:51:59 +00:00
using osuTK;
using osu.Game.Screens.Play.PlayerSettings;
2018-04-13 09:19:50 +00:00
namespace osu.Game.Screens.Play.HUD
{
public partial class PlayerSettingsOverlay : VisibilityContainer
{
private const int fade_duration = 200;
2018-04-13 09:19:50 +00:00
2018-01-09 23:24:51 +00:00
public readonly VisualSettings VisualSettings;
protected override Container<Drawable> Content => content;
private readonly FillFlowContainer content;
public PlayerSettingsOverlay()
{
Anchor = Anchor.TopRight;
Origin = Anchor.TopRight;
AutoSizeAxes = Axes.Both;
2018-04-13 09:19:50 +00:00
InternalChild = content = new FillFlowContainer
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 20),
2018-01-15 17:52:52 +00:00
Children = new PlayerSettingsGroup[]
{
VisualSettings = new VisualSettings { Expanded = { Value = false } },
new AudioSettings { Expanded = { Value = false } }
}
};
}
2018-04-13 09:19:50 +00:00
protected override void PopIn() => this.FadeIn(fade_duration);
protected override void PopOut() => this.FadeOut(fade_duration);
public void AddAtStart(PlayerSettingsGroup drawable) => content.Insert(-1, drawable);
}
}