mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 14:17:26 +08:00
Add fallback intro screen
This commit is contained in:
parent
00024f56fa
commit
578c955658
15
osu.Game.Tests/Visual/Menus/TestSceneIntroFallback.cs
Normal file
15
osu.Game.Tests/Visual/Menus/TestSceneIntroFallback.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// 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 NUnit.Framework;
|
||||||
|
using osu.Framework.Screens;
|
||||||
|
using osu.Game.Screens.Menu;
|
||||||
|
|
||||||
|
namespace osu.Game.Tests.Visual.Menus
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class TestSceneIntroFallback : IntroTestScene
|
||||||
|
{
|
||||||
|
protected override IScreen CreateScreen() => new IntroFallback();
|
||||||
|
}
|
||||||
|
}
|
@ -6,6 +6,7 @@ namespace osu.Game.Configuration
|
|||||||
public enum IntroSequence
|
public enum IntroSequence
|
||||||
{
|
{
|
||||||
Circles,
|
Circles,
|
||||||
|
Fallback,
|
||||||
Triangles,
|
Triangles,
|
||||||
Random
|
Random
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,9 @@ namespace osu.Game.Screens
|
|||||||
case IntroSequence.Circles:
|
case IntroSequence.Circles:
|
||||||
return new IntroCircles();
|
return new IntroCircles();
|
||||||
|
|
||||||
|
case IntroSequence.Fallback:
|
||||||
|
return new IntroFallback();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return new IntroTriangles();
|
return new IntroTriangles();
|
||||||
}
|
}
|
||||||
|
56
osu.Game/Screens/Menu/IntroFallback.cs
Normal file
56
osu.Game/Screens/Menu/IntroFallback.cs
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
// 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 osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Audio;
|
||||||
|
using osu.Framework.Audio.Sample;
|
||||||
|
using osu.Framework.Screens;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Screens.Menu
|
||||||
|
{
|
||||||
|
public class IntroFallback : IntroScreen
|
||||||
|
{
|
||||||
|
protected override string BeatmapHash => "64E00D7022195959BFA3109D09C2E2276C8F12F486B91FCF6175583E973B48F2";
|
||||||
|
protected override string BeatmapFile => "welcome.osz";
|
||||||
|
private const double delay_step_two = 3000;
|
||||||
|
|
||||||
|
private SampleChannel welcome;
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(AudioManager audio)
|
||||||
|
{
|
||||||
|
if (MenuVoice.Value)
|
||||||
|
welcome = audio.Samples.Get(@"welcome");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LogoArriving(OsuLogo logo, bool resuming)
|
||||||
|
{
|
||||||
|
base.LogoArriving(logo, resuming);
|
||||||
|
|
||||||
|
if (!resuming)
|
||||||
|
{
|
||||||
|
welcome?.Play();
|
||||||
|
|
||||||
|
Scheduler.AddDelayed(delegate
|
||||||
|
{
|
||||||
|
StartTrack();
|
||||||
|
|
||||||
|
PrepareMenuLoad();
|
||||||
|
|
||||||
|
Scheduler.AddDelayed(LoadMenu, 0);
|
||||||
|
}, delay_step_two);
|
||||||
|
|
||||||
|
logo.ScaleTo(1);
|
||||||
|
logo.FadeIn();
|
||||||
|
logo.PlayIntro();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnSuspending(IScreen next)
|
||||||
|
{
|
||||||
|
this.FadeOut(300);
|
||||||
|
base.OnSuspending(next);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user