Test staying on same difficulty due to unsaved changes

This commit is contained in:
Bartłomiej Dach
2021-09-05 19:11:46 +02:00
parent c72523bc14
commit 382269b362
4 changed files with 68 additions and 10 deletions

View File

@ -498,7 +498,7 @@ namespace osu.Game.Screens.Edit
if (isNewBeatmap || HasUnsavedChanges)
{
dialogOverlay?.Push(new PromptForSaveDialog(confirmExit, confirmExitWithSave));
dialogOverlay?.Push(new PromptForSaveDialog(confirmExit, confirmExitWithSave, cancelPendingDifficultySwitch));
return true;
}
}
@ -737,7 +737,16 @@ namespace osu.Game.Screens.Edit
loader.ValidForResume = true;
this.Exit();
loader.PushEditor(beatmapInfo);
loader.ScheduleDifficultySwitch(beatmapInfo);
}
private void cancelPendingDifficultySwitch()
{
if (loader == null)
return;
loader.ValidForResume = false;
loader.CancelDifficultySwitch();
}
public double SnapTime(double time, double? referenceTime) => editorBeatmap.SnapTime(time, referenceTime);