From a5a07d8ff66c8c3f572583351e07fb4d84e5fd58 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 9 Jun 2023 09:03:33 +0200 Subject: [PATCH] Backported from godot4: Add NavigationServer2D debug functions Adds debug functions to NavigationServer2D to mirror NavigationServer3D functions for 2D users. - smix8 https://github.com/godotengine/godot/commit/d254f0fa5f2fe23c4746b5b5a0f0e44f8613a0eb --- servers/navigation_2d_server.cpp | 31 +++++++++++++++++++++++++++++++ servers/navigation_2d_server.h | 12 ++++++++++++ 2 files changed, 43 insertions(+) diff --git a/servers/navigation_2d_server.cpp b/servers/navigation_2d_server.cpp index 3d05d2e2e..845c632da 100644 --- a/servers/navigation_2d_server.cpp +++ b/servers/navigation_2d_server.cpp @@ -142,6 +142,37 @@ bool Navigation2DServer::get_debug_enabled() const { } #ifdef DEBUG_ENABLED +void Navigation2DServer::set_debug_navigation_edge_connection_color(const Color &p_color) { + NavigationServer::get_singleton_mut()->set_debug_navigation_edge_connection_color(p_color); +} + +Color Navigation2DServer::get_debug_navigation_edge_connection_color() const { + return NavigationServer::get_singleton()->get_debug_navigation_edge_connection_color(); +} + +void Navigation2DServer::set_debug_navigation_geometry_face_color(const Color &p_color) { + NavigationServer::get_singleton_mut()->set_debug_navigation_geometry_face_color(p_color); +} + +Color Navigation2DServer::get_debug_navigation_geometry_face_color() const { + return NavigationServer::get_singleton()->get_debug_navigation_geometry_face_color(); +} + +void Navigation2DServer::set_debug_navigation_geometry_face_disabled_color(const Color &p_color) { + NavigationServer::get_singleton_mut()->set_debug_navigation_geometry_face_disabled_color(p_color); +} + +Color Navigation2DServer::get_debug_navigation_geometry_face_disabled_color() const { + return NavigationServer::get_singleton()->get_debug_navigation_geometry_face_disabled_color(); +} + +void Navigation2DServer::set_debug_navigation_enable_edge_connections(const bool p_value) { + NavigationServer::get_singleton_mut()->set_debug_navigation_enable_edge_connections(p_value); +} + +bool Navigation2DServer::get_debug_navigation_enable_edge_connections() const { + return NavigationServer::get_singleton()->get_debug_navigation_enable_edge_connections(); +} void Navigation2DServer::set_debug_navigation_link_connection_color(const Color &p_color) { NavigationServer::get_singleton_mut()->set_debug_navigation_link_connection_color(p_color); diff --git a/servers/navigation_2d_server.h b/servers/navigation_2d_server.h index 3bb009e8c..fd32a93bc 100644 --- a/servers/navigation_2d_server.h +++ b/servers/navigation_2d_server.h @@ -242,6 +242,18 @@ public: bool get_debug_enabled() const; #ifdef DEBUG_ENABLED + void set_debug_navigation_edge_connection_color(const Color &p_color); + Color get_debug_navigation_edge_connection_color() const; + + void set_debug_navigation_geometry_face_color(const Color &p_color); + Color get_debug_navigation_geometry_face_color() const; + + void set_debug_navigation_geometry_face_disabled_color(const Color &p_color); + Color get_debug_navigation_geometry_face_disabled_color() const; + + void set_debug_navigation_enable_edge_connections(const bool p_value); + bool get_debug_navigation_enable_edge_connections() const; + void set_debug_navigation_link_connection_color(const Color &p_color); Color get_debug_navigation_link_connection_color() const;