1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 15:33:05 +08:00

Expose unsaved changes state

This commit is contained in:
Dean Herbert 2020-09-09 19:42:03 +09:00
parent 6f067ff300
commit 327179a81e

View File

@ -52,6 +52,8 @@ namespace osu.Game.Screens.Edit
public override bool AllowRateAdjustments => false;
public bool HasUnsavedChanges => lastSavedHash != changeHandler.CurrentStateHash;
[Resolved]
private BeatmapManager beatmapManager { get; set; }
@ -356,7 +358,7 @@ namespace osu.Game.Screens.Edit
public override bool OnExiting(IScreen next)
{
if (!exitConfirmed && dialogOverlay != null && changeHandler.CurrentStateHash != lastSavedHash)
if (!exitConfirmed && dialogOverlay != null && HasUnsavedChanges)
{
dialogOverlay?.Push(new PromptForSaveDialog(confirmExit, confirmExitWithSave));
return true;