Adds delete difficulty option to editor

This commit is contained in:
Micahel Kelly
2022-07-27 19:15:43 +10:00
parent c30e8047ab
commit e6fad601cc
2 changed files with 51 additions and 0 deletions

View File

@ -849,6 +849,20 @@ namespace osu.Game.Screens.Edit
new LegacyBeatmapExporter(storage).Export(Beatmap.Value.BeatmapSetInfo);
}
private void deleteDifficulty()
{
dialogOverlay?.Push(new PromptForDifficultyDeleteDialog(confirmDifficultyDelete, () => { }));
}
private void confirmDifficultyDelete()
{
var current = playableBeatmap.BeatmapInfo;
if (current is null) return;
beatmapManager.Hide(current);
this.Exit();
}
private void updateLastSavedHash()
{
lastSavedHash = changeHandler?.CurrentStateHash;
@ -869,6 +883,10 @@ namespace osu.Game.Screens.Edit
fileMenuItems.Add(createDifficultyCreationMenu());
fileMenuItems.Add(createDifficultySwitchMenu());
fileMenuItems.Add(new EditorMenuItemSpacer());
fileMenuItems.Add(new EditorMenuItem("Delete difficulty", MenuItemType.Standard, deleteDifficulty));
fileMenuItems.Add(new EditorMenuItemSpacer());
fileMenuItems.Add(new EditorMenuItem("Exit", MenuItemType.Standard, this.Exit));
return fileMenuItems;