2019-01-24 16:43:03 +08:00
|
|
|
|
// 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
|
|
|
|
|
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;
|
2023-06-26 01:07:30 +08:00
|
|
|
|
using osu.Framework.Graphics.Effects;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK.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;
|
2021-09-17 17:30:38 +08:00
|
|
|
|
using osu.Game.Overlays.Login;
|
2023-06-26 03:26:01 +08:00
|
|
|
|
using osu.Game.Overlays.Settings;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-01-30 21:53:50 +08:00
|
|
|
|
namespace osu.Game.Overlays
|
|
|
|
|
{
|
2017-11-21 10:49:42 +08:00
|
|
|
|
public partial class LoginOverlay : OsuFocusedOverlayContainer
|
2017-01-30 21:53:50 +08:00
|
|
|
|
{
|
2023-06-26 12:26:07 +08:00
|
|
|
|
private LoginPanel panel = null!;
|
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
|
|
|
|
|
2023-10-19 16:24:51 +08:00
|
|
|
|
protected override double PopInOutSampleBalance => OsuGameBase.SFX_STEREO_STRENGTH * 0.75f;
|
2023-08-17 10:37:07 +08:00
|
|
|
|
|
2023-06-26 01:07:30 +08:00
|
|
|
|
[Cached]
|
|
|
|
|
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
|
|
|
|
|
|
2017-01-30 21:53:50 +08:00
|
|
|
|
public LoginOverlay()
|
|
|
|
|
{
|
2017-01-31 15:42:46 +08:00
|
|
|
|
AutoSizeAxes = Axes.Both;
|
2023-06-26 01:07:30 +08:00
|
|
|
|
Masking = true;
|
|
|
|
|
EdgeEffect = new EdgeEffectParameters
|
|
|
|
|
{
|
2023-06-26 12:19:07 +08:00
|
|
|
|
Colour = Color4.Black,
|
2023-06-26 01:07:30 +08:00
|
|
|
|
Type = EdgeEffectType.Shadow,
|
|
|
|
|
Radius = 10,
|
|
|
|
|
Hollow = true,
|
|
|
|
|
};
|
2017-01-30 21:53:50 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-01-30 21:53:50 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
2023-06-26 01:07:30 +08:00
|
|
|
|
private void load()
|
2017-01-30 21:53:50 +08:00
|
|
|
|
{
|
|
|
|
|
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,
|
2023-06-26 01:07:30 +08:00
|
|
|
|
Colour = colourProvider.Background4,
|
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,
|
2023-06-26 01:07:30 +08:00
|
|
|
|
Child = panel = new LoginPanel
|
2017-09-27 13:06:57 +08:00
|
|
|
|
{
|
2023-06-26 03:26:01 +08:00
|
|
|
|
Padding = new MarginPadding { Vertical = SettingsSection.ITEM_SPACING },
|
2023-06-26 01:07:30 +08:00
|
|
|
|
RequestHide = Hide,
|
|
|
|
|
},
|
2017-09-27 13:06:57 +08:00
|
|
|
|
}
|
2017-01-31 15:42:46 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-01-30 21:53:50 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-01-30 21:53:50 +08:00
|
|
|
|
protected override void PopIn()
|
|
|
|
|
{
|
2021-09-17 17:30:38 +08:00
|
|
|
|
panel.Bounding = true;
|
2017-07-23 02:50:25 +08:00
|
|
|
|
this.FadeIn(transition_time, Easing.OutQuint);
|
2023-06-26 01:07:30 +08:00
|
|
|
|
FadeEdgeEffectTo(WaveContainer.SHADOW_OPACITY, WaveContainer.APPEAR_DURATION, Easing.Out);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2022-02-15 07:42:37 +08:00
|
|
|
|
ScheduleAfterChildren(() => GetContainingInputManager().ChangeFocus(panel));
|
2017-01-30 21:53:50 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-01-30 21:53:50 +08:00
|
|
|
|
protected override void PopOut()
|
|
|
|
|
{
|
2017-02-09 12:54:10 +08:00
|
|
|
|
base.PopOut();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2021-09-17 17:30:38 +08:00
|
|
|
|
panel.Bounding = false;
|
2017-07-15 00:18:12 +08:00
|
|
|
|
this.FadeOut(transition_time);
|
2023-06-26 01:07:30 +08:00
|
|
|
|
FadeEdgeEffectTo(0, WaveContainer.DISAPPEAR_DURATION, Easing.In);
|
2017-01-30 21:53:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|