1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-18 17:32:55 +08:00
osu-lazer/osu.Game/Overlays/LoginOverlay.cs

84 lines
2.5 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Overlays.Settings.Sections.General;
using OpenTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Containers;
namespace osu.Game.Overlays
{
internal class LoginOverlay : OsuFocusedOverlayContainer
{
private LoginSettings settingsSection;
2017-03-07 09:59:19 +08:00
private const float transition_time = 400;
public LoginOverlay()
{
AutoSizeAxes = Axes.Both;
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
2017-01-31 18:40:02 +08:00
Alpha = 0.6f,
},
new Container
{
Width = 360,
AutoSizeAxes = Axes.Y,
Masking = true,
AutoSizeDuration = transition_time,
2017-07-23 02:50:25 +08:00
AutoSizeEasing = Easing.OutQuint,
Children = new Drawable[]
{
settingsSection = new LoginSettings
{
Padding = new MarginPadding(10),
RequestHide = Hide,
},
new Box
{
RelativeSizeAxes = Axes.X,
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Height = 3,
Colour = colours.Yellow,
Alpha = 1,
},
}
}
};
}
protected override void PopIn()
{
base.PopIn();
settingsSection.Bounding = true;
2017-07-23 02:50:25 +08:00
this.FadeIn(transition_time, Easing.OutQuint);
InputManager.ChangeFocus(settingsSection);
}
protected override void PopOut()
{
base.PopOut();
settingsSection.Bounding = false;
this.FadeOut(transition_time);
}
}
}