1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 20:07:29 +08:00
osu-lazer/osu.Game/Overlays/LoginOverlay.cs

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

95 lines
2.9 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 17:19:50 +08:00
2022-06-17 15:37:17 +08:00
#nullable disable
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
2018-11-20 15:51:59 +08:00
using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Cursor;
using osu.Game.Overlays.Login;
2018-04-13 17:19:50 +08:00
namespace osu.Game.Overlays
{
public class LoginOverlay : OsuFocusedOverlayContainer
{
private LoginPanel panel;
2018-04-13 17:19:50 +08:00
2017-03-07 09:59:19 +08:00
private const float transition_time = 400;
2018-04-13 17:19:50 +08:00
public LoginOverlay()
{
AutoSizeAxes = Axes.Both;
}
2018-04-13 17:19:50 +08:00
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Children = new Drawable[]
{
new OsuContextMenuContainer
{
Width = 360,
AutoSizeAxes = Axes.Y,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
Alpha = 0.6f,
},
new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Masking = true,
AutoSizeDuration = transition_time,
AutoSizeEasing = Easing.OutQuint,
Children = new Drawable[]
{
panel = new LoginPanel
{
Padding = new MarginPadding(10),
RequestHide = Hide,
},
new Box
{
RelativeSizeAxes = Axes.X,
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Height = 3,
Colour = colours.Yellow,
Alpha = 1,
},
}
}
}
}
};
}
2018-04-13 17:19:50 +08:00
protected override void PopIn()
{
base.PopIn();
2018-04-13 17:19:50 +08:00
panel.Bounding = true;
2017-07-23 02:50:25 +08:00
this.FadeIn(transition_time, Easing.OutQuint);
2018-04-13 17:19:50 +08:00
2022-02-15 07:42:37 +08:00
ScheduleAfterChildren(() => GetContainingInputManager().ChangeFocus(panel));
}
2018-04-13 17:19:50 +08:00
protected override void PopOut()
{
base.PopOut();
2018-04-13 17:19:50 +08:00
panel.Bounding = false;
this.FadeOut(transition_time);
}
}
}