1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-10 22:17:20 +08:00

Adjust set panel display and animations slightly

This commit is contained in:
Dean Herbert 2025-02-28 17:37:18 +09:00
parent 4beac64bdb
commit 38de3566b1
No known key found for this signature in database
3 changed files with 18 additions and 12 deletions

View File

@ -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
{

View File

@ -25,7 +25,7 @@ namespace osu.Game.Screens.SelectV2
private const float active_x_offset = 50f;
private const float duration = 400;
protected const float DURATION = 400;
protected float PanelXOffset { get; init; }
@ -207,7 +207,7 @@ namespace osu.Game.Screens.SelectV2
protected override void PrepareForUse()
{
base.PrepareForUse();
this.FadeInFromZero(duration, Easing.OutQuint);
this.FadeInFromZero(DURATION, Easing.OutQuint);
}
protected override bool OnClick(ClickEvent e)
@ -221,10 +221,10 @@ namespace osu.Game.Screens.SelectV2
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();
@ -240,7 +240,7 @@ namespace osu.Game.Screens.SelectV2
if (!KeyboardSelected.Value)
x += active_x_offset * 0.5f;
TopLevelContent.MoveToX(x, duration, Easing.OutQuint);
TopLevelContent.MoveToX(x, DURATION, Easing.OutQuint);
}
private void updateHover()

View File

@ -48,7 +48,7 @@ namespace osu.Game.Screens.SelectV2
Icon = chevronIcon = new Container
{
Size = new Vector2(22),
Size = new Vector2(0, 22),
Child = new SpriteIcon
{
Anchor = Anchor.Centre,
@ -128,10 +128,16 @@ namespace osu.Game.Screens.SelectV2
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()