1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 14:32:55 +08:00

Improve exit procedure.

This commit is contained in:
Dean Herbert 2017-02-17 15:33:08 +09:00
parent 0b922365bb
commit 9e8b4d43dd
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
4 changed files with 14 additions and 22 deletions

View File

@ -235,17 +235,14 @@ namespace osu.Game
ModeChanged?.Invoke(newMode);
if (newMode == null)
Host.Exit();
Exit();
}
protected override bool OnExiting()
{
if (!intro.DidLoadMenu || intro.ChildGameMode != null)
{
Scheduler.Add(delegate
{
intro.MakeCurrent();
});
Scheduler.Add(intro.MakeCurrent);
return true;
}

View File

@ -218,6 +218,7 @@ namespace osu.Game.Screens.Menu
switch (state)
{
case MenuState.Exit:
case MenuState.Initial:
toolbar?.Hide();
@ -233,6 +234,12 @@ namespace osu.Game.Screens.Menu
foreach (Button b in buttonsPlay)
b.State = ButtonState.Contracted;
if (state == MenuState.Exit)
{
osuLogo.RotateTo(20, EXIT_DELAY * 1.5f);
osuLogo.FadeOut(EXIT_DELAY);
}
break;
case MenuState.TopLevel:
buttonArea.Flush(true);
@ -276,21 +283,6 @@ namespace osu.Game.Screens.Menu
foreach (Button b in buttonsPlay)
b.State = ButtonState.Contracted;
break;
case MenuState.Exit:
buttonArea.FadeOut(200);
foreach (Button b in buttonsTopLevel)
b.State = ButtonState.Contracted;
foreach (Button b in buttonsPlay)
b.State = ButtonState.Contracted;
osuLogo.Delay(150);
osuLogo.ScaleTo(1f, EXIT_DELAY * 1.5f);
osuLogo.RotateTo(20, EXIT_DELAY * 1.5f);
osuLogo.FadeOut(EXIT_DELAY);
break;
}
backButton.State = state == MenuState.Play ? ButtonState.Expanded : ButtonState.Contracted;

View File

@ -109,10 +109,13 @@ namespace osu.Game.Screens.Menu
protected override void OnResuming(GameMode last)
{
if (!(last is MainMenu))
Content.FadeIn(300);
//we also handle the exit transition.
seeya.Play();
double fadeOutTime = (last.LifetimeEnd - Time.Current) + 100;
double fadeOutTime = 2000;
Scheduler.AddDelayed(Exit, fadeOutTime);

View File

@ -95,7 +95,7 @@ namespace osu.Game.Screens.Menu
protected override bool OnExiting(GameMode next)
{
buttons.State = MenuState.Exit;
Content.FadeOut(ButtonSystem.EXIT_DELAY);
Content.FadeOut(3000);
return base.OnExiting(next);
}
}