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;
|
2017-09-27 13:06:57 +08:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2017-01-30 21:53:50 +08:00
|
|
|
|
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-09-14 14:43:47 +08:00
|
|
|
|
using osu.Game.Graphics.Cursor;
|
2017-01-30 21:53:50 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays
|
|
|
|
|
{
|
2017-11-21 10:49:42 +08:00
|
|
|
|
public 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-09-14 14:43:47 +08:00
|
|
|
|
new OsuContextMenuContainer
|
2017-01-30 21:53:50 +08:00
|
|
|
|
{
|
2017-01-31 15:42:46 +08:00
|
|
|
|
Width = 360,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2017-09-27 13:06:57 +08:00
|
|
|
|
new Box
|
2017-01-31 15:42:46 +08:00
|
|
|
|
{
|
2017-09-27 13:06:57 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Colour = Color4.Black,
|
|
|
|
|
Alpha = 0.6f,
|
2017-01-31 15:42:46 +08:00
|
|
|
|
},
|
2017-09-27 13:06:57 +08:00
|
|
|
|
new Container
|
2017-01-31 15:42:46 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
2017-09-27 13:06:57 +08:00
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Masking = true,
|
|
|
|
|
AutoSizeDuration = transition_time,
|
|
|
|
|
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,
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-01-31 15:42:46 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|