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

Fix osu! logo on main menu ending up in the wrong place

Also switch to using BeginDelayedSequence where possible.
This commit is contained in:
Dean Herbert 2017-07-11 13:20:17 +09:00
parent 2d21a7d2bf
commit a9c50786b2

View File

@ -213,6 +213,13 @@ namespace osu.Game.Screens.Menu
backButton.ContractStyle = 0;
settingsButton.ContractStyle = 0;
bool fromInitial = lastState == MenuState.Initial;
if (state == MenuState.TopLevel)
buttonArea.Flush(true);
using (buttonArea.BeginDelayedSequence(fromInitial ? 150 : 0, true))
{
switch (state)
{
case MenuState.Exit:
@ -222,9 +229,11 @@ namespace osu.Game.Screens.Menu
buttonAreaBackground.ScaleTo(Vector2.One, 500, EasingTypes.Out);
buttonArea.FadeOut(300);
osuLogo.Delay(150);
using (osuLogo.BeginDelayedSequence(150))
{
osuLogo.MoveTo(Vector2.Zero, 800, EasingTypes.OutExpo);
osuLogo.ScaleTo(1, 800, EasingTypes.OutExpo);
}
foreach (Button b in buttonsTopLevel)
b.State = ButtonState.Contracted;
@ -241,23 +250,17 @@ namespace osu.Game.Screens.Menu
sampleBack?.Play();
break;
case MenuState.TopLevel:
buttonArea.Flush(true);
buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out);
osuLogo.ClearTransforms();
osuLogo.MoveTo(buttonFlow.DrawPosition, 200, EasingTypes.In);
osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
buttonArea.FadeIn(300);
if (lastState == MenuState.Initial)
{
buttonArea.Delay(150, true);
if (osuLogo.Scale.X > 0.5f)
if (fromInitial && osuLogo.Scale.X > 0.5f)
using (osuLogo.BeginDelayedSequence(200, true))
osuLogo.Impact();
}
Scheduler.AddDelayed(() => toolbar?.Show(), 150);
@ -292,9 +295,7 @@ namespace osu.Game.Screens.Menu
backButton.State = state == MenuState.Play ? ButtonState.Expanded : ButtonState.Contracted;
settingsButton.State = state == MenuState.TopLevel ? ButtonState.Expanded : ButtonState.Contracted;
if (lastState == MenuState.Initial)
buttonArea.DelayReset();
}
}
}