From a2cee82779a9f560f90c045399fa12280c7475b2 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 24 Nov 2023 00:58:12 -0500 Subject: [PATCH] Fixing up a rough Git merge --- assets | 2 +- .../handlers/ChartEditorDialogHandler.hx | 81 +++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/assets b/assets index 74847831d..76dc8659e 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 74847831dec229fc1c639ca4ca963973022b8648 +Subproject commit 76dc8659ec238a0521955da56d5e928f94878d7c diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx index b67e81465..79937ce6f 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx @@ -103,6 +103,87 @@ class ChartEditorDialogHandler return dialog; } + /** + * Builds and opens a dialog letting the user know a backup is available, and prompting them to load it. + */ + public static function openBackupAvailableDialog(state:ChartEditorState, welcomeDialog:Null):Null + { + var dialog:Null = openDialog(state, CHART_EDITOR_DIALOG_BACKUP_AVAILABLE_LAYOUT, true, true); + if (dialog == null) throw 'Could not locate Backup Available dialog'; + dialog.onDialogClosed = function(_event) { + state.isHaxeUIDialogOpen = false; + if (_event.button == DialogButton.APPLY) + { + // User loaded the backup! Close the welcome dialog behind this. + if (welcomeDialog != null) welcomeDialog.hideDialog(DialogButton.CANCEL); + } + else + { + // User cancelled the dialog, don't close the welcome dialog so we aren't in a broken state. + } + }; + + state.isHaxeUIDialogOpen = true; + + var backupTimeLabel:Null