1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-01 13:20:11 +08:00

Simplify save dialogs

This commit is contained in:
Dean Herbert
2024-07-11 12:15:17 +09:00
Unverified
parent b0d6c8ca6d
commit cd6b0e875a
2 changed files with 10 additions and 13 deletions
+8 -11
View File
@@ -481,7 +481,7 @@ namespace osu.Game.Screens.Edit
{
if (HasUnsavedChanges)
{
dialogOverlay.Push(new SaveRequiredPopupDialog("The beatmap will be saved in order to test it.", () => attemptMutationOperation(() =>
dialogOverlay.Push(new SaveRequiredPopupDialog(() => attemptMutationOperation(() =>
{
if (!Save()) return false;
@@ -1146,7 +1146,7 @@ namespace osu.Game.Screens.Edit
{
if (HasUnsavedChanges)
{
dialogOverlay.Push(new SaveRequiredPopupDialog("The beatmap will be saved in order to export it.", () => attemptAsyncMutationOperation(() =>
dialogOverlay.Push(new SaveRequiredPopupDialog(() => attemptAsyncMutationOperation(() =>
{
if (!Save())
return Task.CompletedTask;
@@ -1224,17 +1224,14 @@ namespace osu.Game.Screens.Edit
{
if (isNewBeatmap)
{
dialogOverlay.Push(new SaveRequiredPopupDialog("This beatmap will be saved in order to create another difficulty.", () =>
dialogOverlay.Push(new SaveRequiredPopupDialog(() => attemptMutationOperation(() =>
{
attemptMutationOperation(() =>
{
if (!Save())
return false;
if (!Save())
return false;
CreateNewDifficulty(rulesetInfo);
return true;
});
}));
CreateNewDifficulty(rulesetInfo);
return true;
})));
return;
}
@@ -9,9 +9,9 @@ namespace osu.Game.Screens.Edit
{
public partial class SaveRequiredPopupDialog : PopupDialog
{
public SaveRequiredPopupDialog(string headerText, Action saveAndAction)
public SaveRequiredPopupDialog(Action saveAndAction)
{
HeaderText = headerText;
HeaderText = "The beatmap will be saved to continue with this operation.";
Icon = FontAwesome.Regular.Save;