mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Fixes issue with not detecting any non-template level meshes in the choose level dlg screen.
This commit is contained in:
parent
8bd533e001
commit
0f15dfa6b0
1 changed files with 5 additions and 15 deletions
|
|
@ -32,26 +32,16 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue