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