1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 14:25:05 +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); ModeChanged?.Invoke(newMode);
if (newMode == null) if (newMode == null)
Host.Exit(); Exit();
} }
protected override bool OnExiting() protected override bool OnExiting()
{ {
if (!intro.DidLoadMenu || intro.ChildGameMode != null) if (!intro.DidLoadMenu || intro.ChildGameMode != null)
{ {
Scheduler.Add(delegate Scheduler.Add(intro.MakeCurrent);
{
intro.MakeCurrent();
});
return true; return true;
} }

View File

@ -218,6 +218,7 @@ namespace osu.Game.Screens.Menu
switch (state) switch (state)
{ {
case MenuState.Exit:
case MenuState.Initial: case MenuState.Initial:
toolbar?.Hide(); toolbar?.Hide();
@ -233,6 +234,12 @@ namespace osu.Game.Screens.Menu
foreach (Button b in buttonsPlay) foreach (Button b in buttonsPlay)
b.State = ButtonState.Contracted; b.State = ButtonState.Contracted;
if (state == MenuState.Exit)
{
osuLogo.RotateTo(20, EXIT_DELAY * 1.5f);
osuLogo.FadeOut(EXIT_DELAY);
}
break; break;
case MenuState.TopLevel: case MenuState.TopLevel:
buttonArea.Flush(true); buttonArea.Flush(true);
@ -276,21 +283,6 @@ namespace osu.Game.Screens.Menu
foreach (Button b in buttonsPlay) foreach (Button b in buttonsPlay)
b.State = ButtonState.Contracted; b.State = ButtonState.Contracted;
break; 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; 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) protected override void OnResuming(GameMode last)
{ {
if (!(last is MainMenu))
Content.FadeIn(300);
//we also handle the exit transition. //we also handle the exit transition.
seeya.Play(); seeya.Play();
double fadeOutTime = (last.LifetimeEnd - Time.Current) + 100; double fadeOutTime = 2000;
Scheduler.AddDelayed(Exit, fadeOutTime); Scheduler.AddDelayed(Exit, fadeOutTime);

View File

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