Refactor how drawable carousel items are constructed

This commit is contained in:
Dean Herbert
2020-10-12 14:23:18 +09:00
parent 9193f5b0ba
commit 3143224e5b
8 changed files with 177 additions and 142 deletions

View File

@ -31,7 +31,7 @@ namespace osu.Game.Screens.Select.Carousel
{
public class DrawableCarouselBeatmap : DrawableCarouselItem, IHasContextMenu
{
public const float HEIGHT = MAX_HEIGHT;
public const float HEIGHT = MAX_HEIGHT * 0.6f;
private readonly BeatmapInfo beatmap;
@ -63,7 +63,7 @@ namespace osu.Game.Screens.Select.Carousel
: base(panel)
{
beatmap = panel.Beatmap;
Height *= 0.60f;
Height = HEIGHT;
}
[BackgroundDependencyLoader(true)]
@ -170,6 +170,8 @@ namespace osu.Game.Screens.Select.Carousel
{
base.Selected();
BorderContainer.MoveToX(Item.State.Value == CarouselItemState.Selected ? -50 : 0, 500, Easing.OutExpo);
background.Colour = ColourInfo.GradientVertical(
new Color4(20, 43, 51, 255),
new Color4(40, 86, 102, 255));