mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 01:02:55 +08:00
Simplify implementation in line with framework improvements
This commit is contained in:
parent
7d2acfac51
commit
c23b9b61a8
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user