mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Expose unsaved changes state
This commit is contained in:
@ -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;
|
||||||
|
Reference in New Issue
Block a user