1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:17:26 +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.

94 lines
3.0 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
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
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;
using osu.Game.Overlays.Settings;
2018-04-13 17:19:50 +08:00
namespace osu.Game.Overlays
{
public partial class LoginOverlay : OsuFocusedOverlayContainer
{
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
protected override double PopInOutSampleBalance => OsuGameBase.SFX_STEREO_STRENGTH * 0.75f;
[Cached]
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
public LoginOverlay()
{
AutoSizeAxes = Axes.Both;
Masking = true;
EdgeEffect = new EdgeEffectParameters
{
Colour = Color4.Black,
Type = EdgeEffectType.Shadow,
Radius = 10,
Hollow = true,
};
}
2018-04-13 17:19:50 +08:00
[BackgroundDependencyLoader]
private void load()
{
Children = new Drawable[]
{
new OsuContextMenuContainer
{
Width = 360,
AutoSizeAxes = Axes.Y,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background4,
},
new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Masking = true,
AutoSizeDuration = transition_time,
AutoSizeEasing = Easing.OutQuint,
Child = panel = new LoginPanel
{
Padding = new MarginPadding { Vertical = SettingsSection.ITEM_SPACING },
RequestHide = Hide,
},
}
}
}
};
}
2018-04-13 17:19:50 +08:00
protected override void PopIn()
{
panel.Bounding = true;
2017-07-23 02:50:25 +08:00
this.FadeIn(transition_time, Easing.OutQuint);
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));
}
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);
FadeEdgeEffectTo(0, WaveContainer.DISAPPEAR_DURATION, Easing.In);
}
}
}