mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 15:33:05 +08:00
Add beatmap details menu item to playlist items
This commit is contained in:
parent
728487b7fb
commit
036e64382f
@ -30,6 +30,7 @@ using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.BeatmapSet;
|
||||
using osu.Game.Resources.Localisation.Web;
|
||||
using osu.Game.Rulesets;
|
||||
@ -107,6 +108,9 @@ namespace osu.Game.Screens.OnlinePlay
|
||||
[Resolved]
|
||||
private BeatmapLookupCache beatmapLookupCache { get; set; }
|
||||
|
||||
[Resolved(CanBeNull = true)]
|
||||
private BeatmapSetOverlay beatmapOverlay { get; set; }
|
||||
|
||||
[Resolved(CanBeNull = true)]
|
||||
private CollectionManager collectionManager { get; set; }
|
||||
|
||||
@ -496,9 +500,10 @@ namespace osu.Game.Screens.OnlinePlay
|
||||
{
|
||||
List<MenuItem> items = new List<MenuItem>();
|
||||
|
||||
if (beatmap != null && collectionManager != null)
|
||||
{
|
||||
if (downloadTracker.State.Value == DownloadState.LocallyAvailable)
|
||||
if (beatmapOverlay != null)
|
||||
items.Add(new OsuMenuItem("Details...", MenuItemType.Standard, () => beatmapOverlay.FetchAndShowBeatmap(Item.Beatmap.OnlineID)));
|
||||
|
||||
if (beatmap != null && collectionManager != null && downloadTracker.State.Value == DownloadState.LocallyAvailable)
|
||||
{
|
||||
var collectionItems = collectionManager.Collections.Select(c => new CollectionToggleMenuItem(c, beatmap)).Cast<OsuMenuItem>().ToList();
|
||||
if (manageCollectionsDialog != null)
|
||||
@ -506,9 +511,6 @@ namespace osu.Game.Screens.OnlinePlay
|
||||
|
||||
items.Add(new OsuMenuItem("Collections") { Items = collectionItems });
|
||||
}
|
||||
else
|
||||
items.Add(new OsuMenuItem("Download to add to collection") { Action = { Disabled = true } });
|
||||
}
|
||||
|
||||
return items.ToArray();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user