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
|
|
|
|
|
2019-01-22 13:22:38 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
2019-01-22 13:22:38 +08:00
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Framework.Screens;
|
|
|
|
|
using osu.Game.Graphics;
|
2018-07-11 15:30:33 +08:00
|
|
|
|
using osu.Game.Graphics.Containers;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
|
|
|
|
using osuTK.Graphics;
|
2018-05-28 19:43:47 +08:00
|
|
|
|
using osu.Game.Overlays;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Menu
|
|
|
|
|
{
|
|
|
|
|
public class Disclaimer : OsuScreen
|
|
|
|
|
{
|
|
|
|
|
private Intro intro;
|
2018-07-11 15:30:33 +08:00
|
|
|
|
private SpriteIcon icon;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
private Color4 iconColour;
|
2018-07-11 15:30:33 +08:00
|
|
|
|
private LinkFlowContainer textFlow;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-01-28 14:41:54 +08:00
|
|
|
|
public override bool HideOverlaysOnEnter => true;
|
|
|
|
|
public override OverlayActivation InitialOverlayActivationMode => OverlayActivation.Disabled;
|
2018-05-21 21:53:50 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
public override bool CursorVisible => false;
|
|
|
|
|
|
2019-01-22 13:22:38 +08:00
|
|
|
|
private readonly List<Drawable> supporterDrawables = new List<Drawable>();
|
|
|
|
|
private Drawable heart;
|
|
|
|
|
|
|
|
|
|
private const float icon_y = -85;
|
2018-07-11 15:30:33 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
public Disclaimer()
|
|
|
|
|
{
|
|
|
|
|
ValidForResume = false;
|
2018-07-11 15:30:33 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-07-11 15:30:33 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
2019-01-23 19:52:00 +08:00
|
|
|
|
InternalChildren = new Drawable[]
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2018-07-11 15:30:33 +08:00
|
|
|
|
icon = new SpriteIcon
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
2018-07-11 15:30:33 +08:00
|
|
|
|
Icon = FontAwesome.fa_warning,
|
|
|
|
|
Size = new Vector2(30),
|
|
|
|
|
Y = icon_y,
|
|
|
|
|
},
|
|
|
|
|
textFlow = new LinkFlowContainer
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Padding = new MarginPadding(50),
|
|
|
|
|
TextAnchor = Anchor.TopCentre,
|
2019-01-22 13:22:38 +08:00
|
|
|
|
Y = -110,
|
2018-07-11 15:30:33 +08:00
|
|
|
|
Anchor = Anchor.Centre,
|
2019-01-22 13:22:38 +08:00
|
|
|
|
Origin = Anchor.TopCentre,
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Spacing = new Vector2(0, 2),
|
|
|
|
|
}
|
|
|
|
|
};
|
2018-07-11 15:30:33 +08:00
|
|
|
|
|
2019-02-20 18:32:30 +08:00
|
|
|
|
textFlow.AddText("This is an ", t => t.Font = t.Font.With(size: 30, weight: FontWeight.Light));
|
|
|
|
|
textFlow.AddText("early development build", t => t.Font = t.Font.With(size: 30, weight: FontWeight.SemiBold));
|
2018-07-11 15:30:33 +08:00
|
|
|
|
|
2019-02-20 18:32:30 +08:00
|
|
|
|
textFlow.AddParagraph("Things may not work as expected", t => t.Font = t.Font.With(size: 20));
|
2019-01-22 13:22:38 +08:00
|
|
|
|
textFlow.NewParagraph();
|
|
|
|
|
|
2019-02-12 12:04:46 +08:00
|
|
|
|
Action<SpriteText> format = t => t.Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold);
|
2019-01-22 13:22:38 +08:00
|
|
|
|
|
|
|
|
|
textFlow.AddParagraph("Detailed bug reports are welcomed via github issues.", format);
|
|
|
|
|
textFlow.NewParagraph();
|
2018-07-11 15:30:33 +08:00
|
|
|
|
|
2019-01-22 13:22:38 +08:00
|
|
|
|
textFlow.AddText("Visit ", format);
|
|
|
|
|
textFlow.AddLink("discord.gg/ppy", "https://discord.gg/ppy", creationParameters:format);
|
|
|
|
|
textFlow.AddText(" to help out or follow progress!", format);
|
|
|
|
|
|
|
|
|
|
textFlow.NewParagraph();
|
|
|
|
|
textFlow.NewParagraph();
|
|
|
|
|
textFlow.NewParagraph();
|
|
|
|
|
|
|
|
|
|
supporterDrawables.AddRange(textFlow.AddText("Consider becoming an ", format));
|
|
|
|
|
supporterDrawables.AddRange(textFlow.AddLink("osu!supporter", "https://osu.ppy.sh/home/support", creationParameters: format));
|
|
|
|
|
supporterDrawables.AddRange(textFlow.AddText(" to help support the game", format));
|
|
|
|
|
|
|
|
|
|
supporterDrawables.Add(heart = textFlow.AddIcon(FontAwesome.fa_heart, t =>
|
|
|
|
|
{
|
|
|
|
|
t.Padding = new MarginPadding { Left = 5 };
|
2019-02-20 18:32:30 +08:00
|
|
|
|
t.Font = t.Font.With(size: 12);
|
2019-01-22 13:22:38 +08:00
|
|
|
|
t.Colour = colours.Pink;
|
|
|
|
|
t.Origin = Anchor.Centre;
|
|
|
|
|
}).First());
|
2018-07-11 15:30:33 +08:00
|
|
|
|
|
|
|
|
|
iconColour = colours.Yellow;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-07-11 15:30:33 +08:00
|
|
|
|
protected override void LoadComplete()
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2018-07-11 15:30:33 +08:00
|
|
|
|
base.LoadComplete();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
LoadComponentAsync(intro = new Intro());
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-23 19:52:00 +08:00
|
|
|
|
public override void OnEntering(IScreen last)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
base.OnEntering(last);
|
|
|
|
|
|
2019-01-22 13:22:38 +08:00
|
|
|
|
icon.Delay(1000).FadeColour(iconColour, 200, Easing.OutQuint);
|
|
|
|
|
icon.Delay(1000)
|
|
|
|
|
.MoveToY(icon_y * 1.1f, 160, Easing.OutCirc)
|
|
|
|
|
.RotateTo(-10, 160, Easing.OutCirc)
|
|
|
|
|
.Then()
|
|
|
|
|
.MoveToY(icon_y, 160, Easing.InCirc)
|
|
|
|
|
.RotateTo(0, 160, Easing.InCirc);
|
|
|
|
|
|
|
|
|
|
supporterDrawables.ForEach(d => d.FadeOut().Delay(2000).FadeIn(500));
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-01-23 19:52:00 +08:00
|
|
|
|
this
|
2018-04-13 17:19:50 +08:00
|
|
|
|
.FadeInFromZero(500)
|
|
|
|
|
.Then(5500)
|
|
|
|
|
.FadeOut(250)
|
2018-07-11 15:30:33 +08:00
|
|
|
|
.ScaleTo(0.9f, 250, Easing.InQuint)
|
2019-01-23 19:52:00 +08:00
|
|
|
|
.Finally(d => this.Push(intro));
|
2019-01-22 13:22:38 +08:00
|
|
|
|
|
|
|
|
|
heart.FlashColour(Color4.White, 750, Easing.OutQuint).Loop();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|