diff options
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/editor_settings.cpp | 4 | ||||
-rw-r--r-- | tools/editor/scene_tree_editor.cpp | 21 | ||||
-rw-r--r-- | tools/editor/scene_tree_editor.h | 3 |
3 files changed, 26 insertions, 2 deletions
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index 0d0008fcb8..5756b7485f 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -381,7 +381,7 @@ void EditorSettings::create() { singleton->save_changed_setting=true; singleton->config_file_path=config_file_path; singleton->settings_path=config_path+"/"+config_dir; - singleton->_load_defaults(extra_config); + singleton->_load_defaults(extra_config); singleton->setup_language(); singleton->setup_network(); singleton->list_text_editor_themes(); @@ -563,6 +563,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { hints["scenetree_editor/duplicate_node_name_num_separator"]=PropertyInfo(Variant::INT,"scenetree_editor/duplicate_node_name_num_separator",PROPERTY_HINT_ENUM, "None,Space,Underscore,Dash"); //set("scenetree_editor/display_old_action_buttons",false); set("scenetree_editor/start_create_dialog_fully_expanded",false); + set("scenetree_editor/draw_relationship_lines",false); + set("scenetree_editor/relationship_line_color",Color::html("464646")); set("gridmap_editor/pick_distance", 5000.0); diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index 2de6fc5cf2..a155f0c0cf 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -653,6 +653,8 @@ void SceneTreeEditor::_notification(int p_what) { inheritance_menu->set_item_icon(2,get_icon("Load","EditorIcons")); clear_inherit_confirm->connect("confirmed",this,"_subscene_option",varray(SCENE_MENU_CLEAR_INHERITANCE_CONFIRM)); + EditorSettings::get_singleton()->connect("settings_changed",this,"_editor_settings_changed"); + // get_scene()->connect("tree_changed",this,"_tree_changed",Vector<Variant>(),CONNECT_DEFERRED); // get_scene()->connect("node_removed",this,"_node_removed",Vector<Variant>(),CONNECT_DEFERRED); @@ -665,6 +667,7 @@ void SceneTreeEditor::_notification(int p_what) { tree->disconnect("item_collapsed",this,"_cell_collapsed"); clear_inherit_confirm->disconnect("confirmed",this,"_subscene_option"); get_tree()->disconnect("node_configuration_warning_changed",this,"_warning_changed"); + EditorSettings::get_singleton()->disconnect("settings_changed",this,"_editor_settings_changed"); } } @@ -1048,6 +1051,21 @@ void SceneTreeEditor::_warning_changed(Node* p_for_node) { } + +void SceneTreeEditor::_editor_settings_changed() { + bool enable_rl = EditorSettings::get_singleton()->get("scenetree_editor/draw_relationship_lines"); + Color rl_color = EditorSettings::get_singleton()->get("scenetree_editor/relationship_line_color"); + + if (enable_rl) { + tree->add_constant_override("draw_relationship_lines",1); + tree->add_color_override("relationship_line_color", rl_color); + } + else + tree->add_constant_override("draw_relationship_lines",0); + +} + + void SceneTreeEditor::_bind_methods() { ObjectTypeDB::bind_method("_tree_changed",&SceneTreeEditor::_tree_changed); @@ -1068,6 +1086,8 @@ void SceneTreeEditor::_bind_methods() { ObjectTypeDB::bind_method("_node_script_changed",&SceneTreeEditor::_node_script_changed); ObjectTypeDB::bind_method("_node_visibility_changed",&SceneTreeEditor::_node_visibility_changed); + ObjectTypeDB::bind_method("_editor_settings_changed", &SceneTreeEditor::_editor_settings_changed); + ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &SceneTreeEditor::get_drag_data_fw); ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &SceneTreeEditor::can_drop_data_fw); ObjectTypeDB::bind_method(_MD("drop_data_fw"), &SceneTreeEditor::drop_data_fw); @@ -1252,4 +1272,3 @@ SceneTreeDialog::SceneTreeDialog() { SceneTreeDialog::~SceneTreeDialog() { } - diff --git a/tools/editor/scene_tree_editor.h b/tools/editor/scene_tree_editor.h index e184891200..79b7a64468 100644 --- a/tools/editor/scene_tree_editor.h +++ b/tools/editor/scene_tree_editor.h @@ -34,6 +34,7 @@ #include "scene/gui/dialogs.h" #include "undo_redo.h" #include "editor_data.h" +#include "editor_settings.h" /** @author Juan Linietsky <reduzio@gmail.com> */ @@ -132,6 +133,8 @@ class SceneTreeEditor : public Control { void _warning_changed(Node* p_for_node); + void _editor_settings_changed(); + Timer* update_timer; public: |