summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorsmix8 <52464204+smix8@users.noreply.github.com>2022-08-04 13:40:05 +0200
committersmix8 <52464204+smix8@users.noreply.github.com>2022-09-07 18:30:35 +0200
commitd7f75fab606fece5f7eb083ef6931f75815630fc (patch)
tree0d33996b3ae8c5036516393aae0de24bcd19da07 /editor
parent6b92dbfce2868f71926d2720014e45af999f21be (diff)
Remove / Replace old Navigation Debug Visualization
- removes / replaces leftovers from old navigation debug code - cleanes SceneTree and ProjectSettings from old navigation debug
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp2
-rw-r--r--editor/plugins/tiles/tile_data_editors.cpp13
2 files changed, 11 insertions, 4 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index a2231f4601..13eccfec3e 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -566,8 +566,6 @@ void EditorNode::_update_from_settings() {
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"));
#ifdef DEBUG_ENABLED
NavigationServer3D::get_singleton_mut()->set_debug_navigation_edge_connection_color(GLOBAL_GET("debug/shapes/navigation/edge_connection_color"));
diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp
index 1dce41e4c7..4d54001b94 100644
--- a/editor/plugins/tiles/tile_data_editors.cpp
+++ b/editor/plugins/tiles/tile_data_editors.cpp
@@ -40,6 +40,10 @@
#include "editor/editor_scale.h"
#include "editor/editor_undo_redo_manager.h"
+#ifdef DEBUG_ENABLED
+#include "servers/navigation_server_3d.h"
+#endif // DEBUG_ENABLED
+
void TileDataEditor::_tile_set_changed_plan_update() {
_tile_set_changed_update_needed = true;
call_deferred(SNAME("_tile_set_changed_deferred_update"));
@@ -2674,7 +2678,9 @@ void TileDataNavigationEditor::_tile_set_changed() {
void TileDataNavigationEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
- polygon_editor->set_polygons_color(get_tree()->get_debug_navigation_color());
+#ifdef DEBUG_ENABLED
+ polygon_editor->set_polygons_color(NavigationServer3D::get_singleton()->get_debug_navigation_geometry_face_color());
+#endif // DEBUG_ENABLED
} break;
}
}
@@ -2701,7 +2707,10 @@ void TileDataNavigationEditor::draw_over_tile(CanvasItem *p_canvas_item, Transfo
return;
}
- Color color = p_canvas_item->get_tree()->get_debug_navigation_color();
+ Color color = Color(0.5, 1.0, 1.0, 1.0);
+#ifdef DEBUG_ENABLED
+ color = NavigationServer3D::get_singleton()->get_debug_navigation_geometry_face_color();
+#endif // DEBUG_ENABLED
if (p_selected) {
Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color");
Color selection_color = Color().from_hsv(Math::fposmod(grid_color.get_h() + 0.5, 1.0), grid_color.get_s(), grid_color.get_v(), 1.0);