mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 23:05:34 +08:00
Expose durations from MainMenu and reorder
This commit is contained in:
parent
be4e7d0f50
commit
79d6670dc5
@ -48,8 +48,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
AddStep("Exiting menu", () =>
|
AddStep("Exiting menu", () =>
|
||||||
{
|
{
|
||||||
buttons.State = ButtonSystemState.EnteringMode;
|
buttons.State = ButtonSystemState.EnteringMode;
|
||||||
buttons.FadeOut(400, Easing.InSine);
|
buttons.FadeOut(MainMenu.FADE_OUT_DURATION, Easing.InSine);
|
||||||
buttons.MoveTo(new Vector2(-800, 0), 400, Easing.InSine);
|
buttons.MoveTo(new Vector2(-800, 0), MainMenu.FADE_OUT_DURATION, Easing.InSine);
|
||||||
logo.FadeOut(300, Easing.InSine)
|
logo.FadeOut(300, Easing.InSine)
|
||||||
.ScaleTo(0.2f, 300, Easing.InSine);
|
.ScaleTo(0.2f, 300, Easing.InSine);
|
||||||
});
|
});
|
||||||
@ -57,8 +57,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
AddStep("Entering menu", () =>
|
AddStep("Entering menu", () =>
|
||||||
{
|
{
|
||||||
buttons.State = ButtonSystemState.Play;
|
buttons.State = ButtonSystemState.Play;
|
||||||
buttons.FadeIn(400, Easing.OutQuint);
|
buttons.FadeIn(MainMenu.FADE_IN_DURATION, Easing.OutQuint);
|
||||||
buttons.MoveTo(new Vector2(0), 400, Easing.OutQuint);
|
buttons.MoveTo(new Vector2(0), MainMenu.FADE_IN_DURATION, Easing.OutQuint);
|
||||||
logo.FadeColour(Color4.White, 100, Easing.OutQuint);
|
logo.FadeColour(Color4.White, 100, Easing.OutQuint);
|
||||||
logo.FadeIn(100, Easing.OutQuint);
|
logo.FadeIn(100, Easing.OutQuint);
|
||||||
});
|
});
|
||||||
|
@ -23,7 +23,9 @@ namespace osu.Game.Screens.Menu
|
|||||||
{
|
{
|
||||||
public class MainMenu : OsuScreen
|
public class MainMenu : OsuScreen
|
||||||
{
|
{
|
||||||
private ButtonSystem buttons;
|
public const float FADE_IN_DURATION = 300;
|
||||||
|
|
||||||
|
public const float FADE_OUT_DURATION = 400;
|
||||||
|
|
||||||
public override bool HideOverlaysOnEnter => buttons == null || buttons.State == ButtonSystemState.Initial;
|
public override bool HideOverlaysOnEnter => buttons == null || buttons.State == ButtonSystemState.Initial;
|
||||||
|
|
||||||
@ -35,6 +37,8 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
private MenuSideFlashes sideFlashes;
|
private MenuSideFlashes sideFlashes;
|
||||||
|
|
||||||
|
private ButtonSystem buttons;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private GameHost host { get; set; }
|
private GameHost host { get; set; }
|
||||||
|
|
||||||
@ -141,12 +145,10 @@ namespace osu.Game.Screens.Menu
|
|||||||
{
|
{
|
||||||
buttons.State = ButtonSystemState.TopLevel;
|
buttons.State = ButtonSystemState.TopLevel;
|
||||||
|
|
||||||
const float length = 300;
|
this.FadeIn(FADE_IN_DURATION, Easing.OutQuint);
|
||||||
|
this.MoveTo(new Vector2(0, 0), FADE_IN_DURATION, Easing.OutQuint);
|
||||||
|
|
||||||
this.FadeIn(length, Easing.OutQuint);
|
sideFlashes.Delay(FADE_IN_DURATION).FadeIn(64, Easing.InQuint);
|
||||||
this.MoveTo(new Vector2(0, 0), length, Easing.OutQuint);
|
|
||||||
|
|
||||||
sideFlashes.Delay(length).FadeIn(64, Easing.InQuint);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,12 +173,10 @@ namespace osu.Game.Screens.Menu
|
|||||||
{
|
{
|
||||||
base.OnSuspending(next);
|
base.OnSuspending(next);
|
||||||
|
|
||||||
const float length = 400;
|
|
||||||
|
|
||||||
buttons.State = ButtonSystemState.EnteringMode;
|
buttons.State = ButtonSystemState.EnteringMode;
|
||||||
|
|
||||||
this.FadeOut(length, Easing.InSine);
|
this.FadeOut(FADE_OUT_DURATION, Easing.InSine);
|
||||||
this.MoveTo(new Vector2(-800, 0), length, Easing.InSine);
|
this.MoveTo(new Vector2(-800, 0), FADE_OUT_DURATION, Easing.InSine);
|
||||||
|
|
||||||
sideFlashes.FadeOut(64, Easing.OutQuint);
|
sideFlashes.FadeOut(64, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user