Cleanup relationship line coding after 5f079e2

This commit is contained in:
Michael Alexsander Silva Dias 2019-03-06 14:33:26 -03:00
parent 34a29cb0de
commit 73aaf06be7
6 changed files with 18 additions and 60 deletions

View file

@ -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() {

View file

@ -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);

View file

@ -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);

View file

@ -549,7 +549,8 @@ 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) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
get_tree()->connect("tree_changed", this, "_tree_changed");
get_tree()->connect("node_removed", this, "_node_removed");
@ -557,24 +558,19 @@ void SceneTreeEditor::_notification(int p_what) {
tree->connect("item_collapsed", this, "_cell_collapsed");
EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed");
_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);
_update_tree();
}
if (p_what == NOTIFICATION_EXIT_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) {
} break;
case NOTIFICATION_THEME_CHANGED: {
_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);

View file

@ -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;

View file

@ -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;
}
}