mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Tidy up dialog and deletion flow
This commit is contained in:
@ -879,35 +879,6 @@ namespace osu.Game.Screens.Edit
|
||||
clock.SeekForward(!trackPlaying, amount);
|
||||
}
|
||||
|
||||
private void exportBeatmap()
|
||||
{
|
||||
Save();
|
||||
new LegacyBeatmapExporter(storage).Export(Beatmap.Value.BeatmapSetInfo);
|
||||
}
|
||||
|
||||
private void deleteDifficulty()
|
||||
{
|
||||
dialogOverlay?.Push(new PromptForDifficultyDeleteDialog(confirmDifficultyHide, confirmDifficultyDelete, () => { }));
|
||||
}
|
||||
|
||||
private void confirmDifficultyHide()
|
||||
{
|
||||
var current = playableBeatmap.BeatmapInfo;
|
||||
if (current is null) return;
|
||||
|
||||
beatmapManager.Hide(current);
|
||||
switchBeatmapOrExit(current.BeatmapSet);
|
||||
}
|
||||
|
||||
private void confirmDifficultyDelete()
|
||||
{
|
||||
var current = playableBeatmap.BeatmapInfo;
|
||||
if (current is null) return;
|
||||
|
||||
beatmapManager.DeleteDifficultyImmediately(current);
|
||||
switchBeatmapOrExit(current.BeatmapSet);
|
||||
}
|
||||
|
||||
private void switchBeatmapOrExit([CanBeNull] BeatmapSetInfo setInfo)
|
||||
{
|
||||
if (setInfo is null || setInfo.Beatmaps.Count() <= 1)
|
||||
@ -948,6 +919,29 @@ namespace osu.Game.Screens.Edit
|
||||
return fileMenuItems;
|
||||
}
|
||||
|
||||
private void exportBeatmap()
|
||||
{
|
||||
Save();
|
||||
new LegacyBeatmapExporter(storage).Export(Beatmap.Value.BeatmapSetInfo);
|
||||
}
|
||||
|
||||
private void deleteDifficulty()
|
||||
{
|
||||
if (dialogOverlay == null)
|
||||
delete();
|
||||
else
|
||||
dialogOverlay.Push(new DeleteDifficultyConfirmationDialog(Beatmap.Value.BeatmapInfo, delete));
|
||||
|
||||
void delete()
|
||||
{
|
||||
var current = playableBeatmap.BeatmapInfo;
|
||||
if (current is null) return;
|
||||
|
||||
beatmapManager.DeleteDifficultyImmediately(current);
|
||||
switchBeatmapOrExit(current.BeatmapSet);
|
||||
}
|
||||
}
|
||||
|
||||
private EditorMenuItem createDifficultyCreationMenu()
|
||||
{
|
||||
var rulesetItems = new List<MenuItem>();
|
||||
|
Reference in New Issue
Block a user