2020-06-02 19:06:22 +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.
|
|
|
|
|
|
|
|
|
|
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;
|
2020-06-24 02:08:32 +00:00
|
|
|
|
using osu.Game.Screens.Backgrounds;
|
2020-06-02 19:06:22 +00:00
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Menu
|
|
|
|
|
{
|
|
|
|
|
public class IntroWelcome : IntroScreen
|
|
|
|
|
{
|
2020-06-12 13:57:23 +00:00
|
|
|
|
protected override string BeatmapHash => "64e00d7022195959bfa3109d09c2e2276c8f12f486b91fcf6175583e973b48f2";
|
2020-06-02 19:06:22 +00:00
|
|
|
|
protected override string BeatmapFile => "welcome.osz";
|
|
|
|
|
private const double delay_step_two = 2142;
|
|
|
|
|
private SampleChannel welcome;
|
2020-06-03 09:39:08 +00:00
|
|
|
|
private SampleChannel pianoReverb;
|
2020-06-13 15:48:15 +00:00
|
|
|
|
protected override string SeeyaSampleName => "Intro/Welcome/seeya";
|
2020-06-02 19:06:22 +00:00
|
|
|
|
|
2020-06-24 02:08:32 +00:00
|
|
|
|
protected override BackgroundScreen CreateBackground() => background = new BackgroundScreenDefault(false)
|
|
|
|
|
{
|
|
|
|
|
Alpha = 0,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private BackgroundScreenDefault background;
|
|
|
|
|
|
2020-06-02 19:06:22 +00:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(AudioManager audio)
|
|
|
|
|
{
|
|
|
|
|
if (MenuVoice.Value)
|
2020-06-13 15:48:15 +00:00
|
|
|
|
welcome = audio.Samples.Get(@"Intro/Welcome/welcome");
|
|
|
|
|
|
|
|
|
|
pianoReverb = audio.Samples.Get(@"Intro/Welcome/welcome_piano");
|
2020-06-02 19:06:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LogoArriving(OsuLogo logo, bool resuming)
|
|
|
|
|
{
|
|
|
|
|
base.LogoArriving(logo, resuming);
|
|
|
|
|
|
|
|
|
|
if (!resuming)
|
|
|
|
|
{
|
2020-08-06 09:54:08 +00:00
|
|
|
|
Track.Looping = true;
|
|
|
|
|
|
2020-06-23 04:33:33 +00:00
|
|
|
|
LoadComponentAsync(new WelcomeIntroSequence
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both
|
|
|
|
|
}, intro =>
|
2020-06-02 19:06:22 +00:00
|
|
|
|
{
|
2020-06-24 02:08:32 +00:00
|
|
|
|
PrepareMenuLoad();
|
|
|
|
|
|
2020-06-23 04:55:44 +00:00
|
|
|
|
intro.LogoVisualisation.AddAmplitudeSource(pianoReverb);
|
|
|
|
|
|
2020-06-23 04:33:33 +00:00
|
|
|
|
AddInternal(intro);
|
2020-06-02 19:06:22 +00:00
|
|
|
|
|
2020-06-23 04:33:33 +00:00
|
|
|
|
welcome?.Play();
|
|
|
|
|
pianoReverb?.Play();
|
2020-06-02 19:06:22 +00:00
|
|
|
|
|
2020-06-23 04:33:33 +00:00
|
|
|
|
Scheduler.AddDelayed(() =>
|
|
|
|
|
{
|
|
|
|
|
StartTrack();
|
2020-06-24 02:08:32 +00:00
|
|
|
|
|
|
|
|
|
const float fade_in_time = 200;
|
2020-06-02 19:06:22 +00:00
|
|
|
|
|
2020-06-23 04:33:33 +00:00
|
|
|
|
logo.ScaleTo(1);
|
2020-06-24 02:08:32 +00:00
|
|
|
|
logo.FadeIn(fade_in_time);
|
|
|
|
|
|
|
|
|
|
background.FadeIn(fade_in_time);
|
2020-06-23 04:33:33 +00:00
|
|
|
|
|
2020-06-24 02:08:32 +00:00
|
|
|
|
LoadMenu();
|
2020-06-23 04:33:33 +00:00
|
|
|
|
}, delay_step_two);
|
|
|
|
|
});
|
2020-06-02 19:06:22 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-24 02:08:32 +00:00
|
|
|
|
public override void OnResuming(IScreen last)
|
2020-06-02 19:06:22 +00:00
|
|
|
|
{
|
2020-06-24 02:08:32 +00:00
|
|
|
|
base.OnResuming(last);
|
|
|
|
|
background.FadeOut(100);
|
2020-06-02 19:06:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private class WelcomeIntroSequence : Container
|
|
|
|
|
{
|
|
|
|
|
private Sprite welcomeText;
|
2020-06-22 09:01:08 +00:00
|
|
|
|
private Container scaleContainer;
|
2020-06-02 19:06:22 +00:00
|
|
|
|
|
2020-06-23 04:55:44 +00:00
|
|
|
|
public LogoVisualisation LogoVisualisation { get; private set; }
|
|
|
|
|
|
2020-06-02 19:06:22 +00:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(TextureStore textures)
|
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
Anchor = Anchor.Centre;
|
2020-06-22 09:01:08 +00:00
|
|
|
|
|
2020-06-02 19:06:22 +00:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2020-06-22 09:01:08 +00:00
|
|
|
|
scaleContainer = new Container
|
2020-06-02 19:06:22 +00:00
|
|
|
|
{
|
2020-06-22 09:01:08 +00:00
|
|
|
|
AutoSizeAxes = Axes.Both,
|
2020-06-02 19:06:22 +00:00
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2020-06-23 04:55:44 +00:00
|
|
|
|
LogoVisualisation = new LogoVisualisation
|
2020-06-22 09:01:08 +00:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Alpha = 0.5f,
|
|
|
|
|
AccentColour = Color4.DarkBlue,
|
|
|
|
|
Size = new Vector2(0.96f)
|
|
|
|
|
},
|
|
|
|
|
new Circle
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Size = new Vector2(480),
|
|
|
|
|
Colour = Color4.Black
|
|
|
|
|
},
|
|
|
|
|
welcomeText = new Sprite
|
2020-06-02 19:06:22 +00:00
|
|
|
|
{
|
2020-06-22 09:01:08 +00:00
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Texture = textures.Get(@"Intro/Welcome/welcome_text")
|
|
|
|
|
},
|
2020-06-02 19:06:22 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
2020-06-08 13:31:30 +00:00
|
|
|
|
using (BeginDelayedSequence(0, true))
|
2020-06-02 19:06:22 +00:00
|
|
|
|
{
|
2020-06-22 09:01:08 +00:00
|
|
|
|
scaleContainer.ScaleTo(0.9f).ScaleTo(1, delay_step_two).OnComplete(_ => Expire());
|
|
|
|
|
scaleContainer.FadeInFromZero(1800);
|
|
|
|
|
|
|
|
|
|
welcomeText.ScaleTo(new Vector2(1, 0)).ScaleTo(Vector2.One, 400, Easing.Out);
|
2020-06-02 19:06:22 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|