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

@ -12,7 +12,20 @@ namespace osu.Game.Screens.Select.Carousel
{
public class CarouselBeatmapSet : CarouselGroupEagerSelect
{
public float TotalHeight => DrawableCarouselBeatmapSet.HEIGHT + BeatmapSet.Beatmaps.Count * DrawableCarouselBeatmap.HEIGHT;
public override float TotalHeight
{
get
{
switch (State.Value)
{
case CarouselItemState.Selected:
return DrawableCarouselBeatmapSet.HEIGHT + Children.Count * DrawableCarouselBeatmap.HEIGHT;
default:
return DrawableCarouselBeatmapSet.HEIGHT;
}
}
}
public IEnumerable<CarouselBeatmap> Beatmaps => InternalChildren.OfType<CarouselBeatmap>();