1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Rename and document method to limit scope

This commit is contained in:
Dean Herbert 2023-02-03 15:04:47 +09:00
parent 91fbf388da
commit f7094567d7
3 changed files with 12 additions and 6 deletions

View File

@ -85,7 +85,7 @@ namespace osu.Game.Screens.Select.Carousel
if (songSelect != null)
{
mainMenuItems = songSelect.CreateMenuItemsForBeatmap(beatmapInfo);
mainMenuItems = songSelect.CreateForwardNavigationMenuItemsForBeatmap(beatmapInfo);
selectRequested = b => songSelect.FinaliseSelection(b);
}

View File

@ -34,10 +34,10 @@ namespace osu.Game.Screens.Select
public override bool AllowExternalScreenChange => true;
public override MenuItem[] CreateMenuItemsForBeatmap(BeatmapInfo b) => new MenuItem[]
public override MenuItem[] CreateForwardNavigationMenuItemsForBeatmap(BeatmapInfo beatmap) => new MenuItem[]
{
new OsuMenuItem(ButtonSystemStrings.Play.ToSentence(), MenuItemType.Highlighted, () => FinaliseSelection(b)),
new OsuMenuItem(ButtonSystemStrings.Edit.ToSentence(), MenuItemType.Standard, () => Edit(b))
new OsuMenuItem(ButtonSystemStrings.Play.ToSentence(), MenuItemType.Highlighted, () => FinaliseSelection(beatmap)),
new OsuMenuItem(ButtonSystemStrings.Edit.ToSentence(), MenuItemType.Standard, () => Edit(beatmap))
};
protected override UserActivity InitialActivity => new UserActivity.ChoosingBeatmap();

View File

@ -84,9 +84,15 @@ namespace osu.Game.Screens.Select
public bool BeatmapSetsLoaded => IsLoaded && Carousel.BeatmapSetsLoaded;
public virtual MenuItem[] CreateMenuItemsForBeatmap(BeatmapInfo b) => new MenuItem[]
/// <summary>
/// Creates any "action" menu items for the provided beatmap (ie. "Select", "Play", "Edit").
/// These will always be placed at the top of the context menu, with common items added below them.
/// </summary>
/// <param name="beatmap">The beatmap to create items for.</param>
/// <returns>The menu items.</returns>
public virtual MenuItem[] CreateForwardNavigationMenuItemsForBeatmap(BeatmapInfo beatmap) => new MenuItem[]
{
new OsuMenuItem(@"Select", MenuItemType.Highlighted, () => FinaliseSelection(b))
new OsuMenuItem(@"Select", MenuItemType.Highlighted, () => FinaliseSelection(beatmap))
};
[Resolved]