1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 03:25:11 +08:00

Merge pull request #21326 from bdach/fix-phantom-beatmap-sets

Fix phantom beatmap sets appearing on carousel after delete/update
This commit is contained in:
Dean Herbert 2022-11-21 13:25:14 +09:00 committed by GitHub
commit dfa92b3de9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -11,6 +11,7 @@ using osu.Framework.Allocation;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing;
using osu.Framework.Utils;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
@ -118,6 +119,15 @@ namespace osu.Game.Tests.Visual.SongSelect
}
}
[Test]
public void TestDeletion()
{
loadBeatmaps(count: 5, randomDifficulties: true);
AddStep("remove first set", () => carousel.RemoveBeatmapSet(carousel.Items.Select(item => item.Item).OfType<CarouselBeatmapSet>().First().BeatmapSet));
AddUntilStep("4 beatmap sets visible", () => this.ChildrenOfType<DrawableCarouselBeatmapSet>().Count(set => set.Alpha > 0) == 4);
}
[Test]
public void TestScrollPositionMaintainedOnDelete()
{

View File

@ -770,7 +770,7 @@ namespace osu.Game.Screens.Select
{
updateItem(item);
if (!item.Item.Filtered.Value)
if (item.Item.Visible)
{
bool isSelected = item.Item.State.Value == CarouselItemState.Selected;