From 302abb14491a2253a78b42cb93ffc2d5132b081d Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 27 Jun 2016 10:59:37 -0300 Subject: [PATCH] Properly complain when a scene file has not be selected, closes #3811 (cherry picked from commit d41b7a66e9e01b55310d68e216139d6b6cc712f1) --- tools/editor/editor_node.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index a6c03dba6da..0975f7e170e 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -1856,6 +1856,28 @@ void EditorNode::_run(bool p_current,const String& p_custom) { 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; + + } + }