diff options
| author | Ariel Manzur | 2016-02-25 03:02:09 -0300 |
|---|---|---|
| committer | Rémi Verschelde | 2016-02-27 15:27:33 +0100 |
| commit | 45a0bbe56e64ad14f18c037bf7130f3d383ec6d6 (patch) | |
| tree | efb3ad7ce7993e42022535d9ea315af094fff668 | |
| parent | d86b12a3973a46a0b6890276e40f3ff464baa5a2 (diff) | |
| download | godot-45a0bbe56e64ad14f18c037bf7130f3d383ec6d6.tar.gz godot-45a0bbe56e64ad14f18c037bf7130f3d383ec6d6.tar.zst godot-45a0bbe56e64ad14f18c037bf7130f3d383ec6d6.zip | |
adds -pm and -project_manager command line options to start project manager
fixes bug where the user has an engine.cfg on the executable directory so it runs the game instead of opening the project manager
| -rw-r--r-- | main/main.cpp | 7 | ||||
| -rw-r--r-- | tools/editor/editor_node.cpp | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/main/main.cpp b/main/main.cpp index 68c40a6f2..8c0c31835 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1011,6 +1011,7 @@ bool Main::start() { bool noquit=false; bool convert_old=false; bool export_debug=false; + bool project_manager_request = false; List<String> args = OS::get_singleton()->get_cmdline_args(); for (int i=0;i<args.size();i++) { //parameters that do not have an argument to the right @@ -1022,6 +1023,8 @@ bool Main::start() { convert_old=true; } else if (args[i]=="-editor" || args[i]=="-e") { editor=true; + } else if (args[i] == "-pm" || args[i] == "-project_manager") { + project_manager_request = true; } else if (args[i].length() && args[i][0] != '-' && game_path == "") { game_path=args[i]; } @@ -1255,7 +1258,7 @@ bool Main::start() { } - if (game_path!="") { + if (game_path!="" && !project_manager_request) { String local_game_path=game_path.replace("\\","/"); @@ -1462,7 +1465,7 @@ bool Main::start() { }; } */ - if (script=="" && test=="" && game_path=="" && !editor) { + if (project_manager_request || (script=="" && test=="" && game_path=="" && !editor)) { ProjectManager *pmanager = memnew( ProjectManager ); sml->get_root()->add_child(pmanager); diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index b2623a590..ea887fe18 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -2671,8 +2671,9 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { String exec = OS::get_singleton()->get_executable_path(); List<String> args; - args.push_back ( "-path" ); - args.push_back (exec.get_base_dir() ); + //args.push_back ( "-path" ); + //args.push_back (exec.get_base_dir() ); + args.push_back("-pm"); OS::ProcessID pid=0; Error err = OS::get_singleton()->execute(exec,args,false,&pid); |
