mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 04:53:12 +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:
parent
2d21a7d2bf
commit
a9c50786b2
@ -213,6 +213,13 @@ namespace osu.Game.Screens.Menu
|
|||||||
backButton.ContractStyle = 0;
|
backButton.ContractStyle = 0;
|
||||||
settingsButton.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)
|
switch (state)
|
||||||
{
|
{
|
||||||
case MenuState.Exit:
|
case MenuState.Exit:
|
||||||
@ -222,9 +229,11 @@ namespace osu.Game.Screens.Menu
|
|||||||
buttonAreaBackground.ScaleTo(Vector2.One, 500, EasingTypes.Out);
|
buttonAreaBackground.ScaleTo(Vector2.One, 500, EasingTypes.Out);
|
||||||
buttonArea.FadeOut(300);
|
buttonArea.FadeOut(300);
|
||||||
|
|
||||||
osuLogo.Delay(150);
|
using (osuLogo.BeginDelayedSequence(150))
|
||||||
|
{
|
||||||
osuLogo.MoveTo(Vector2.Zero, 800, EasingTypes.OutExpo);
|
osuLogo.MoveTo(Vector2.Zero, 800, EasingTypes.OutExpo);
|
||||||
osuLogo.ScaleTo(1, 800, EasingTypes.OutExpo);
|
osuLogo.ScaleTo(1, 800, EasingTypes.OutExpo);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (Button b in buttonsTopLevel)
|
foreach (Button b in buttonsTopLevel)
|
||||||
b.State = ButtonState.Contracted;
|
b.State = ButtonState.Contracted;
|
||||||
@ -241,23 +250,17 @@ namespace osu.Game.Screens.Menu
|
|||||||
sampleBack?.Play();
|
sampleBack?.Play();
|
||||||
break;
|
break;
|
||||||
case MenuState.TopLevel:
|
case MenuState.TopLevel:
|
||||||
buttonArea.Flush(true);
|
|
||||||
|
|
||||||
buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out);
|
buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out);
|
||||||
|
|
||||||
|
osuLogo.ClearTransforms();
|
||||||
osuLogo.MoveTo(buttonFlow.DrawPosition, 200, EasingTypes.In);
|
osuLogo.MoveTo(buttonFlow.DrawPosition, 200, EasingTypes.In);
|
||||||
osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
|
osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
|
||||||
|
|
||||||
buttonArea.FadeIn(300);
|
buttonArea.FadeIn(300);
|
||||||
|
|
||||||
if (lastState == MenuState.Initial)
|
if (fromInitial && osuLogo.Scale.X > 0.5f)
|
||||||
{
|
|
||||||
buttonArea.Delay(150, true);
|
|
||||||
|
|
||||||
if (osuLogo.Scale.X > 0.5f)
|
|
||||||
using (osuLogo.BeginDelayedSequence(200, true))
|
using (osuLogo.BeginDelayedSequence(200, true))
|
||||||
osuLogo.Impact();
|
osuLogo.Impact();
|
||||||
}
|
|
||||||
|
|
||||||
Scheduler.AddDelayed(() => toolbar?.Show(), 150);
|
Scheduler.AddDelayed(() => toolbar?.Show(), 150);
|
||||||
|
|
||||||
@ -292,9 +295,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
backButton.State = state == MenuState.Play ? ButtonState.Expanded : ButtonState.Contracted;
|
backButton.State = state == MenuState.Play ? ButtonState.Expanded : ButtonState.Contracted;
|
||||||
settingsButton.State = state == MenuState.TopLevel ? ButtonState.Expanded : ButtonState.Contracted;
|
settingsButton.State = state == MenuState.TopLevel ? ButtonState.Expanded : ButtonState.Contracted;
|
||||||
|
}
|
||||||
if (lastState == MenuState.Initial)
|
|
||||||
buttonArea.DelayReset();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user