浏览代码

Able to open project manager inside editor (Scene->Project Manager)

Remove unnecessary include of project_manager.h
marynate 11 年之前
父节点
当前提交
3550a18fa2
共有 2 个文件被更改,包括 23 次插入1 次删除
  1. 22 1
      tools/editor/editor_node.cpp
  2. 1 0
      tools/editor/editor_node.h

+ 22 - 1
tools/editor/editor_node.cpp

@@ -94,6 +94,7 @@
 #include "tools/editor/io_plugins/editor_sample_import_plugin.h"
 #include "tools/editor/io_plugins/editor_sample_import_plugin.h"
 #include "tools/editor/io_plugins/editor_translation_import_plugin.h"
 #include "tools/editor/io_plugins/editor_translation_import_plugin.h"
 
 
+
 EditorNode *EditorNode::singleton=NULL;
 EditorNode *EditorNode::singleton=NULL;
 
 
 void EditorNode::_update_title() {
 void EditorNode::_update_title() {
@@ -2130,9 +2131,28 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
 		} break;
 		} break;
 		case RUN_SETTINGS: {
 		case RUN_SETTINGS: {
 
 
-
 			project_settings->popup_project_settings();
 			project_settings->popup_project_settings();
 		} break;
 		} break;
+		case RUN_PROJECT_MANAGER: {
+
+			if (!p_confirmed) {
+				confirmation->get_ok()->set_text("Yes");
+				confirmation->set_text("Open Project Manager? \n(Unsaved changes will be lost)");
+				confirmation->popup_centered(Size2(300,70));
+				break;
+			}
+
+			get_scene()->quit();
+			String exec = OS::get_singleton()->get_executable_path();
+
+			List<String> args;
+			args.push_back ( "-path" );
+			args.push_back (exec.get_base_dir() );
+
+			OS::ProcessID pid=0;
+			Error err = OS::get_singleton()->execute(exec,args,false,&pid);
+			ERR_FAIL_COND(err);
+		} break;
 		case RUN_FILE_SERVER: {
 		case RUN_FILE_SERVER: {
 
 
 			//file_server
 			//file_server
@@ -3407,6 +3427,7 @@ EditorNode::EditorNode() {
 	p->add_item("Redo",EDIT_REDO,KEY_MASK_CMD+KEY_MASK_SHIFT+KEY_Z);
 	p->add_item("Redo",EDIT_REDO,KEY_MASK_CMD+KEY_MASK_SHIFT+KEY_Z);
 	p->add_separator();
 	p->add_separator();
 	p->add_item("Project Settings",RUN_SETTINGS);
 	p->add_item("Project Settings",RUN_SETTINGS);
+	p->add_item("Project Manager",RUN_PROJECT_MANAGER);
 	p->add_separator();
 	p->add_separator();
 	p->add_item("Quit",FILE_QUIT,KEY_MASK_CMD+KEY_Q);
 	p->add_item("Quit",FILE_QUIT,KEY_MASK_CMD+KEY_Q);
 
 

+ 1 - 0
tools/editor/editor_node.h

@@ -137,6 +137,7 @@ class EditorNode : public Node {
 		RUN_PLAY_CUSTOM_SCENE,
 		RUN_PLAY_CUSTOM_SCENE,
 		RUN_SCENE_SETTINGS,
 		RUN_SCENE_SETTINGS,
 		RUN_SETTINGS,
 		RUN_SETTINGS,
+		RUN_PROJECT_MANAGER,
 		RUN_FILE_SERVER,
 		RUN_FILE_SERVER,
 		RUN_DEPLOY_DUMB_CLIENTS,
 		RUN_DEPLOY_DUMB_CLIENTS,
 		SETTINGS_UPDATE_ALWAYS,
 		SETTINGS_UPDATE_ALWAYS,