mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Add context menu to beatmap set header
This commit is contained in:
@ -140,6 +140,8 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public Action StartRequested;
|
||||
|
||||
public Action<WorkingBeatmap> DeleteRequested;
|
||||
|
||||
public void SelectNext(int direction = 1, bool skipDifficulties = true)
|
||||
{
|
||||
if (groups.All(g => g.State == BeatmapGroupState.Hidden))
|
||||
@ -305,6 +307,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
SelectionChanged = (g, p) => selectGroup(g, p),
|
||||
StartRequested = b => StartRequested?.Invoke(),
|
||||
DeleteRequested = b => DeleteRequested?.Invoke(b),
|
||||
State = BeatmapGroupState.Collapsed
|
||||
};
|
||||
}
|
||||
|
@ -106,6 +106,7 @@ namespace osu.Game.Screens.Select
|
||||
Origin = Anchor.CentreRight,
|
||||
SelectionChanged = carouselSelectionChanged,
|
||||
BeatmapsChanged = carouselBeatmapsLoaded,
|
||||
DeleteRequested = b => promptDelete(b),
|
||||
StartRequested = () => carouselRaisedStart(),
|
||||
});
|
||||
Add(FilterControl = new FilterControl
|
||||
@ -163,7 +164,7 @@ namespace osu.Game.Screens.Select
|
||||
Footer.AddButton(@"random", colours.Green, triggerRandom, Key.F2);
|
||||
Footer.AddButton(@"options", colours.Blue, BeatmapOptions.ToggleVisibility, Key.F3);
|
||||
|
||||
BeatmapOptions.AddButton(@"Delete", @"Beatmap", FontAwesome.fa_trash, colours.Pink, promptDelete, Key.Number4, float.MaxValue);
|
||||
BeatmapOptions.AddButton(@"Delete", @"Beatmap", FontAwesome.fa_trash, colours.Pink, () => promptDelete(Beatmap), Key.Number4, float.MaxValue);
|
||||
}
|
||||
|
||||
if (manager == null)
|
||||
@ -389,10 +390,12 @@ namespace osu.Game.Screens.Select
|
||||
Beatmap.SetDefault();
|
||||
}
|
||||
|
||||
private void promptDelete()
|
||||
private void promptDelete(WorkingBeatmap beatmap)
|
||||
{
|
||||
if (Beatmap != null && !Beatmap.IsDefault)
|
||||
dialogOverlay?.Push(new BeatmapDeleteDialog(Beatmap));
|
||||
if (beatmap == null)
|
||||
return;
|
||||
|
||||
dialogOverlay?.Push(new BeatmapDeleteDialog(beatmap));
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
@ -408,7 +411,8 @@ namespace osu.Game.Screens.Select
|
||||
case Key.Delete:
|
||||
if (state.Keyboard.ShiftPressed)
|
||||
{
|
||||
promptDelete();
|
||||
if (!Beatmap.IsDefault)
|
||||
promptDelete(Beatmap);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user