From 3ba119c115ab895f607b8657228dfb8078220a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 18 Jul 2017 17:09:53 +0300 Subject: [PATCH] Ensure toolbar disappears when osu logo transition is cancelled --- osu.Game/Screens/Menu/ButtonSystem.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 7ff514203e..cd0d51b15e 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -224,12 +224,11 @@ namespace osu.Game.Screens.Menu { case MenuState.Exit: case MenuState.Initial: - toolbar?.Hide(); - buttonAreaBackground.ScaleTo(Vector2.One, 500, EasingTypes.Out); buttonArea.FadeOut(300); osuLogo.Delay(150) + .Schedule(() => toolbar?.Hide()) .ScaleTo(1, 800, EasingTypes.OutExpo) .MoveTo(Vector2.Zero, 800, EasingTypes.OutExpo); @@ -250,16 +249,19 @@ namespace osu.Game.Screens.Menu case MenuState.TopLevel: buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out); - osuLogo.MoveTo(buttonFlow.DrawPosition, 200, EasingTypes.In); - var sequence = osuLogo.ScaleTo(0.5f, 200, EasingTypes.In); + var sequence = osuLogo + .ScaleTo(0.5f, 200, EasingTypes.In) + .MoveTo(buttonFlow.DrawPosition, 200, EasingTypes.In); if (fromInitial && osuLogo.Scale.X > 0.5f) - sequence.OnComplete(o => o.Impact()); + sequence.OnComplete(o => + { + o.Impact(); + toolbar?.Show(); + }); buttonArea.FadeIn(300); - Scheduler.AddDelayed(() => toolbar?.Show(), 150); - foreach (Button b in buttonsTopLevel) b.State = ButtonState.Expanded;