2022-04-06 08:42:10 +00: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.
|
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2022-04-26 07:22:41 +00:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Extensions;
|
2022-04-06 08:42:10 +00:00
|
|
|
using osu.Framework.Graphics;
|
2022-04-19 07:37:29 +00:00
|
|
|
using osu.Framework.Graphics.Containers;
|
2022-04-06 08:42:10 +00:00
|
|
|
using osu.Framework.Screens;
|
2022-04-26 07:22:41 +00:00
|
|
|
using osu.Game.Graphics;
|
2022-04-19 07:37:29 +00:00
|
|
|
using osu.Game.Graphics.Containers;
|
2022-04-26 07:22:41 +00:00
|
|
|
using osu.Game.Graphics.Sprites;
|
2022-04-19 07:37:29 +00:00
|
|
|
using osuTK;
|
2022-04-06 08:42:10 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Overlays.FirstRunSetup
|
|
|
|
{
|
|
|
|
public abstract partial class FirstRunSetupScreen : Screen
|
|
|
|
{
|
2022-04-18 09:58:14 +00:00
|
|
|
private const float offset = 100;
|
2022-04-06 08:42:10 +00:00
|
|
|
|
2022-04-19 07:37:29 +00:00
|
|
|
protected FillFlowContainer Content { get; private set; }
|
|
|
|
|
2022-05-10 08:33:37 +00:00
|
|
|
protected const float CONTENT_FONT_SIZE = 16;
|
|
|
|
|
2022-05-16 12:07:42 +00:00
|
|
|
protected const float CONTENT_PADDING = 30;
|
|
|
|
|
2022-05-10 08:33:37 +00:00
|
|
|
protected const float HEADER_FONT_SIZE = 24;
|
|
|
|
|
2022-04-28 09:57:32 +00:00
|
|
|
[Resolved]
|
|
|
|
protected OverlayColourProvider OverlayColourProvider { get; private set; }
|
|
|
|
|
2022-04-26 07:22:41 +00:00
|
|
|
[BackgroundDependencyLoader]
|
2022-04-28 09:57:32 +00:00
|
|
|
private void load()
|
2022-04-19 07:37:29 +00:00
|
|
|
{
|
2022-04-26 07:22:41 +00:00
|
|
|
const float spacing = 20;
|
|
|
|
|
2022-04-19 07:37:29 +00:00
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
{
|
|
|
|
new OsuScrollContainer(Direction.Vertical)
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2022-05-10 08:23:12 +00:00
|
|
|
Masking = false,
|
|
|
|
Child = new Container
|
2022-04-19 07:37:29 +00:00
|
|
|
{
|
2022-05-10 08:23:12 +00:00
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
2022-05-16 12:07:42 +00:00
|
|
|
Padding = new MarginPadding { Horizontal = CONTENT_PADDING },
|
2022-05-10 08:23:12 +00:00
|
|
|
Children = new Drawable[]
|
2022-04-26 07:22:41 +00:00
|
|
|
{
|
2022-05-10 08:23:12 +00:00
|
|
|
new OsuSpriteText
|
|
|
|
{
|
|
|
|
Text = this.GetLocalisableDescription(),
|
2022-05-10 08:33:37 +00:00
|
|
|
Font = OsuFont.TorusAlternate.With(size: HEADER_FONT_SIZE),
|
2022-05-10 08:23:12 +00:00
|
|
|
Colour = OverlayColourProvider.Light1,
|
|
|
|
},
|
|
|
|
Content = new FillFlowContainer
|
|
|
|
{
|
2022-05-10 08:33:37 +00:00
|
|
|
Y = HEADER_FONT_SIZE + spacing,
|
2022-05-10 08:23:12 +00:00
|
|
|
Spacing = new Vector2(spacing),
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
}
|
2022-04-26 07:22:41 +00:00
|
|
|
},
|
2022-04-19 07:37:29 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-04-21 20:29:23 +00:00
|
|
|
public override void OnEntering(ScreenTransitionEvent e)
|
2022-04-06 08:42:10 +00:00
|
|
|
{
|
2022-04-21 20:29:23 +00:00
|
|
|
base.OnEntering(e);
|
2022-04-18 07:07:30 +00:00
|
|
|
this
|
2022-05-10 08:47:04 +00:00
|
|
|
.FadeInFromZero(100)
|
2022-04-18 09:58:14 +00:00
|
|
|
.MoveToX(offset)
|
2022-04-18 07:07:30 +00:00
|
|
|
.MoveToX(0, 500, Easing.OutQuint);
|
2022-04-06 08:42:10 +00:00
|
|
|
}
|
|
|
|
|
2022-04-21 20:29:23 +00:00
|
|
|
public override void OnResuming(ScreenTransitionEvent e)
|
2022-04-06 08:42:10 +00:00
|
|
|
{
|
2022-04-21 20:29:23 +00:00
|
|
|
base.OnResuming(e);
|
2022-04-18 07:07:30 +00:00
|
|
|
this
|
2022-05-10 08:47:04 +00:00
|
|
|
.FadeInFromZero(100)
|
2022-04-18 07:07:30 +00:00
|
|
|
.MoveToX(0, 500, Easing.OutQuint);
|
2022-04-06 08:42:10 +00:00
|
|
|
}
|
|
|
|
|
2022-04-21 20:29:23 +00:00
|
|
|
public override bool OnExiting(ScreenExitEvent e)
|
2022-04-18 09:58:14 +00:00
|
|
|
{
|
|
|
|
this
|
|
|
|
.FadeOut(100)
|
|
|
|
.MoveToX(offset, 500, Easing.OutQuint);
|
|
|
|
|
2022-04-21 20:29:23 +00:00
|
|
|
return base.OnExiting(e);
|
2022-04-18 09:58:14 +00:00
|
|
|
}
|
|
|
|
|
2022-04-21 20:29:23 +00:00
|
|
|
public override void OnSuspending(ScreenTransitionEvent e)
|
2022-04-06 08:42:10 +00:00
|
|
|
{
|
2022-04-18 07:07:30 +00:00
|
|
|
this
|
|
|
|
.FadeOut(100)
|
2022-04-18 09:58:14 +00:00
|
|
|
.MoveToX(-offset, 500, Easing.OutQuint);
|
|
|
|
|
2022-04-21 20:29:23 +00:00
|
|
|
base.OnSuspending(e);
|
2022-04-06 08:42:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|