Skip to content

Commit

Permalink
Merge pull request #59615 from timothyqiu/debug-colors-3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga committed Mar 28, 2022
2 parents fa9e2f8 + 37d4306 commit e80a8be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5563,6 +5563,14 @@ void EditorNode::_resource_loaded(RES p_resource, const String &p_path) {
singleton->editor_folding.load_resource_folding(p_resource, p_path);
}

void EditorNode::_project_settings_changed() {
SceneTree *tree = get_tree();
tree->set_debug_collisions_color(GLOBAL_GET("debug/shapes/collision/shape_color"));
tree->set_debug_collision_contact_color(GLOBAL_GET("debug/shapes/collision/contact_color"));
tree->set_debug_navigation_color(GLOBAL_GET("debug/shapes/navigation/geometry_color"));
tree->set_debug_navigation_disabled_color(GLOBAL_GET("debug/shapes/navigation/disabled_geometry_color"));
}

void EditorNode::_feature_profile_changed() {
Ref<EditorFeatureProfile> profile = feature_profile_manager->get_current_profile();
TabContainer *import_tabs = cast_to<TabContainer>(import_dock->get_parent());
Expand Down Expand Up @@ -5694,6 +5702,7 @@ void EditorNode::_bind_methods() {
ClassDB::bind_method(D_METHOD("_reload_modified_scenes"), &EditorNode::_reload_modified_scenes);
ClassDB::bind_method(D_METHOD("_reload_project_settings"), &EditorNode::_reload_project_settings);
ClassDB::bind_method(D_METHOD("_resave_scenes"), &EditorNode::_resave_scenes);
ClassDB::bind_method(D_METHOD("_project_settings_changed"), &EditorNode::_project_settings_changed);
ClassDB::bind_method(D_METHOD("_feature_profile_changed"), &EditorNode::_feature_profile_changed);

ClassDB::bind_method("_screenshot", &EditorNode::_screenshot);
Expand Down Expand Up @@ -6276,6 +6285,7 @@ EditorNode::EditorNode() {

project_settings = memnew(ProjectSettingsEditor(&editor_data));
gui_base->add_child(project_settings);
ProjectSettings::get_singleton()->connect("project_settings_changed", this, "_project_settings_changed");

run_settings_dialog = memnew(RunSettingsDialog);
gui_base->add_child(run_settings_dialog);
Expand Down
1 change: 1 addition & 0 deletions editor/editor_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ class EditorNode : public Node {
void _reload_project_settings();
void _resave_scenes(String p_str);

void _project_settings_changed();
void _feature_profile_changed();
bool _is_class_editor_disabled_by_feature_profile(const StringName &p_class);
Ref<ImageTexture> _load_custom_class_icon(const String &p_path) const;
Expand Down

0 comments on commit e80a8be

Please sign in to comment.