mirror of https://github.com/ppy/osu
Apply same conditional check changes to DrawableCarouselBeatmapSet
This commit is contained in:
parent
91b13f91ea
commit
03a74a4320
|
@ -46,6 +46,7 @@ public DrawableCarouselBeatmapSet(CarouselBeatmapSet set)
|
|||
private void load(BeatmapManager manager, BeatmapSetOverlay beatmapOverlay)
|
||||
{
|
||||
restoreHiddenRequested = s => s.Beatmaps.ForEach(manager.Restore);
|
||||
|
||||
if (beatmapOverlay != null)
|
||||
viewDetails = beatmapOverlay.FetchAndShowBeatmapSet;
|
||||
|
||||
|
@ -131,13 +132,14 @@ public MenuItem[] ContextMenuItems
|
|||
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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue