Don't prompt to remove empty collection

This commit is contained in:
smoogipoo
2020-09-08 14:38:25 +09:00
parent c2da3d9c84
commit 17e8171827
2 changed files with 14 additions and 7 deletions

View File

@ -95,6 +95,9 @@ namespace osu.Game.Collections
[Resolved(CanBeNull = true)]
private DialogOverlay dialogOverlay { get; set; }
[Resolved]
private BeatmapCollectionManager collectionManager { get; set; }
private readonly BeatmapCollection collection;
private Drawable background;
@ -146,9 +149,16 @@ namespace osu.Game.Collections
protected override bool OnClick(ClickEvent e)
{
background.FlashColour(Color4.White, 150);
dialogOverlay?.Push(new DeleteCollectionDialog(collection));
if (collection.Beatmaps.Count == 0)
deleteCollection();
else
dialogOverlay?.Push(new DeleteCollectionDialog(collection, deleteCollection));
return true;
}
private void deleteCollection() => collectionManager.Collections.Remove(collection);
}
}
}