mirror of https://github.com/ppy/osu
Reorder file contents
This commit is contained in:
parent
a0bb193342
commit
4ba2dccde3
|
@ -21,6 +21,11 @@ namespace osu.Game.Screens.Menu
|
|||
{
|
||||
public abstract class IntroScreen : StartupScreen
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether we have loaded the menu previously.
|
||||
/// </summary>
|
||||
public bool DidLoadMenu { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// A hash used to find the associated beatmap if already imported.
|
||||
/// </summary>
|
||||
|
@ -32,35 +37,28 @@ public abstract class IntroScreen : StartupScreen
|
|||
/// </summary>
|
||||
protected abstract string BeatmapFile { get; }
|
||||
|
||||
private readonly BindableDouble exitingVolumeFade = new BindableDouble(1);
|
||||
|
||||
private const int exit_delay = 3000;
|
||||
|
||||
[Resolved]
|
||||
private AudioManager audio { get; set; }
|
||||
|
||||
protected SampleChannel Welcome;
|
||||
|
||||
private SampleChannel seeya;
|
||||
|
||||
protected Bindable<bool> MenuVoice;
|
||||
|
||||
protected Bindable<bool> MenuMusic;
|
||||
|
||||
protected WorkingBeatmap IntroBeatmap;
|
||||
|
||||
protected Track Track { get; private set; }
|
||||
|
||||
protected WorkingBeatmap IntroBeatmap;
|
||||
private readonly BindableDouble exitingVolumeFade = new BindableDouble(1);
|
||||
|
||||
private const int exit_delay = 3000;
|
||||
|
||||
private SampleChannel seeya;
|
||||
|
||||
private LeasedBindable<WorkingBeatmap> beatmap;
|
||||
|
||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBlack();
|
||||
private MainMenu mainMenu;
|
||||
|
||||
protected void StartTrack()
|
||||
{
|
||||
// Only start the current track if it is the menu music. A beatmap's track is started when entering the Main Menu.
|
||||
if (MenuMusic.Value)
|
||||
Track.Restart();
|
||||
}
|
||||
[Resolved]
|
||||
private AudioManager audio { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config, SkinManager skinManager, BeatmapManager beatmaps, Framework.Game game)
|
||||
|
@ -100,16 +98,7 @@ private void load(OsuConfigManager config, SkinManager skinManager, BeatmapManag
|
|||
Track = IntroBeatmap.Track;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether we have loaded the menu previously.
|
||||
/// </summary>
|
||||
public bool DidLoadMenu { get; private set; }
|
||||
|
||||
public override bool OnExiting(IScreen next)
|
||||
{
|
||||
//cancel exiting if we haven't loaded the menu yet.
|
||||
return !DidLoadMenu;
|
||||
}
|
||||
public override bool OnExiting(IScreen next) => !DidLoadMenu;
|
||||
|
||||
public override void OnResuming(IScreen last)
|
||||
{
|
||||
|
@ -131,6 +120,21 @@ public override void OnResuming(IScreen last)
|
|||
base.OnResuming(last);
|
||||
}
|
||||
|
||||
public override void OnSuspending(IScreen next)
|
||||
{
|
||||
base.OnSuspending(next);
|
||||
Track = null;
|
||||
}
|
||||
|
||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBlack();
|
||||
|
||||
protected void StartTrack()
|
||||
{
|
||||
// Only start the current track if it is the menu music. A beatmap's track is started when entering the Main Menu.
|
||||
if (MenuMusic.Value)
|
||||
Track.Restart();
|
||||
}
|
||||
|
||||
protected override void LogoArriving(OsuLogo logo, bool resuming)
|
||||
{
|
||||
base.LogoArriving(logo, resuming);
|
||||
|
@ -151,7 +155,7 @@ protected override void LogoArriving(OsuLogo logo, bool resuming)
|
|||
else
|
||||
{
|
||||
const int quick_appear = 350;
|
||||
int initialMovementTime = logo.Alpha > 0.2f ? quick_appear : 0;
|
||||
var initialMovementTime = logo.Alpha > 0.2f ? quick_appear : 0;
|
||||
|
||||
logo.MoveTo(new Vector2(0.5f), initialMovementTime, Easing.OutQuint);
|
||||
|
||||
|
@ -164,18 +168,7 @@ protected override void LogoArriving(OsuLogo logo, bool resuming)
|
|||
}
|
||||
}
|
||||
|
||||
public override void OnSuspending(IScreen next)
|
||||
{
|
||||
base.OnSuspending(next);
|
||||
Track = null;
|
||||
}
|
||||
|
||||
private MainMenu mainMenu;
|
||||
|
||||
protected void PrepareMenuLoad()
|
||||
{
|
||||
LoadComponentAsync(mainMenu = new MainMenu());
|
||||
}
|
||||
protected void PrepareMenuLoad() => LoadComponentAsync(mainMenu = new MainMenu());
|
||||
|
||||
protected void LoadMenu()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue