Skip to content

Commit

Permalink
Adjust set panel display and animations slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Feb 28, 2025
1 parent b05ed7a commit 1c13b0f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion osu.Game/Screens/SelectV2/BeatmapSetPanelBackground.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace osu.Game.Screens.SelectV2
{
public partial class BeatmapSetPanelBackground : ModelBackedDrawable<WorkingBeatmap>
{
protected override bool TransformImmediately => true;
protected override double TransformDuration => 400;

public WorkingBeatmap? Beatmap
{
Expand Down
12 changes: 6 additions & 6 deletions osu.Game/Screens/SelectV2/PanelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public abstract partial class PanelBase : PoolableDrawable, ICarouselPanel

private const float active_x_offset = 50f;

private const float duration = 400;
protected const float DURATION = 400;

protected float PanelXOffset { get; init; }

Expand Down Expand Up @@ -205,7 +205,7 @@ protected override void LoadComplete()
protected override void PrepareForUse()
{
base.PrepareForUse();
this.FadeInFromZero(duration, Easing.OutQuint);
this.FadeInFromZero(DURATION, Easing.OutQuint);
}

protected override bool OnClick(ClickEvent e)
Expand All @@ -219,10 +219,10 @@ private void updateDisplay()
var backgroundColour = accentColour ?? Color4.White;
var edgeEffectColour = accentColour ?? Color4Extensions.FromHex(@"4EBFFF");

backgroundAccentGradient.FadeColour(ColourInfo.GradientHorizontal(backgroundColour.Opacity(0.25f), backgroundColour.Opacity(0f)), duration, Easing.OutQuint);
backgroundBorder.FadeColour(backgroundColour, duration, Easing.OutQuint);
backgroundAccentGradient.FadeColour(ColourInfo.GradientHorizontal(backgroundColour.Opacity(0.25f), backgroundColour.Opacity(0f)), DURATION, Easing.OutQuint);
backgroundBorder.FadeColour(backgroundColour, DURATION, Easing.OutQuint);

TopLevelContent.FadeEdgeEffectTo(Expanded.Value ? edgeEffectColour.Opacity(0.5f) : Color4.Black.Opacity(0.4f), duration, Easing.OutQuint);
TopLevelContent.FadeEdgeEffectTo(Expanded.Value ? edgeEffectColour.Opacity(0.5f) : Color4.Black.Opacity(0.4f), DURATION, Easing.OutQuint);

updateXOffset();
updateHover();
Expand All @@ -238,7 +238,7 @@ private void updateXOffset()
if (!KeyboardSelected.Value)
x += active_x_offset * 0.5f;

TopLevelContent.MoveToX(x, duration, Easing.OutQuint);
TopLevelContent.MoveToX(x, DURATION, Easing.OutQuint);
}

private void updateHover()
Expand Down
16 changes: 11 additions & 5 deletions osu.Game/Screens/SelectV2/PanelBeatmapSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private void load()

Icon = chevronIcon = new Container
{
Size = new Vector2(22),
Size = new Vector2(0, 22),
Child = new SpriteIcon
{
Anchor = Anchor.Centre,
Expand Down Expand Up @@ -128,10 +128,16 @@ protected override void LoadComplete()

private void onExpanded()
{
const float duration = 500;

chevronIcon.ResizeWidthTo(Expanded.Value ? 22 : 0f, duration, Easing.OutQuint);
chevronIcon.FadeTo(Expanded.Value ? 1f : 0f, duration, Easing.OutQuint);
if (Expanded.Value)
{
chevronIcon.ResizeWidthTo(18, 600, Easing.OutElasticQuarter);
chevronIcon.FadeTo(1f, DURATION, Easing.OutQuint);
}
else
{
chevronIcon.ResizeWidthTo(0f, DURATION, Easing.OutQuint);
chevronIcon.FadeTo(0f, DURATION, Easing.OutQuint);
}
}

protected override void PrepareForUse()
Expand Down

0 comments on commit 1c13b0f

Please sign in to comment.