diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index 625d2aa0b0..40287eda21 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Toolbar private ToolbarModeSelector modeSelector; - private const int transition_time = 250; + private const int transition_time = 300; private const float alpha_hovering = 0.8f; private const float alpha_normal = 0.6f; @@ -127,7 +127,7 @@ namespace osu.Game.Overlays.Toolbar protected override void PopIn() { MoveToY(0, transition_time, EasingTypes.OutQuint); - FadeIn(transition_time, EasingTypes.OutQuint); + FadeIn(transition_time / 2, EasingTypes.OutQuint); } protected override void PopOut() diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 67802ab2f3..a76cdbe99b 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -14,6 +14,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Input; using osu.Game.Graphics; +using osu.Game.Overlays.Toolbar; using OpenTK; using OpenTK.Graphics; using OpenTK.Input; @@ -33,6 +34,8 @@ namespace osu.Game.Screens.Menu private AudioSample sampleOsuClick; + private Toolbar toolbar; + private FlowContainerWithOrigin buttonFlow; //todo: make these non-internal somehow. @@ -117,9 +120,10 @@ namespace osu.Game.Screens.Menu } [BackgroundDependencyLoader] - private void load(AudioManager audio) + private void load(AudioManager audio, OsuGame game) { sampleOsuClick = audio.Sample.Get(@"Menu/menuhit"); + toolbar = game.Toolbar; } protected override void LoadComplete() @@ -150,7 +154,7 @@ namespace osu.Game.Screens.Menu return true; } - + return false; } @@ -215,6 +219,8 @@ namespace osu.Game.Screens.Menu switch (state) { case MenuState.Initial: + toolbar?.Hide(); + buttonAreaBackground.ScaleTo(Vector2.One, 500, EasingTypes.Out); buttonArea.FadeOut(300); @@ -239,9 +245,10 @@ namespace osu.Game.Screens.Menu buttonArea.FadeIn(300); if (lastState == MenuState.Initial) - //todo: this propagates to invisible children and causes delays later down the track (on first MenuState.Play) buttonArea.Delay(150, true); + Scheduler.AddDelayed(() => toolbar?.Show(), 150); + foreach (Button b in buttonsTopLevel) b.State = ButtonState.Expanded; diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 9a715c17be..f672a3998b 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -1,20 +1,16 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using osu.Framework.Allocation; using osu.Framework.GameModes; using osu.Framework.GameModes.Testing; using osu.Framework.Graphics; using osu.Framework.Graphics.Transformations; using osu.Game.Graphics.Containers; -using osu.Game.Modes; using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Charts; using osu.Game.Screens.Direct; -using osu.Game.Screens.Edit; using osu.Game.Screens.Multiplayer; -using osu.Game.Screens.Play; using OpenTK; using osu.Game.Screens.Select; @@ -25,7 +21,7 @@ namespace osu.Game.Screens.Menu private ButtonSystem buttons; public override string Name => @"Main Menu"; - internal override bool ShowOverlays => true; + internal override bool ShowOverlays => buttons.State != MenuState.Initial; private BackgroundMode background; @@ -42,7 +38,7 @@ namespace osu.Game.Screens.Menu ParallaxAmount = 0.01f, Children = new Drawable[] { - buttons = new ButtonSystem() + buttons = new ButtonSystem { OnChart = delegate { Push(new ChartListing()); }, OnDirect = delegate { Push(new OnlineListing()); }, @@ -63,11 +59,11 @@ namespace osu.Game.Screens.Menu background.Preload(game); buttons.OnSettings = game.ToggleOptions; + } protected override void OnEntering(GameMode last) { - base.OnEntering(last); buttons.FadeInFromZero(500); }