diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2024-04-21 00:40:45 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2024-04-21 00:58:08 +0200 |
commit | b1a2394b3b7c0532641c33fc74e27036cd3492c1 (patch) | |
tree | ba17ca7277bfae6389fd4f0d086713164e683bb3 | |
parent | 4a0160241fd0c1e874e297f6b08676cf0761e5e8 (diff) | |
download | redot-engine-b1a2394b3b7c0532641c33fc74e27036cd3492c1.tar.gz |
Use same colors for editor and running project for collision/path debug
This harmonizes the appearance of collision shapes and paths between
the editor and running project, in both 2D and 3D.
This means that in 3D, paths are now green and shapes are now cyan
instead of light blue.
-rw-r--r-- | doc/classes/EditorSettings.xml | 3 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 1 | ||||
-rw-r--r-- | editor/plugins/gizmos/collision_object_3d_gizmo_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/gizmos/collision_polygon_3d_gizmo_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/gizmos/ray_cast_3d_gizmo_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/gizmos/shape_cast_3d_gizmo_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/gizmos/soft_body_3d_gizmo_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/gizmos/vehicle_body_3d_gizmo_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/path_3d_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | scene/2d/physics/collision_polygon_2d.cpp | 2 |
12 files changed, 10 insertions, 14 deletions
diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index 93a7b09fce..810d55c79c 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -393,9 +393,6 @@ <member name="editors/3d_gizmos/gizmo_colors/joint" type="Color" setter="" getter=""> The 3D editor gizmo color for [Joint3D]s and [PhysicalBone3D]s. </member> - <member name="editors/3d_gizmos/gizmo_colors/shape" type="Color" setter="" getter=""> - The 3D editor gizmo color for [CollisionShape3D]s, [VehicleWheel3D]s, [RayCast3D]s and [SpringArm3D]s. - </member> <member name="editors/animation/autorename_animation_tracks" type="bool" setter="" getter=""> If [code]true[/code], automatically updates animation tracks' target paths when renaming or reparenting nodes in the Scene tree dock. </member> diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index ca6be130f9..43dbdfc75f 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -689,7 +689,6 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d/selection_box_color", Color(1.0, 0.5, 0), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/instantiated", Color(0.7, 0.7, 0.7, 0.6), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) - EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/aabb", Color(0.28, 0.8, 0.82), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) // If a line is a multiple of this, it uses the primary grid color. diff --git a/editor/plugins/gizmos/collision_object_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/collision_object_3d_gizmo_plugin.cpp index caac143f23..9a0cf36c4c 100644 --- a/editor/plugins/gizmos/collision_object_3d_gizmo_plugin.cpp +++ b/editor/plugins/gizmos/collision_object_3d_gizmo_plugin.cpp @@ -38,7 +38,7 @@ #include "scene/resources/surface_tool.h" CollisionObject3DGizmoPlugin::CollisionObject3DGizmoPlugin() { - const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); + const Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color(); create_material("shape_material", gizmo_color); const float gizmo_value = gizmo_color.get_v(); const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65); diff --git a/editor/plugins/gizmos/collision_polygon_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/collision_polygon_3d_gizmo_plugin.cpp index 7d19e8f677..44814fd2ba 100644 --- a/editor/plugins/gizmos/collision_polygon_3d_gizmo_plugin.cpp +++ b/editor/plugins/gizmos/collision_polygon_3d_gizmo_plugin.cpp @@ -35,7 +35,7 @@ #include "scene/3d/physics/collision_polygon_3d.h" CollisionPolygon3DGizmoPlugin::CollisionPolygon3DGizmoPlugin() { - const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); + const Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color(); create_material("shape_material", gizmo_color); const float gizmo_value = gizmo_color.get_v(); const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65); diff --git a/editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp index 9d4c08ed57..01492c1dd0 100644 --- a/editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp +++ b/editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp @@ -49,7 +49,7 @@ CollisionShape3DGizmoPlugin::CollisionShape3DGizmoPlugin() { helper.instantiate(); - const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); + const Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color(); create_material("shape_material", gizmo_color); const float gizmo_value = gizmo_color.get_v(); const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65); diff --git a/editor/plugins/gizmos/ray_cast_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/ray_cast_3d_gizmo_plugin.cpp index d783c4e4a7..2731a76f52 100644 --- a/editor/plugins/gizmos/ray_cast_3d_gizmo_plugin.cpp +++ b/editor/plugins/gizmos/ray_cast_3d_gizmo_plugin.cpp @@ -35,7 +35,7 @@ #include "scene/3d/physics/ray_cast_3d.h" RayCast3DGizmoPlugin::RayCast3DGizmoPlugin() { - const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); + const Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color(); create_material("shape_material", gizmo_color); const float gizmo_value = gizmo_color.get_v(); const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65); diff --git a/editor/plugins/gizmos/shape_cast_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/shape_cast_3d_gizmo_plugin.cpp index 909f5b5f9a..3bf8adb80a 100644 --- a/editor/plugins/gizmos/shape_cast_3d_gizmo_plugin.cpp +++ b/editor/plugins/gizmos/shape_cast_3d_gizmo_plugin.cpp @@ -35,7 +35,7 @@ #include "scene/3d/physics/shape_cast_3d.h" ShapeCast3DGizmoPlugin::ShapeCast3DGizmoPlugin() { - const Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); + const Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color(); create_material("shape_material", gizmo_color); const float gizmo_value = gizmo_color.get_v(); const Color gizmo_color_disabled = Color(gizmo_value, gizmo_value, gizmo_value, 0.65); diff --git a/editor/plugins/gizmos/soft_body_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/soft_body_3d_gizmo_plugin.cpp index be48e3764a..f5c8858a9c 100644 --- a/editor/plugins/gizmos/soft_body_3d_gizmo_plugin.cpp +++ b/editor/plugins/gizmos/soft_body_3d_gizmo_plugin.cpp @@ -35,7 +35,7 @@ #include "scene/3d/soft_body_3d.h" SoftBody3DGizmoPlugin::SoftBody3DGizmoPlugin() { - Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); + Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color(); create_material("shape_material", gizmo_color); create_handle_material("handles"); } diff --git a/editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp index 85e2c86947..74c55bf3dd 100644 --- a/editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp +++ b/editor/plugins/gizmos/spring_arm_3d_gizmo_plugin.cpp @@ -52,7 +52,7 @@ void SpringArm3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { } SpringArm3DGizmoPlugin::SpringArm3DGizmoPlugin() { - Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); + Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color(); create_material("shape_material", gizmo_color); } diff --git a/editor/plugins/gizmos/vehicle_body_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/vehicle_body_3d_gizmo_plugin.cpp index 69e87a55c0..1015e46965 100644 --- a/editor/plugins/gizmos/vehicle_body_3d_gizmo_plugin.cpp +++ b/editor/plugins/gizmos/vehicle_body_3d_gizmo_plugin.cpp @@ -35,7 +35,7 @@ #include "scene/3d/physics/vehicle_body_3d.h" VehicleWheel3DGizmoPlugin::VehicleWheel3DGizmoPlugin() { - Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/shape"); + Color gizmo_color = SceneTree::get_singleton()->get_debug_collisions_color(); create_material("shape_material", gizmo_color); } diff --git a/editor/plugins/path_3d_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp index 1cffdb6454..8be3dba86a 100644 --- a/editor/plugins/path_3d_editor_plugin.cpp +++ b/editor/plugins/path_3d_editor_plugin.cpp @@ -1054,7 +1054,7 @@ int Path3DGizmoPlugin::get_priority() const { } Path3DGizmoPlugin::Path3DGizmoPlugin(float p_disk_size) { - Color path_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/path", Color(0.5, 0.5, 1.0, 0.9)); + Color path_color = SceneTree::get_singleton()->get_debug_paths_color(); Color path_tilt_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/path_tilt", Color(1.0, 1.0, 0.4, 0.9)); disk_size = p_disk_size; diff --git a/scene/2d/physics/collision_polygon_2d.cpp b/scene/2d/physics/collision_polygon_2d.cpp index 72ee4d52c5..a9b47ef4d4 100644 --- a/scene/2d/physics/collision_polygon_2d.cpp +++ b/scene/2d/physics/collision_polygon_2d.cpp @@ -144,7 +144,7 @@ void CollisionPolygon2D::_notification(int p_what) { } #endif - const Color stroke_color = Color(0.9, 0.2, 0.0); + const Color stroke_color = get_tree()->get_debug_collisions_color(); draw_polyline(polygon, stroke_color); // Draw the last segment. draw_line(polygon[polygon.size() - 1], polygon[0], stroke_color); |