1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:07:23 +08:00

Improve song select transition to gameplay

This commit is contained in:
Dean Herbert 2022-11-04 15:14:09 +09:00
parent c244c87d91
commit c40c70509e
2 changed files with 41 additions and 5 deletions

View File

@ -770,6 +770,26 @@ namespace osu.Game.Screens.Select
{
updateItem(item);
if (!item.Item.Filtered.Value)
{
bool isSelected = item.Item.State.Value == CarouselItemState.Selected;
// Cheap way of doing animations when entering / exiting song select.
const double half_time = 50;
const float panel_x_offset_when_inactive = 200;
if (isSelected || AllowSelection)
{
item.Alpha = (float)Interpolation.DampContinuously(item.Alpha, 1, half_time, Clock.ElapsedFrameTime);
item.X = (float)Interpolation.DampContinuously(item.X, 0, half_time, Clock.ElapsedFrameTime);
}
else
{
item.Alpha = (float)Interpolation.DampContinuously(item.Alpha, 0, half_time, Clock.ElapsedFrameTime);
item.X = (float)Interpolation.DampContinuously(item.X, panel_x_offset_when_inactive, half_time, Clock.ElapsedFrameTime);
}
}
if (item is DrawableCarouselBeatmapSet set)
{
foreach (var diff in set.DrawableBeatmaps)

View File

@ -89,6 +89,8 @@ namespace osu.Game.Screens.Select
protected BeatmapCarousel Carousel { get; private set; }
private ParallaxContainer wedgeBackground;
protected Container LeftArea { get; private set; }
private BeatmapInfoWedge beatmapInfoWedge;
@ -165,10 +167,12 @@ namespace osu.Game.Screens.Select
{
new Drawable[]
{
new ParallaxContainer
wedgeBackground = new ParallaxContainer
{
ParallaxAmount = 0.005f,
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Child = new WedgeBackground
{
RelativeSizeAxes = Axes.Both,
@ -609,9 +613,15 @@ namespace osu.Game.Screens.Select
}
}
this.FadeIn(250);
LeftArea.MoveToX(0, 400, Easing.OutQuint);
LeftArea.FadeIn(100, Easing.OutQuint);
this.ScaleTo(1, 250, Easing.OutSine);
FilterControl.MoveToY(0, 400, Easing.OutQuint);
FilterControl.FadeIn(100, Easing.OutQuint);
this.FadeIn(250, Easing.OutQuint);
wedgeBackground.ScaleTo(1, 500, Easing.OutQuint);
FilterControl.Activate();
}
@ -629,9 +639,15 @@ namespace osu.Game.Screens.Select
endLooping();
this.ScaleTo(1.1f, 250, Easing.InSine);
FilterControl.MoveToY(-120, 250, Easing.OutQuint);
FilterControl.FadeOut(100);
this.FadeOut(250);
LeftArea.MoveToX(-150, 1800, Easing.OutQuint);
LeftArea.FadeOut(200, Easing.OutQuint);
wedgeBackground.ScaleTo(2.4f, 400, Easing.OutQuint);
this.FadeOut(400, Easing.OutQuint);
FilterControl.Deactivate();
base.OnSuspending(e);