2020-06-03 03:06:22 +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.
|
|
|
|
|
|
|
|
|
|
using osuTK;
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Audio;
|
|
|
|
|
using osu.Framework.Audio.Sample;
|
|
|
|
|
using osu.Framework.Screens;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
using osu.Framework.Graphics.Textures;
|
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Menu
|
|
|
|
|
{
|
|
|
|
|
public class IntroWelcome : IntroScreen
|
|
|
|
|
{
|
2020-06-12 21:57:23 +08:00
|
|
|
|
protected override string BeatmapHash => "64e00d7022195959bfa3109d09c2e2276c8f12f486b91fcf6175583e973b48f2";
|
2020-06-03 03:06:22 +08:00
|
|
|
|
protected override string BeatmapFile => "welcome.osz";
|
|
|
|
|
private const double delay_step_two = 2142;
|
|
|
|
|
private SampleChannel welcome;
|
2020-06-03 17:39:08 +08:00
|
|
|
|
private SampleChannel pianoReverb;
|
2020-06-13 23:48:15 +08:00
|
|
|
|
protected override string SeeyaSampleName => "Intro/Welcome/seeya";
|
2020-06-03 03:06:22 +08:00
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(AudioManager audio)
|
|
|
|
|
{
|
|
|
|
|
if (MenuVoice.Value)
|
2020-06-13 23:48:15 +08:00
|
|
|
|
welcome = audio.Samples.Get(@"Intro/Welcome/welcome");
|
|
|
|
|
|
|
|
|
|
pianoReverb = audio.Samples.Get(@"Intro/Welcome/welcome_piano");
|
2020-06-03 03:06:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LogoArriving(OsuLogo logo, bool resuming)
|
|
|
|
|
{
|
|
|
|
|
base.LogoArriving(logo, resuming);
|
|
|
|
|
|
|
|
|
|
if (!resuming)
|
|
|
|
|
{
|
|
|
|
|
welcome?.Play();
|
2020-06-03 17:39:08 +08:00
|
|
|
|
pianoReverb?.Play();
|
|
|
|
|
|
2020-06-09 02:13:02 +08:00
|
|
|
|
Scheduler.AddDelayed(() =>
|
2020-06-03 03:06:22 +08:00
|
|
|
|
{
|
2020-06-03 17:39:08 +08:00
|
|
|
|
StartTrack();
|
2020-06-03 03:06:22 +08:00
|
|
|
|
PrepareMenuLoad();
|
|
|
|
|
|
|
|
|
|
logo.ScaleTo(1);
|
|
|
|
|
logo.FadeIn();
|
|
|
|
|
|
|
|
|
|
Scheduler.Add(LoadMenu);
|
|
|
|
|
}, delay_step_two);
|
|
|
|
|
|
|
|
|
|
LoadComponentAsync(new WelcomeIntroSequence
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both
|
|
|
|
|
}, AddInternal);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnSuspending(IScreen next)
|
|
|
|
|
{
|
|
|
|
|
this.FadeOut(300);
|
|
|
|
|
base.OnSuspending(next);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private class WelcomeIntroSequence : Container
|
|
|
|
|
{
|
|
|
|
|
private Sprite welcomeText;
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(TextureStore textures)
|
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
Anchor = Anchor.Centre;
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2020-06-09 03:31:03 +08:00
|
|
|
|
new Container
|
2020-06-03 03:06:22 +08:00
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2020-06-09 03:31:03 +08:00
|
|
|
|
new LogoVisualisation
|
2020-06-03 03:06:22 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Alpha = 0.5f,
|
2020-06-03 03:50:50 +08:00
|
|
|
|
AccentColour = Color4.DarkBlue,
|
2020-06-03 03:06:22 +08:00
|
|
|
|
Size = new Vector2(0.96f)
|
|
|
|
|
},
|
2020-06-09 03:31:03 +08:00
|
|
|
|
new Container
|
2020-06-03 03:06:22 +08:00
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2020-06-09 03:31:03 +08:00
|
|
|
|
new Circle
|
2020-06-03 03:06:22 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Size = new Vector2(480),
|
|
|
|
|
Colour = Color4.Black
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
welcomeText = new Sprite
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
2020-06-08 21:31:30 +08:00
|
|
|
|
Scale = new Vector2(0.3f),
|
|
|
|
|
Width = 750,
|
|
|
|
|
Height = 78,
|
|
|
|
|
Alpha = 0,
|
2020-06-13 23:48:15 +08:00
|
|
|
|
Texture = textures.Get(@"Welcome/welcome_text")
|
2020-06-03 03:06:22 +08:00
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
2020-06-08 21:31:30 +08:00
|
|
|
|
using (BeginDelayedSequence(0, true))
|
2020-06-03 03:06:22 +08:00
|
|
|
|
{
|
2020-06-08 21:39:15 +08:00
|
|
|
|
welcomeText.ResizeHeightTo(welcomeText.Height * 2, 500, Easing.In);
|
2020-06-13 23:48:15 +08:00
|
|
|
|
welcomeText.FadeIn(delay_step_two);
|
|
|
|
|
welcomeText.ScaleTo(welcomeText.Scale + new Vector2(0.1f), delay_step_two, Easing.Out).OnComplete(_ => Expire());
|
2020-06-03 03:06:22 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|