Backported from godot4: Add NavigationServer2D debug functions

Adds debug functions to NavigationServer2D to mirror NavigationServer3D functions for 2D users.
- smix8
d254f0fa5f
This commit is contained in:
Relintai 2023-06-09 09:03:33 +02:00
parent 9c95fade84
commit a5a07d8ff6
2 changed files with 43 additions and 0 deletions

View File

@ -142,6 +142,37 @@ bool Navigation2DServer::get_debug_enabled() const {
} }
#ifdef DEBUG_ENABLED #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) { void Navigation2DServer::set_debug_navigation_link_connection_color(const Color &p_color) {
NavigationServer::get_singleton_mut()->set_debug_navigation_link_connection_color(p_color); NavigationServer::get_singleton_mut()->set_debug_navigation_link_connection_color(p_color);

View File

@ -242,6 +242,18 @@ public:
bool get_debug_enabled() const; bool get_debug_enabled() const;
#ifdef DEBUG_ENABLED #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); void set_debug_navigation_link_connection_color(const Color &p_color);
Color get_debug_navigation_link_connection_color() const; Color get_debug_navigation_link_connection_color() const;