Tweaked the no-levels-found popup messagebox to properly call the returnTo functionality to bump back to the appropriate originator gui.

This commit is contained in:
Areloch 2017-03-01 00:46:39 -06:00
parent bd3af15260
commit 2f88bdf865

View file

@ -39,12 +39,13 @@ function ChooseLevelDlg::onWake( %this )
if(IsDirectory("tools")) if(IsDirectory("tools"))
{ {
MessageBoxYesNo("Error", "No levels were found in any modules. Do you want to load the editor and start a new level?", MessageBoxYesNo("Error", "No levels were found in any modules. Do you want to load the editor and start a new level?",
"fastLoadWorldEdit(1);", "Canvas.popDialog(ChooseLevelDlg); Canvas.setContent(MainMenuGUI);"); "fastLoadWorldEdit(1);",
"Canvas.popDialog(ChooseLevelDlg); if(isObject(ChooseLevelDlg.returnGui) && ChooseLevelDlg.returnGui.isMethod(\"onReturnTo\")) ChooseLevelDlg.returnGui.onReturnTo();");
} }
else else
{ {
MessageBoxOK("Error", "No levels were found in any modules. Please ensure you have modules loaded that contain gameplay code and level files.", MessageBoxOK("Error", "No levels were found in any modules. Please ensure you have modules loaded that contain gameplay code and level files.",
"Canvas.popDialog(ChooseLevelDlg); Canvas.setContent(MainMenuGUI);"); "Canvas.popDialog(ChooseLevelDlg); if(isObject(ChooseLevelDlg.returnGui) && ChooseLevelDlg.returnGui.isMethod(\"onReturnTo\")) ChooseLevelDlg.returnGui.onReturnTo();");
} }
return; return;