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