Fixes issue with not detecting any non-template level meshes in the choose level dlg screen.

This commit is contained in:
Areloch 2018-01-28 16:59:43 -06:00
parent 57284507f2
commit a6038d1801

View file

@ -32,25 +32,15 @@ function ChooseLevelDlg::onWake( %this )
%this->LevelDescription.visible = false; %this->LevelDescription.visible = false;
%assetQuery = new AssetQuery(); %assetQuery = new AssetQuery();
if(!AssetDatabase.findAssetType(%assetQuery, "LevelAsset")) AssetDatabase.findAssetType(%assetQuery, "LevelAsset");
return; //if we didn't find ANY, just exit
%count = %assetQuery.getCount(); %count = %assetQuery.getCount();
if(%count == 0) if(%count == 0 && !IsDirectory("tools"))
{ {
//We have no levels found. Prompt the user to open the editor to the default level if the tools are present //We have no levels found. Prompt the user to open the editor to the default level if the tools are present
if(IsDirectory("tools")) 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); if(isObject(ChooseLevelDlg.returnGui) && ChooseLevelDlg.returnGui.isMethod(\"onReturnTo\")) ChooseLevelDlg.returnGui.onReturnTo();");
MessageBoxYesNo("Error", "No levels were found in any modules. Do you want to load the editor and start a new level?",
"EditorOpenMission();",
"Canvas.popDialog(ChooseLevelDlg); if(isObject(ChooseLevelDlg.returnGui) && ChooseLevelDlg.returnGui.isMethod(\"onReturnTo\")) ChooseLevelDlg.returnGui.onReturnTo();");
}
else
{
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); if(isObject(ChooseLevelDlg.returnGui) && ChooseLevelDlg.returnGui.isMethod(\"onReturnTo\")) ChooseLevelDlg.returnGui.onReturnTo();");
}
%assetQuery.delete(); %assetQuery.delete();
return; return;