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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user