diff options
Diffstat (limited to 'tools/editor/editor_node.cpp')
-rw-r--r-- | tools/editor/editor_node.cpp | 55 |
1 files changed, 41 insertions, 14 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 4e22592880..7b96db56f2 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -167,11 +167,20 @@ void EditorNode::_unhandled_input(const InputEvent& p_event) { /*case KEY_F1: if (!p_event.key.mod.shift && !p_event.key.mod.command) - _editor_select(3); + _editor_select(EDITOR_SCRIPT); break;*/ - case KEY_F1: _editor_select(0); break; - case KEY_F2: _editor_select(1); break; - case KEY_F3: _editor_select(2); break; + case KEY_F1: + if (!p_event.key.mod.shift && !p_event.key.mod.command) + _editor_select(EDITOR_2D); + break; + case KEY_F2: + if (!p_event.key.mod.shift && !p_event.key.mod.command) + _editor_select(EDITOR_3D); + break; + case KEY_F3: + if (!p_event.key.mod.shift && !p_event.key.mod.command) + _editor_select(EDITOR_SCRIPT); + break; case KEY_F5: _menu_option_confirm((p_event.key.mod.control&&p_event.key.mod.shift)?RUN_PLAY_CUSTOM_SCENE:RUN_PLAY,true); break; case KEY_F6: _menu_option_confirm(RUN_PLAY_SCENE,true); break; case KEY_F7: _menu_option_confirm(RUN_PAUSE,true); break; @@ -289,7 +298,7 @@ void EditorNode::_notification(int p_what) { VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport(),true); VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(),true); - _editor_select(1); + _editor_select(EDITOR_3D); if (defer_load_scene!="") { @@ -879,7 +888,7 @@ void EditorNode::_save_scene_with_preview(String p_file) { } } - _editor_select(is2d?0:1); + _editor_select(is2d?EDITOR_2D:EDITOR_3D); VS::get_singleton()->viewport_queue_screen_capture(viewport); save.step("Creating Thumbnail",2); @@ -2379,6 +2388,10 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { log->add_message("REDO: "+action); } break; + case TOOLS_ORPHAN_RESOURCES: { + + orphan_resources->show(); + } break; case EDIT_REVERT: { @@ -2519,7 +2532,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { case OBJECT_REQUEST_HELP: { if (current) { - _editor_select(3); + _editor_select(EDITOR_SCRIPT); emit_signal("request_help",current->get_type()); } @@ -3296,9 +3309,9 @@ void EditorNode::_set_main_scene_state(Dictionary p_state) { int n2d=0,n3d=0; _find_node_types(get_edited_scene(),n2d,n3d); if (n2d>n3d) { - _editor_select(0); + _editor_select(EDITOR_2D); } else if (n3d>n2d) { - _editor_select(1); + _editor_select(EDITOR_3D); } } @@ -3534,13 +3547,14 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo if (p_set_inherited) { Ref<SceneState> state = sdata->get_state(); - state->set_path(lpath); + state->set_path(lpath); new_scene->set_scene_inherited_state(state); new_scene->set_filename(String()); - if (new_scene->get_scene_instance_state().is_valid()) - new_scene->get_scene_instance_state()->set_path(String()); + //if (new_scene->get_scene_instance_state().is_valid()) + // new_scene->get_scene_instance_state()->set_path(String()); } + new_scene->set_scene_instance_state(Ref<SceneState>()); set_edited_scene(new_scene); _get_scene_metadata(); @@ -3857,7 +3871,8 @@ bool EditorNode::_find_editing_changed_scene(Node *p_from) { void EditorNode::add_io_error(const String& p_error) { - + CharString err_ut = p_error.utf8(); + ERR_PRINT(err_ut.get_data()); _load_error_notify(singleton,p_error); } @@ -5037,6 +5052,17 @@ EditorNode::EditorNode() { p=import_menu->get_popup(); p->connect("item_pressed",this,"_menu_option"); + tool_menu = memnew( MenuButton ); + tool_menu->set_tooltip("Miscelaneous project or scene wide tools."); + tool_menu->set_text("Tools"); + + //tool_menu->set_icon(gui_base->get_icon("Save","EditorIcons")); + left_menu_hb->add_child( tool_menu ); + + p=tool_menu->get_popup(); + p->connect("item_pressed",this,"_menu_option"); + p->add_item("Orphan Resource Explorer",TOOLS_ORPHAN_RESOURCES); + export_button = memnew( ToolButton ); export_button->set_tooltip("Export the project to many platforms."); export_button->set_text("Export"); @@ -5465,7 +5491,8 @@ EditorNode::EditorNode() { - + orphan_resources = memnew( OrphanResourcesDialog ); + gui_base->add_child(orphan_resources); |