mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
Improve exit procedure.
This commit is contained in:
parent
0b922365bb
commit
9e8b4d43dd
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user