Don't track immediately when entering mode

This commit is contained in:
David Zhao 2019-05-17 11:24:34 +09:00
parent 79e86071bc
commit 5bf513eba8
2 changed files with 21 additions and 2 deletions

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Screens.Menu; using osu.Game.Screens.Menu;
using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Tests.Visual.UserInterface namespace osu.Game.Tests.Visual.UserInterface
@ -42,7 +43,25 @@ namespace osu.Game.Tests.Visual.UserInterface
buttons.SetOsuLogo(logo); buttons.SetOsuLogo(logo);
foreach (var s in Enum.GetValues(typeof(ButtonSystemState)).OfType<ButtonSystemState>().Skip(1)) foreach (var s in Enum.GetValues(typeof(ButtonSystemState)).OfType<ButtonSystemState>().Skip(1))
AddStep($"State to {s}", () => buttons.State = s); AddStep($"State to {s}", () =>
{
buttons.State = s;
if (buttons.State == ButtonSystemState.EnteringMode)
{
buttons.FadeOut(400, Easing.InSine);
buttons.MoveTo(new Vector2(-800, 0), 400, Easing.InSine);
logo.FadeOut(300, Easing.InSine)
.ScaleTo(0.2f, 300, Easing.InSine);
}
else
{
buttons.FadeIn(400, Easing.OutQuint);
buttons.MoveTo(new Vector2(0), 400, Easing.OutQuint);
logo.FadeColour(Color4.White, 100, Easing.OutQuint);
logo.FadeIn(100, Easing.OutQuint);
}
});
} }
} }
} }

View File

@ -332,7 +332,7 @@ namespace osu.Game.Screens.Menu
break; break;
case ButtonSystemState.EnteringMode: case ButtonSystemState.EnteringMode:
logoTrackingContainer.StartTracking(logo, 0, Easing.In); logoTrackingContainer.StartTracking(logo, 400, Easing.InSine);
break; break;
} }
} }