mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 21:43:04 +08:00
Expose unsaved changes state
This commit is contained in:
parent
6f067ff300
commit
327179a81e
@ -52,6 +52,8 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
public override bool AllowRateAdjustments => false;
|
public override bool AllowRateAdjustments => false;
|
||||||
|
|
||||||
|
public bool HasUnsavedChanges => lastSavedHash != changeHandler.CurrentStateHash;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private BeatmapManager beatmapManager { get; set; }
|
private BeatmapManager beatmapManager { get; set; }
|
||||||
|
|
||||||
@ -356,7 +358,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
public override bool OnExiting(IScreen next)
|
public override bool OnExiting(IScreen next)
|
||||||
{
|
{
|
||||||
if (!exitConfirmed && dialogOverlay != null && changeHandler.CurrentStateHash != lastSavedHash)
|
if (!exitConfirmed && dialogOverlay != null && HasUnsavedChanges)
|
||||||
{
|
{
|
||||||
dialogOverlay?.Push(new PromptForSaveDialog(confirmExit, confirmExitWithSave));
|
dialogOverlay?.Push(new PromptForSaveDialog(confirmExit, confirmExitWithSave));
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user