mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 07:33:22 +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;
|
float drawHeight = DrawHeight;
|
||||||
|
|
||||||
// Remove all items that should no longer be on-screen
|
// 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
|
// Find index range of all items that should be on-screen
|
||||||
Trace.Assert(Items.Count == yPositions.Count);
|
Trace.Assert(Items.Count == yPositions.Count);
|
||||||
|
@ -30,7 +30,6 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
|
|
||||||
private DialogOverlay dialogOverlay;
|
private DialogOverlay dialogOverlay;
|
||||||
private readonly BeatmapSetInfo beatmapSet;
|
private readonly BeatmapSetInfo beatmapSet;
|
||||||
private DelayedLoadUnloadWrapper delayed;
|
|
||||||
|
|
||||||
public DrawableCarouselBeatmapSet(CarouselBeatmapSet set)
|
public DrawableCarouselBeatmapSet(CarouselBeatmapSet set)
|
||||||
: base(set)
|
: base(set)
|
||||||
@ -38,10 +37,6 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
beatmapSet = set.BeatmapSet;
|
beatmapSet = set.BeatmapSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanBeRemoved => delayed?.DelayedLoadCompleted != true;
|
|
||||||
|
|
||||||
protected override bool RequiresChildrenUpdate => true;
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(LocalisationEngine localisation, BeatmapManager manager, BeatmapSetOverlay beatmapOverlay, DialogOverlay overlay)
|
private void load(LocalisationEngine localisation, BeatmapManager manager, BeatmapSetOverlay beatmapOverlay, DialogOverlay overlay)
|
||||||
{
|
{
|
||||||
@ -55,7 +50,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
delayed = new DelayedLoadUnloadWrapper(() =>
|
new DelayedLoadUnloadWrapper(() =>
|
||||||
new PanelBackground(manager.GetWorkingBeatmap(beatmapSet.Beatmaps.FirstOrDefault()))
|
new PanelBackground(manager.GetWorkingBeatmap(beatmapSet.Beatmaps.FirstOrDefault()))
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
@ -24,11 +24,6 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
|
|
||||||
public override bool IsPresent => base.IsPresent || Item.Visible;
|
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;
|
public readonly CarouselItem Item;
|
||||||
|
|
||||||
private Container nestedContainer;
|
private Container nestedContainer;
|
||||||
@ -91,13 +86,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
base.OnHoverLost(state);
|
base.OnHoverLost(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected bool VisibleInCarousel;
|
public void SetMultiplicativeAlpha(float alpha) => borderContainer.Alpha = alpha;
|
||||||
|
|
||||||
public void SetMultiplicativeAlpha(float alpha)
|
|
||||||
{
|
|
||||||
borderContainer.Alpha = alpha;
|
|
||||||
VisibleInCarousel = alpha > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user