1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 23:12:56 +08:00

Simplify implementation in line with framework improvements

This commit is contained in:
Dean Herbert 2018-09-06 17:27:21 +09:00
parent 7d2acfac51
commit c23b9b61a8
3 changed files with 3 additions and 19 deletions

View File

@ -424,7 +424,7 @@ namespace osu.Game.Screens.Select
float drawHeight = DrawHeight;
// Remove all items that should no longer be on-screen
scrollableContent.RemoveAll(p => p.CanBeRemoved && (p.Y < Current - p.DrawHeight || p.Y > Current + drawHeight || !p.IsPresent));
scrollableContent.RemoveAll(p => p.Y < Current - p.DrawHeight || p.Y > Current + drawHeight || !p.IsPresent);
// Find index range of all items that should be on-screen
Trace.Assert(Items.Count == yPositions.Count);

View File

@ -30,7 +30,6 @@ namespace osu.Game.Screens.Select.Carousel
private DialogOverlay dialogOverlay;
private readonly BeatmapSetInfo beatmapSet;
private DelayedLoadUnloadWrapper delayed;
public DrawableCarouselBeatmapSet(CarouselBeatmapSet set)
: base(set)
@ -38,10 +37,6 @@ namespace osu.Game.Screens.Select.Carousel
beatmapSet = set.BeatmapSet;
}
public override bool CanBeRemoved => delayed?.DelayedLoadCompleted != true;
protected override bool RequiresChildrenUpdate => true;
[BackgroundDependencyLoader(true)]
private void load(LocalisationEngine localisation, BeatmapManager manager, BeatmapSetOverlay beatmapOverlay, DialogOverlay overlay)
{
@ -55,7 +50,7 @@ namespace osu.Game.Screens.Select.Carousel
Children = new Drawable[]
{
delayed = new DelayedLoadUnloadWrapper(() =>
new DelayedLoadUnloadWrapper(() =>
new PanelBackground(manager.GetWorkingBeatmap(beatmapSet.Beatmaps.FirstOrDefault()))
{
RelativeSizeAxes = Axes.Both,

View File

@ -24,11 +24,6 @@ namespace osu.Game.Screens.Select.Carousel
public override bool IsPresent => base.IsPresent || Item.Visible;
/// <summary>
/// Whether this item can be removed from the scroll container (usually due to being off-screen).
/// </summary>
public virtual bool CanBeRemoved => true;
public readonly CarouselItem Item;
private Container nestedContainer;
@ -91,13 +86,7 @@ namespace osu.Game.Screens.Select.Carousel
base.OnHoverLost(state);
}
protected bool VisibleInCarousel;
public void SetMultiplicativeAlpha(float alpha)
{
borderContainer.Alpha = alpha;
VisibleInCarousel = alpha > 0;
}
public void SetMultiplicativeAlpha(float alpha) => borderContainer.Alpha = alpha;
protected override void LoadComplete()
{