summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/editor/editor_node.cpp33
-rw-r--r--tools/editor/editor_run.cpp8
-rw-r--r--tools/editor/editor_run.h2
3 files changed, 19 insertions, 24 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 5e2d6e7d6b..7a85941b0d 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -1792,7 +1792,7 @@ void EditorNode::_run(bool p_current,const String& p_custom) {
play_custom_scene_button->set_pressed(false);
play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom","EditorIcons"));
- String current_filename;
+ String main_scene;
String run_filename;
String args;
@@ -1819,25 +1819,16 @@ void EditorNode::_run(bool p_current,const String& p_custom) {
}
-
-
- if (run_settings_dialog->get_run_mode()==RunSettingsDialog::RUN_LOCAL_SCENE) {
-
- run_filename=scene->get_filename();
- } else {
- current_filename=scene->get_filename();
- }
-
+ run_filename=scene->get_filename();
} else if (p_custom!="") {
-
- run_filename=p_custom;
+ run_filename = p_custom;
}
if (run_filename=="") {
//evidently, run the scene
- run_filename=GLOBAL_DEF("application/main_scene","");
- if (run_filename=="") {
+ main_scene=GLOBAL_DEF("application/main_scene","");
+ if (main_scene=="") {
current_option=-1;
//accept->get_cancel()->hide();
@@ -1846,21 +1837,21 @@ void EditorNode::_run(bool p_current,const String& p_custom) {
return;
}
- if (!FileAccess::exists(run_filename)) {
+ if (!FileAccess::exists(main_scene)) {
current_option=-1;
//accept->get_cancel()->hide();
- pick_main_scene->set_text(vformat(TTR("Selected scene '%s' does not exist, select a valid one?\nYou can change it later in \"Project Settings\" under the 'application' category."), run_filename));
+ pick_main_scene->set_text(vformat(TTR("Selected scene '%s' does not exist, select a valid one?\nYou can change it later in \"Project Settings\" under the 'application' category."), main_scene));
pick_main_scene->popup_centered_minsize();
return;
}
- if (ResourceLoader::get_resource_type(run_filename)!="PackedScene") {
+ if (ResourceLoader::get_resource_type(main_scene)!="PackedScene") {
current_option=-1;
//accept->get_cancel()->hide();
- pick_main_scene->set_text(vformat(TTR("Selected scene '%s' is not a scene file, select a valid one?\nYou can change it later in \"Project Settings\" under the 'application' category."), run_filename));
+ pick_main_scene->set_text(vformat(TTR("Selected scene '%s' is not a scene file, select a valid one?\nYou can change it later in \"Project Settings\" under the 'application' category."), main_scene));
pick_main_scene->popup_centered_minsize();
return;
@@ -1908,7 +1899,7 @@ void EditorNode::_run(bool p_current,const String& p_custom) {
args = GlobalConfig::get_singleton()->get("editor/main_run_args");
- Error error = editor_run.run(run_filename,args,breakpoints,current_filename);
+ Error error = editor_run.run(run_filename,args,breakpoints);
if (error!=OK) {
@@ -1926,7 +1917,7 @@ void EditorNode::_run(bool p_current,const String& p_custom) {
play_scene_button->set_pressed(true);
play_scene_button->set_icon(gui_base->get_icon("Reload","EditorIcons"));
} else if (p_custom!="") {
- run_custom_filename=run_filename;
+ run_custom_filename=p_custom;
play_custom_scene_button->set_pressed(true);
play_custom_scene_button->set_icon(gui_base->get_icon("Reload","EditorIcons"));
} else {
@@ -5224,7 +5215,7 @@ EditorNode::EditorNode() {
register_exporters();
- GLOBAL_DEF("editor/main_run_args","$scene");
+ GLOBAL_DEF("editor/main_run_args","");
ClassDB::set_class_enabled("CollisionShape",true);
ClassDB::set_class_enabled("CollisionShape2D",true);
diff --git a/tools/editor/editor_run.cpp b/tools/editor/editor_run.cpp
index a5d39db6be..46e400ae7f 100644
--- a/tools/editor/editor_run.cpp
+++ b/tools/editor/editor_run.cpp
@@ -35,7 +35,7 @@ EditorRun::Status EditorRun::get_status() const {
return status;
}
-Error EditorRun::run(const String& p_scene,const String p_custom_args,const List<String>& p_breakpoints,const String& p_edited_scene) {
+Error EditorRun::run(const String& p_scene,const String p_custom_args,const List<String>& p_breakpoints) {
List<String> args;
@@ -141,11 +141,15 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List
args.push_back(bpoints);
}
+
+ if (p_scene!="") {
+ args.push_back(p_scene);
+ }
if (p_custom_args!="") {
Vector<String> cargs=p_custom_args.split(" ",false);
for(int i=0;i<cargs.size();i++) {
- args.push_back(cargs[i].replace("$scene",p_scene).replace(" ","%20"));
+ args.push_back(cargs[i].replace(" ","%20"));
}
}
diff --git a/tools/editor/editor_run.h b/tools/editor/editor_run.h
index 78fa892488..46c5dc7521 100644
--- a/tools/editor/editor_run.h
+++ b/tools/editor/editor_run.h
@@ -49,7 +49,7 @@ private:
public:
Status get_status() const;
- Error run(const String& p_scene,const String p_custom_args,const List<String>& p_breakpoints,const String& p_edited_scene);
+ Error run(const String& p_scene,const String p_custom_args,const List<String>& p_breakpoints);
void run_native_notify() { status=STATUS_PLAY; }
void stop();