diff options
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index faa936bd64..ae2a6d2802 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -334,6 +334,11 @@ void EditorNode::_notification(int p_what) { OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(int(EDITOR_GET("interface/editor/unfocused_low_processor_mode_sleep_usec"))); } break; + case MainLoop::NOTIFICATION_WM_ABOUT: { + + show_about(); + } break; + case MainLoop::NOTIFICATION_WM_QUIT_REQUEST: { _menu_option_confirm(FILE_QUIT, false); @@ -1576,6 +1581,7 @@ void EditorNode::push_item(Object *p_object, const String &p_property, bool p_in get_inspector()->edit(NULL); node_dock->set_node(NULL); scene_tree_dock->set_selected(NULL); + inspector_dock->update(NULL); return; } @@ -1664,9 +1670,10 @@ void EditorNode::_edit_current() { Resource *current_res = Object::cast_to<Resource>(current_obj); ERR_FAIL_COND(!current_res); - scene_tree_dock->set_selected(NULL); get_inspector()->edit(current_res); + scene_tree_dock->set_selected(NULL); node_dock->set_node(NULL); + inspector_dock->update(NULL); EditorNode::get_singleton()->get_import_dock()->set_edit_path(current_res->get_path()); int subr_idx = current_res->get_path().find("::"); @@ -1693,9 +1700,11 @@ void EditorNode::_edit_current() { if (current_node->is_inside_tree()) { node_dock->set_node(current_node); scene_tree_dock->set_selected(current_node); + inspector_dock->update(current_node); } else { node_dock->set_node(NULL); scene_tree_dock->set_selected(NULL); + inspector_dock->update(NULL); } if (get_edited_scene() && get_edited_scene()->get_filename() != String()) { @@ -1715,6 +1724,8 @@ void EditorNode::_edit_current() { get_inspector()->edit(current_obj); node_dock->set_node(NULL); + scene_tree_dock->set_selected(NULL); + inspector_dock->update(NULL); } inspector_dock->set_warning(editable_warning); @@ -2777,6 +2788,20 @@ void EditorNode::_editor_select(int p_which) { } } +void EditorNode::select_editor_by_name(const String &p_name) { + ERR_FAIL_COND(p_name == ""); + + for (int i = 0; i < main_editor_buttons.size(); i++) { + if (main_editor_buttons[i]->get_text() == p_name) { + _editor_select(i); + return; + } + } + + ERR_EXPLAIN("The editor name '" + p_name + "' was not found."); + ERR_FAIL(); +} + void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed) { if (p_editor->has_main_screen()) { @@ -5943,7 +5968,7 @@ EditorNode::EditorNode() { recent_scenes->connect("id_pressed", this, "_open_recent_scene"); p->add_separator(); - p->add_item(TTR("Quit"), FILE_QUIT, KEY_MASK_CMD + KEY_Q); + p->add_shortcut(ED_SHORTCUT("editor/file_quit", TTR("Quit"), KEY_MASK_CMD + KEY_Q), FILE_QUIT, true); project_menu = memnew(MenuButton); project_menu->set_flat(false); @@ -5977,9 +6002,9 @@ EditorNode::EditorNode() { p->add_separator(); #ifdef OSX_ENABLED - p->add_item(TTR("Quit to Project List"), RUN_PROJECT_MANAGER, KEY_MASK_SHIFT + KEY_MASK_ALT + KEY_Q); + p->add_shortcut(ED_SHORTCUT("editor/quit_to_project_list", TTR("Quit to Project List"), KEY_MASK_SHIFT + KEY_MASK_ALT + KEY_Q), RUN_PROJECT_MANAGER, true); #else - p->add_item(TTR("Quit to Project List"), RUN_PROJECT_MANAGER, KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_Q); + p->add_shortcut(ED_SHORTCUT("editor/quit_to_project_list", TTR("Quit to Project List"), KEY_MASK_SHIFT + KEY_MASK_CMD + KEY_Q), RUN_PROJECT_MANAGER, true); #endif menu_hb->add_spacer(); |