1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-18 03:52:55 +08:00
osu-lazer/osu.Game/Screens/Menu/Disclaimer.cs

105 lines
3.3 KiB
C#
Raw Normal View History

2018-04-13 17:19:50 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Screens;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
2018-04-13 17:19:50 +08:00
using OpenTK;
using OpenTK.Graphics;
using osu.Game.Overlays;
2018-04-13 17:19:50 +08:00
namespace osu.Game.Screens.Menu
{
public class Disclaimer : OsuScreen
{
private Intro intro;
private SpriteIcon icon;
2018-04-13 17:19:50 +08:00
private Color4 iconColour;
private LinkFlowContainer textFlow;
2018-04-13 17:19:50 +08:00
protected override bool HideOverlaysOnEnter => true;
2018-06-06 15:17:51 +08:00
protected override OverlayActivation InitialOverlayActivationMode => OverlayActivation.Disabled;
2018-04-13 17:19:50 +08:00
public override bool CursorVisible => false;
private const float icon_y = -0.09f;
2018-04-13 17:19:50 +08:00
public Disclaimer()
{
ValidForResume = false;
}
2018-04-13 17:19:50 +08:00
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
2018-04-13 17:19:50 +08:00
Children = new Drawable[]
{
icon = new SpriteIcon
2018-04-13 17:19:50 +08:00
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Icon = FontAwesome.fa_warning,
Size = new Vector2(30),
RelativePositionAxes = Axes.Both,
Y = icon_y,
},
textFlow = new LinkFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding(50),
TextAnchor = Anchor.TopCentre,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
2018-04-13 17:19:50 +08:00
Spacing = new Vector2(0, 2),
}
};
textFlow.AddText("This is an ", t =>
{
t.TextSize = 30;
t.Font = @"Exo2.0-Light";
});
textFlow.AddText("early development build", t =>
{
t.TextSize = 30;
t.Font = @"Exo2.0-SemiBold";
});
textFlow.AddParagraph("Don't expect everything to work perfectly.");
textFlow.AddParagraph("");
textFlow.AddParagraph("Detailed bug reports are welcomed via github issues.");
textFlow.AddParagraph("");
textFlow.AddText("Visit ");
textFlow.AddLink("discord.gg/ppy", "https://discord.gg/ppy");
textFlow.AddText(" if you want to help out or follow progress!");
iconColour = colours.Yellow;
2018-04-13 17:19:50 +08:00
}
protected override void LoadComplete()
2018-04-13 17:19:50 +08:00
{
base.LoadComplete();
2018-04-13 17:19:50 +08:00
LoadComponentAsync(intro = new Intro());
}
protected override void OnEntering(Screen last)
{
base.OnEntering(last);
icon.Delay(1500).FadeColour(iconColour, 200, Easing.OutQuint);
icon.Delay(1500).MoveToY(icon_y * 1.1f, 100, Easing.OutCirc).Then().MoveToY(icon_y, 100, Easing.InCirc);
2018-04-13 17:19:50 +08:00
Content
.FadeInFromZero(500)
.Then(5500)
.FadeOut(250)
.ScaleTo(0.9f, 250, Easing.InQuint)
2018-04-13 17:19:50 +08:00
.Finally(d => Push(intro));
}
}
}