feature: are you sure?
This commit is contained in:
@@ -94,6 +94,9 @@ import haxe.ui.components.Button;
|
||||
import haxe.ui.components.DropDown;
|
||||
import haxe.ui.components.Label;
|
||||
import haxe.ui.components.Slider;
|
||||
import haxe.ui.containers.dialogs.Dialogs;
|
||||
import haxe.ui.containers.dialogs.Dialog.DialogButton;
|
||||
import haxe.ui.containers.dialogs.MessageBox.MessageBoxType;
|
||||
import haxe.ui.containers.dialogs.CollapsibleDialog;
|
||||
import haxe.ui.containers.menus.Menu;
|
||||
import haxe.ui.containers.menus.MenuBar;
|
||||
@@ -5599,7 +5602,18 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||
@:nullSafety(Off)
|
||||
function quitChartEditor():Void
|
||||
{
|
||||
autoSave();
|
||||
if (saveDataDirty) {
|
||||
Dialogs.messageBox("You are about to leave the editor without saving.\n\nAre you sure?", "Leave Editor", MessageBoxType.TYPE_YESNO, true, function(button:DialogButton) {
|
||||
if (button == DialogButton.YES)
|
||||
{
|
||||
autoSave();
|
||||
quitChartEditor();
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
stopWelcomeMusic();
|
||||
// TODO: PR Flixel to make onComplete nullable.
|
||||
if (audioInstTrack != null) audioInstTrack.onComplete = null;
|
||||
|
||||
Reference in New Issue
Block a user