mirror of
https://github.com/ppy/osu.git
synced 2026-05-22 18:20:47 +08:00
Update group panel design to match latest iteration
This commit is contained in:
committed by
Dean Herbert
Unverified
parent
d9d3c93a96
commit
12e35557a5
@@ -5,10 +5,12 @@ using System.Diagnostics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Backgrounds;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Overlays;
|
||||
using osuTK;
|
||||
@@ -20,27 +22,56 @@ namespace osu.Game.Screens.SelectV2
|
||||
{
|
||||
public const float HEIGHT = CarouselItem.DEFAULT_HEIGHT * 1.2f;
|
||||
|
||||
private Drawable chevronIcon = null!;
|
||||
private Drawable iconContainer = null!;
|
||||
private OsuSpriteText titleText = null!;
|
||||
private TrianglesV2 triangles = null!;
|
||||
private Box glow = null!;
|
||||
|
||||
[Resolved]
|
||||
private OverlayColourProvider colourProvider { get; set; } = null!;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
private void load()
|
||||
{
|
||||
Height = HEIGHT;
|
||||
|
||||
Icon = chevronIcon = new SpriteIcon
|
||||
Icon = iconContainer = new Container
|
||||
{
|
||||
AlwaysPresent = true,
|
||||
Icon = FontAwesome.Solid.ChevronDown,
|
||||
Size = new Vector2(12),
|
||||
Margin = new MarginPadding { Horizontal = 5f },
|
||||
X = 2f,
|
||||
Colour = colourProvider.Background3,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Child = new SpriteIcon
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Icon = FontAwesome.Solid.ChevronDown,
|
||||
Size = new Vector2(12),
|
||||
Colour = colourProvider.Background3,
|
||||
},
|
||||
};
|
||||
Background = new Box
|
||||
Background = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = colourProvider.Dark1,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = colourProvider.Background5,
|
||||
},
|
||||
triangles = new TrianglesV2
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Thickness = 0.02f,
|
||||
SpawnRatio = 0.6f,
|
||||
Colour = ColourInfo.GradientHorizontal(colourProvider.Background6, colourProvider.Background5)
|
||||
},
|
||||
glow = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Width = 0.5f,
|
||||
Colour = ColourInfo.GradientHorizontal(colourProvider.Highlight1, colourProvider.Highlight1.Opacity(0f)),
|
||||
},
|
||||
},
|
||||
};
|
||||
AccentColour = colourProvider.Highlight1;
|
||||
Content.Children = new Drawable[]
|
||||
@@ -77,7 +108,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
UseFullGlyphHeight = false,
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -92,8 +123,15 @@ namespace osu.Game.Screens.SelectV2
|
||||
{
|
||||
const float duration = 500;
|
||||
|
||||
chevronIcon.ResizeWidthTo(Expanded.Value ? 12f : 0f, duration, Easing.OutQuint);
|
||||
chevronIcon.FadeTo(Expanded.Value ? 1f : 0f, duration, Easing.OutQuint);
|
||||
iconContainer.ResizeWidthTo(Expanded.Value ? 20f : 5f, duration, Easing.OutQuint);
|
||||
iconContainer.FadeTo(Expanded.Value ? 1f : 0f, duration, Easing.OutQuint);
|
||||
|
||||
ColourInfo colour = Expanded.Value
|
||||
? ColourInfo.GradientHorizontal(colourProvider.Highlight1.Opacity(0.25f), colourProvider.Highlight1.Opacity(0f))
|
||||
: ColourInfo.GradientHorizontal(colourProvider.Background6, colourProvider.Background5);
|
||||
|
||||
triangles.FadeColour(colour, duration, Easing.OutQuint);
|
||||
glow.FadeTo(Expanded.Value ? 0.4f : 0, duration, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void PrepareForUse()
|
||||
|
||||
Reference in New Issue
Block a user