diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_help_search.cpp | 18 | ||||
-rw-r--r-- | editor/editor_help_search.h | 1 | ||||
-rw-r--r-- | editor/editor_inspector.cpp | 4 | ||||
-rw-r--r-- | editor/editor_node.cpp | 16 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 2 | ||||
-rw-r--r-- | editor/import/resource_importer_texture.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/shader_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/texture_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | editor/scene_tree_editor.cpp | 43 | ||||
-rw-r--r-- | editor/scene_tree_editor.h | 2 | ||||
-rw-r--r-- | editor/script_editor_debugger.cpp | 12 |
13 files changed, 48 insertions, 69 deletions
diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 21cddc8ca4..616a52e25b 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -45,21 +45,6 @@ void EditorHelpSearch::_update_icons() { _update_results(); } -void EditorHelpSearch::_load_settings() { - - bool enable_rl = EditorSettings::get_singleton()->get("docks/scene_tree/draw_relationship_lines"); - Color rl_color = EditorSettings::get_singleton()->get("docks/scene_tree/relationship_line_color"); - - if (enable_rl) { - results_tree->add_constant_override("draw_relationship_lines", 1); - results_tree->add_color_override("relationship_line_color", rl_color); - results_tree->add_constant_override("draw_guides", 0); - } else { - results_tree->add_constant_override("draw_relationship_lines", 0); - results_tree->add_constant_override("draw_guides", 1); - } -} - void EditorHelpSearch::_update_results() { String term = search_box->get_text(); @@ -120,7 +105,6 @@ void EditorHelpSearch::_notification(int p_what) { switch (p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - _load_settings(); _update_icons(); } break; case NOTIFICATION_ENTER_TREE: { @@ -264,8 +248,6 @@ EditorHelpSearch::EditorHelpSearch() { results_tree->connect("item_activated", this, "_confirmed"); results_tree->connect("item_selected", get_ok(), "set_disabled", varray(false)); vbox->add_child(results_tree, true); - - _load_settings(); } bool EditorHelpSearch::Runner::_slice() { diff --git a/editor/editor_help_search.h b/editor/editor_help_search.h index e74bfdc5b6..93cf66a0dd 100644 --- a/editor/editor_help_search.h +++ b/editor/editor_help_search.h @@ -64,7 +64,6 @@ class EditorHelpSearch : public ConfirmationDialog { Ref<Runner> search; void _update_icons(); - void _load_settings(); void _update_results(); void _search_box_gui_input(const Ref<InputEvent> &p_event); diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index a0b4a67d94..60fa5ff16f 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1236,6 +1236,7 @@ EditorInspectorSection::EditorInspectorSection() { } EditorInspectorSection::~EditorInspectorSection() { + if (!vbox_added) { memdelete(vbox); } @@ -2140,6 +2141,9 @@ void EditorInspector::_notification(int p_what) { get_tree()->connect("node_removed", this, "_node_removed"); } } + if (p_what == NOTIFICATION_PREDELETE) { + edit(NULL); //just in case + } if (p_what == NOTIFICATION_EXIT_TREE) { if (!sub_inspector) { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index d940a96123..f0c9e87b76 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1454,9 +1454,21 @@ void EditorNode::edit_item(Object *p_object) { } if (!sub_plugins.empty()) { - _display_top_editors(false); - _set_top_editors(sub_plugins); + bool same = true; + if (sub_plugins.size() == editor_plugins_over->get_plugins_list().size()) { + for (int i = 0; i < sub_plugins.size(); i++) { + if (sub_plugins[i] != editor_plugins_over->get_plugins_list()[i]) { + same = false; + } + } + } else { + same = false; + } + if (!same) { + _display_top_editors(false); + _set_top_editors(sub_plugins); + } _set_editing_top_editors(p_object); _display_top_editors(true); } else { diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index aa2b52617d..8d590e5268 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -392,8 +392,6 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // SceneTree _initial_set("docks/scene_tree/start_create_dialog_fully_expanded", false); - _initial_set("docks/scene_tree/draw_relationship_lines", true); - _initial_set("docks/scene_tree/relationship_line_color", Color::html("464646")); // FileSystem _initial_set("docks/filesystem/thumbnail_size", 64); diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 631b2359c5..d72de3de48 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -505,7 +505,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String if (ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc2")) { - _save_stex(image, p_save_path + ".etc2.stex", compress_mode, lossy, Image::COMPRESS_ETC2, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal, false); + _save_stex(image, p_save_path + ".etc2.stex", compress_mode, lossy, Image::COMPRESS_ETC2, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal, true); r_platform_variants->push_back("etc2"); formats_imported.push_back("etc2"); } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 9e65d9de10..e648fa0820 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -2206,6 +2206,9 @@ void ScriptEditor::_script_split_dragged(float) { Variant ScriptEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) { + if (tab_container->get_child_count() == 0) + return Variant(); + Node *cur_node = tab_container->get_child(tab_container->get_current_tab()); HBoxContainer *drag_preview = memnew(HBoxContainer); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 033a6c56d9..2b6ceac8e2 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -355,8 +355,8 @@ void ShaderEditor::_menu_option(int p_option) { void ShaderEditor::_notification(int p_what) { if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { - if (is_visible_in_tree()) - shader_editor->get_text_edit()->grab_focus(); + //if (is_visible_in_tree()) + // shader_editor->get_text_edit()->grab_focus(); } } diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index 831b2f3f16..6f9c9fa040 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -141,7 +141,7 @@ TextureEditor::TextureEditor() { // bool EditorInspectorPluginTexture::can_handle(Object *p_object) { - return Object::cast_to<Texture>(p_object) != NULL; + return Object::cast_to<ImageTexture>(p_object) != NULL || Object::cast_to<AtlasTexture>(p_object) != NULL || Object::cast_to<StreamTexture>(p_object) != NULL || Object::cast_to<LargeTexture>(p_object) != NULL || Object::cast_to<AnimatedTexture>(p_object) != NULL; } void EditorInspectorPluginTexture::parse_begin(Object *p_object) { diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 5b54384ee0..dc099b84a7 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -2460,10 +2460,12 @@ void TileSetEditor::draw_polygon_shapes() { workspace->draw_polygon(polygon, colors); if (!creating_shape) { - for (int j = 0; j < polygon.size() - 1; j++) { - workspace->draw_line(polygon[j], polygon[j + 1], c_border, 1, true); + if (polygon.size() > 1) { + for (int j = 0; j < polygon.size() - 1; j++) { + workspace->draw_line(polygon[j], polygon[j + 1], c_border, 1, true); + } + workspace->draw_line(polygon[polygon.size() - 1], polygon[0], c_border, 1, true); } - workspace->draw_line(polygon[polygon.size() - 1], polygon[0], c_border, 1, true); } if (shape == edited_occlusion_shape) { draw_handles = true; diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 4c23ae437b..8cfc6d4e8e 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -549,32 +549,28 @@ void SceneTreeEditor::_cell_multi_selected(Object *p_object, int p_cell, bool p_ void SceneTreeEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_ENTER_TREE) { - - get_tree()->connect("tree_changed", this, "_tree_changed"); - get_tree()->connect("node_removed", this, "_node_removed"); - get_tree()->connect("node_configuration_warning_changed", this, "_warning_changed"); + switch (p_what) { + case NOTIFICATION_ENTER_TREE: { - tree->connect("item_collapsed", this, "_cell_collapsed"); + get_tree()->connect("tree_changed", this, "_tree_changed"); + get_tree()->connect("node_removed", this, "_node_removed"); + get_tree()->connect("node_configuration_warning_changed", this, "_warning_changed"); - EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed"); - _editor_settings_changed(); + tree->connect("item_collapsed", this, "_cell_collapsed"); - //get_scene()->connect("tree_changed",this,"_tree_changed",Vector<Variant>(),CONNECT_DEFERRED); - //get_scene()->connect("node_removed",this,"_node_removed",Vector<Variant>(),CONNECT_DEFERRED); - _update_tree(); - } - if (p_what == NOTIFICATION_EXIT_TREE) { + _update_tree(); + } break; + case NOTIFICATION_EXIT_TREE: { - get_tree()->disconnect("tree_changed", this, "_tree_changed"); - get_tree()->disconnect("node_removed", this, "_node_removed"); - tree->disconnect("item_collapsed", this, "_cell_collapsed"); - get_tree()->disconnect("node_configuration_warning_changed", this, "_warning_changed"); - EditorSettings::get_singleton()->disconnect("settings_changed", this, "_editor_settings_changed"); - } - if (p_what == NOTIFICATION_THEME_CHANGED) { + get_tree()->disconnect("tree_changed", this, "_tree_changed"); + get_tree()->disconnect("node_removed", this, "_node_removed"); + tree->disconnect("item_collapsed", this, "_cell_collapsed"); + get_tree()->disconnect("node_configuration_warning_changed", this, "_warning_changed"); + } break; + case NOTIFICATION_THEME_CHANGED: { - _update_tree(); + _update_tree(); + } break; } } @@ -978,9 +974,6 @@ void SceneTreeEditor::_warning_changed(Node *p_for_node) { update_timer->start(); } -void SceneTreeEditor::_editor_settings_changed() { -} - void SceneTreeEditor::_bind_methods() { ClassDB::bind_method("_tree_changed", &SceneTreeEditor::_tree_changed); @@ -1001,8 +994,6 @@ void SceneTreeEditor::_bind_methods() { ClassDB::bind_method("_node_script_changed", &SceneTreeEditor::_node_script_changed); ClassDB::bind_method("_node_visibility_changed", &SceneTreeEditor::_node_visibility_changed); - ClassDB::bind_method("_editor_settings_changed", &SceneTreeEditor::_editor_settings_changed); - ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &SceneTreeEditor::get_drag_data_fw); ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &SceneTreeEditor::can_drop_data_fw); ClassDB::bind_method(D_METHOD("drop_data_fw"), &SceneTreeEditor::drop_data_fw); diff --git a/editor/scene_tree_editor.h b/editor/scene_tree_editor.h index 9b87c0981d..aa4d4dd58a 100644 --- a/editor/scene_tree_editor.h +++ b/editor/scene_tree_editor.h @@ -124,8 +124,6 @@ class SceneTreeEditor : public Control { void _warning_changed(Node *p_for_node); - void _editor_settings_changed(); - Timer *update_timer; List<StringName> *script_types; diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index ddb7f065aa..dda46d2414 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -1215,24 +1215,15 @@ void ScriptEditorDebugger::_notification(int p_what) { if (OS::get_singleton()->get_ticks_msec() > until) break; } - } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { + tabs->add_style_override("panel", editor->get_gui_base()->get_stylebox("DebuggerPanel", "EditorStyles")); tabs->add_style_override("tab_fg", editor->get_gui_base()->get_stylebox("DebuggerTabFG", "EditorStyles")); tabs->add_style_override("tab_bg", editor->get_gui_base()->get_stylebox("DebuggerTabBG", "EditorStyles")); tabs->set_margin(MARGIN_LEFT, -EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_LEFT)); tabs->set_margin(MARGIN_RIGHT, EditorNode::get_singleton()->get_gui_base()->get_stylebox("BottomPanelDebuggerOverride", "EditorStyles")->get_margin(MARGIN_RIGHT)); - bool enable_rl = EditorSettings::get_singleton()->get("docks/scene_tree/draw_relationship_lines"); - Color rl_color = EditorSettings::get_singleton()->get("docks/scene_tree/relationship_line_color"); - - if (enable_rl) { - inspect_scene_tree->add_constant_override("draw_relationship_lines", 1); - inspect_scene_tree->add_color_override("relationship_line_color", rl_color); - } else - inspect_scene_tree->add_constant_override("draw_relationship_lines", 0); - copy->set_icon(get_icon("ActionCopy", "EditorIcons")); step->set_icon(get_icon("DebugStep", "EditorIcons")); next->set_icon(get_icon("DebugNext", "EditorIcons")); @@ -1241,7 +1232,6 @@ void ScriptEditorDebugger::_notification(int p_what) { dobreak->set_icon(get_icon("Pause", "EditorIcons")); docontinue->set_icon(get_icon("DebugContinue", "EditorIcons")); vmem_refresh->set_icon(get_icon("Reload", "EditorIcons")); - } break; } } |