mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 22:22:54 +08:00
Merge pull request #12958 from peppy/fix-invalid-ssdq-access
Fix `BeatmapCarousel` accessing `ScreenSpaceDrawQuad` of non-loaded children
This commit is contained in:
commit
0a3d3bc006
@ -786,9 +786,12 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkVisibleItemCount(bool diff, int count) =>
|
private void checkVisibleItemCount(bool diff, int count)
|
||||||
AddAssert($"{count} {(diff ? "diffs" : "sets")} visible", () =>
|
{
|
||||||
|
// until step required as we are querying against alive items, which are loaded asynchronously inside DrawableCarouselBeatmapSet.
|
||||||
|
AddUntilStep($"{count} {(diff ? "diffs" : "sets")} visible", () =>
|
||||||
carousel.Items.Count(s => (diff ? s.Item is CarouselBeatmap : s.Item is CarouselBeatmapSet) && s.Item.Visible) == count);
|
carousel.Items.Count(s => (diff ? s.Item is CarouselBeatmap : s.Item is CarouselBeatmapSet) && s.Item.Visible) == count);
|
||||||
|
}
|
||||||
|
|
||||||
private void checkNoSelection() => AddAssert("Selection is null", () => currentSelection == null);
|
private void checkNoSelection() => AddAssert("Selection is null", () => currentSelection == null);
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
[Resolved(CanBeNull = true)]
|
[Resolved(CanBeNull = true)]
|
||||||
private ManageCollectionsDialog manageCollectionsDialog { get; set; }
|
private ManageCollectionsDialog manageCollectionsDialog { get; set; }
|
||||||
|
|
||||||
public IEnumerable<DrawableCarouselItem> DrawableBeatmaps => beatmapContainer?.Children ?? Enumerable.Empty<DrawableCarouselItem>();
|
public IEnumerable<DrawableCarouselItem> DrawableBeatmaps => beatmapContainer?.IsLoaded != true ? Enumerable.Empty<DrawableCarouselItem>() : beatmapContainer.AliveChildren;
|
||||||
|
|
||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
private Container<DrawableCarouselItem> beatmapContainer;
|
private Container<DrawableCarouselItem> beatmapContainer;
|
||||||
|
Loading…
Reference in New Issue
Block a user