Skip to content

Commit d75f5e2

Browse files
committed
Fix saving before quitting
1 parent 0b15132 commit d75f5e2

File tree

2 files changed

+18
-43
lines changed

2 files changed

+18
-43
lines changed

Assets/Scripts/Behaviors/Chartmaker/Chartmaker.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ public IEnumerator SaveRoutine() {
272272
yield return new WaitUntil(() => ActiveTask.IsCompleted);
273273
if (!ActiveTask.IsCompletedSuccessfully)
274274
{
275+
Loader.SetActive(false);
275276
DialogModal modal = ModalHolder.main.Spawn<DialogModal>();
276277
modal.SetDialog("Error", ActiveTask.Exception.Message, new string[] {"Ok"}, _ => {});
277278
yield break;
@@ -290,8 +291,6 @@ public IEnumerator SaveThenQuit() {
290291
LoaderLabel.text = "Saving song before quitting...";
291292

292293
yield return SaveRoutine();
293-
294-
Loader.SetActive(false);
295294

296295
if (!IsDirty) Application.Quit();
297296
}
@@ -345,12 +344,15 @@ public void TryCloseSong() {
345344

346345
public bool QuitCheck()
347346
{
348-
if (IsDirty) DirtyModal(() => {
349-
IsDirty = false;
350-
Application.Quit();
351-
});
352347
if (!IsDirty) WindowHandler.main.Quit();
353-
else if (Preferences.SaveOnQuit) StartCoroutine(SaveThenQuit());
348+
else
349+
{
350+
if (Preferences.SaveOnQuit) StartCoroutine(SaveThenQuit());
351+
else DirtyModal(() => {
352+
IsDirty = false;
353+
Application.Quit();
354+
});
355+
}
354356
return !IsDirty;
355357
}
356358

Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset

Lines changed: 9 additions & 36 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)