diff options
| author | Benjamin Bäumler | 2017-02-27 15:20:47 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2017-02-27 15:20:47 +0100 |
| commit | edd37eccd486fe114f5a7fc742e817ea37d854b2 (patch) | |
| tree | efb74b64d11e94b8da1aa40aa143b722f1c087ec /tools/editor/editor_run.cpp | |
| parent | df365fdc3cd62b482d6ecc9a074f235886b6ee01 (diff) | |
| download | godot-edd37eccd486fe114f5a7fc742e817ea37d854b2.tar.gz godot-edd37eccd486fe114f5a7fc742e817ea37d854b2.tar.zst godot-edd37eccd486fe114f5a7fc742e817ea37d854b2.zip | |
fix custom scene arguments from the editor
sequel of #7347
Play edited scene and Play custom scene didn't worked when main_run_args
hadn't $scene as argument.
Changes/Fixes the way how the editor handles scene paths when starting the
project/a scene
Play the project - no scene path
Play the edited scene - scene path of active scene in the editor
Play custom scene - scene path of custom scene
main_arg_runs is now empty by default and $scene won't be replaced
by the scene path anymore
Changed declaration if EditorRun::run, to remove a unused value
Diffstat (limited to '')
| -rw-r--r-- | tools/editor/editor_run.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/editor/editor_run.cpp b/tools/editor/editor_run.cpp index a5d39db6b..46e400ae7 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")); } } |
