Properly complain when a scene file has not be selected, closes #3811

(cherry picked from commit d41b7a66e9)
This commit is contained in:
Juan Linietsky 2016-06-27 10:59:37 -03:00 committed by Rémi Verschelde
parent c5fd6a3b69
commit 302abb1449
1 changed files with 22 additions and 0 deletions

View File

@ -1856,6 +1856,28 @@ void EditorNode::_run(bool p_current,const String& p_custom) {
return; return;
} }
if (!FileAccess::exists(run_filename)) {
current_option=-1;
//accept->get_cancel()->hide();
accept->get_ok()->set_text("I see..");
accept->set_text("Selected scene '"+run_filename+"' does not exist.\nSelect one from \"Project Settings\" under the 'application' category.");
accept->popup_centered_minsize();
return;
}
if (ResourceLoader::get_resource_type(run_filename)!="PackedScene") {
current_option=-1;
//accept->get_cancel()->hide();
accept->get_ok()->set_text("I see..");
accept->set_text("Selected scene '"+run_filename+"' is not a scene file.\nSelect a scene from \"Project Settings\" under the 'application' category.");
accept->popup_centered_minsize();
return;
}
} }