1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Apply same conditional check changes to DrawableCarouselBeatmapSet

This commit is contained in:
Dean Herbert 2020-04-16 12:13:26 +09:00
parent 91b13f91ea
commit 03a74a4320

View File

@ -46,6 +46,7 @@ namespace osu.Game.Screens.Select.Carousel
private void load(BeatmapManager manager, BeatmapSetOverlay beatmapOverlay)
{
restoreHiddenRequested = s => s.Beatmaps.ForEach(manager.Restore);
if (beatmapOverlay != null)
viewDetails = beatmapOverlay.FetchAndShowBeatmapSet;
@ -131,13 +132,14 @@ namespace osu.Game.Screens.Select.Carousel
if (Item.State.Value == CarouselItemState.NotSelected)
items.Add(new OsuMenuItem("Expand", MenuItemType.Highlighted, () => Item.State.Value = CarouselItemState.Selected));
if (beatmapSet.OnlineBeatmapSetID != null)
items.Add(new OsuMenuItem("Details...", MenuItemType.Standard, () => viewDetails?.Invoke(beatmapSet.OnlineBeatmapSetID.Value)));
if (beatmapSet.OnlineBeatmapSetID != null && viewDetails != null)
items.Add(new OsuMenuItem("Details...", MenuItemType.Standard, () => viewDetails(beatmapSet.OnlineBeatmapSetID.Value)));
if (beatmapSet.Beatmaps.Any(b => b.Hidden))
items.Add(new OsuMenuItem("Restore all hidden", MenuItemType.Standard, () => restoreHiddenRequested?.Invoke(beatmapSet)));
items.Add(new OsuMenuItem("Restore all hidden", MenuItemType.Standard, () => restoreHiddenRequested(beatmapSet)));
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => dialogOverlay?.Push(new BeatmapDeleteDialog(beatmapSet))));
if (dialogOverlay != null)
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => dialogOverlay.Push(new BeatmapDeleteDialog(beatmapSet))));
return items.ToArray();
}