1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 11:32:54 +08:00

Add confirmation before saving for external edit

This commit is contained in:
Dean Herbert 2024-07-11 12:20:33 +09:00
parent cd6b0e875a
commit 599a765fd1
No known key found for this signature in database

View File

@ -1134,13 +1134,29 @@ namespace osu.Game.Screens.Edit
} }
private void editExternally() private void editExternally()
{
if (HasUnsavedChanges)
{
dialogOverlay.Push(new SaveRequiredPopupDialog(() => attemptMutationOperation(() =>
{ {
if (!Save()) if (!Save())
return; return false;
startEdit();
return true;
})));
}
else
{
startEdit();
}
void startEdit()
{
var editOperation = beatmapManager.BeginExternalEditing(editorBeatmap.BeatmapInfo.BeatmapSet!); var editOperation = beatmapManager.BeginExternalEditing(editorBeatmap.BeatmapInfo.BeatmapSet!);
this.Push(new ExternalEditScreen(editOperation, this)); this.Push(new ExternalEditScreen(editOperation, this));
} }
}
private void exportBeatmap(bool legacy) private void exportBeatmap(bool legacy)
{ {