Skip to content

Commit e273e49

Browse files
Split debug settings
1 parent 6867367 commit e273e49

File tree

4 files changed

+151
-108
lines changed

4 files changed

+151
-108
lines changed

core/config/project_settings.cpp

-33
Original file line numberDiff line numberDiff line change
@@ -1633,39 +1633,6 @@ ProjectSettings::ProjectSettings() {
16331633
GLOBAL_DEF("navigation/baking/thread_model/baking_use_multiple_threads", true);
16341634
GLOBAL_DEF("navigation/baking/thread_model/baking_use_high_priority_threads", true);
16351635

1636-
#ifdef DEBUG_ENABLED
1637-
GLOBAL_DEF("debug/shapes/navigation/edge_connection_color", Color(1.0, 0.0, 1.0, 1.0));
1638-
GLOBAL_DEF("debug/shapes/navigation/geometry_edge_color", Color(0.5, 1.0, 1.0, 1.0));
1639-
GLOBAL_DEF("debug/shapes/navigation/geometry_face_color", Color(0.5, 1.0, 1.0, 0.4));
1640-
GLOBAL_DEF("debug/shapes/navigation/geometry_edge_disabled_color", Color(0.5, 0.5, 0.5, 1.0));
1641-
GLOBAL_DEF("debug/shapes/navigation/geometry_face_disabled_color", Color(0.5, 0.5, 0.5, 0.4));
1642-
GLOBAL_DEF("debug/shapes/navigation/link_connection_color", Color(1.0, 0.5, 1.0, 1.0));
1643-
GLOBAL_DEF("debug/shapes/navigation/link_connection_disabled_color", Color(0.5, 0.5, 0.5, 1.0));
1644-
GLOBAL_DEF("debug/shapes/navigation/agent_path_color", Color(1.0, 0.0, 0.0, 1.0));
1645-
1646-
GLOBAL_DEF("debug/shapes/navigation/enable_edge_connections", true);
1647-
GLOBAL_DEF("debug/shapes/navigation/enable_edge_connections_xray", true);
1648-
GLOBAL_DEF("debug/shapes/navigation/enable_edge_lines", true);
1649-
GLOBAL_DEF("debug/shapes/navigation/enable_edge_lines_xray", true);
1650-
GLOBAL_DEF("debug/shapes/navigation/enable_geometry_face_random_color", true);
1651-
GLOBAL_DEF("debug/shapes/navigation/enable_link_connections", true);
1652-
GLOBAL_DEF("debug/shapes/navigation/enable_link_connections_xray", true);
1653-
1654-
GLOBAL_DEF("debug/shapes/navigation/enable_agent_paths", true);
1655-
GLOBAL_DEF("debug/shapes/navigation/enable_agent_paths_xray", true);
1656-
GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "debug/shapes/navigation/agent_path_point_size", PROPERTY_HINT_RANGE, "0.01,10,0.001,or_greater"), 4.0);
1657-
1658-
GLOBAL_DEF("debug/shapes/avoidance/agents_radius_color", Color(1.0, 1.0, 0.0, 0.25));
1659-
GLOBAL_DEF("debug/shapes/avoidance/obstacles_radius_color", Color(1.0, 0.5, 0.0, 0.25));
1660-
GLOBAL_DEF("debug/shapes/avoidance/obstacles_static_face_pushin_color", Color(1.0, 0.0, 0.0, 0.0));
1661-
GLOBAL_DEF("debug/shapes/avoidance/obstacles_static_edge_pushin_color", Color(1.0, 0.0, 0.0, 1.0));
1662-
GLOBAL_DEF("debug/shapes/avoidance/obstacles_static_face_pushout_color", Color(1.0, 1.0, 0.0, 0.5));
1663-
GLOBAL_DEF("debug/shapes/avoidance/obstacles_static_edge_pushout_color", Color(1.0, 1.0, 0.0, 1.0));
1664-
GLOBAL_DEF("debug/shapes/avoidance/enable_agents_radius", true);
1665-
GLOBAL_DEF("debug/shapes/avoidance/enable_obstacles_radius", true);
1666-
GLOBAL_DEF("debug/shapes/avoidance/enable_obstacles_static", true);
1667-
#endif // DEBUG_ENABLED
1668-
16691636
ProjectSettings::get_singleton()->add_hidden_prefix("input/");
16701637
}
16711638

editor/editor_node.cpp

+19-19
Original file line numberDiff line numberDiff line change
@@ -491,25 +491,25 @@ void EditorNode::_update_from_settings() {
491491
ResourceImporterTexture::get_singleton()->update_imports();
492492

493493
#ifdef DEBUG_ENABLED
494-
NavigationServer2D::get_singleton()->set_debug_navigation_edge_connection_color(GLOBAL_GET("debug/shapes/navigation/edge_connection_color"));
495-
NavigationServer2D::get_singleton()->set_debug_navigation_geometry_edge_color(GLOBAL_GET("debug/shapes/navigation/geometry_edge_color"));
496-
NavigationServer2D::get_singleton()->set_debug_navigation_geometry_face_color(GLOBAL_GET("debug/shapes/navigation/geometry_face_color"));
497-
NavigationServer2D::get_singleton()->set_debug_navigation_geometry_edge_disabled_color(GLOBAL_GET("debug/shapes/navigation/geometry_edge_disabled_color"));
498-
NavigationServer2D::get_singleton()->set_debug_navigation_geometry_face_disabled_color(GLOBAL_GET("debug/shapes/navigation/geometry_face_disabled_color"));
499-
NavigationServer2D::get_singleton()->set_debug_navigation_enable_edge_connections(GLOBAL_GET("debug/shapes/navigation/enable_edge_connections"));
500-
NavigationServer2D::get_singleton()->set_debug_navigation_enable_edge_lines(GLOBAL_GET("debug/shapes/navigation/enable_edge_lines"));
501-
NavigationServer2D::get_singleton()->set_debug_navigation_enable_geometry_face_random_color(GLOBAL_GET("debug/shapes/navigation/enable_geometry_face_random_color"));
502-
503-
NavigationServer3D::get_singleton()->set_debug_navigation_edge_connection_color(GLOBAL_GET("debug/shapes/navigation/edge_connection_color"));
504-
NavigationServer3D::get_singleton()->set_debug_navigation_geometry_edge_color(GLOBAL_GET("debug/shapes/navigation/geometry_edge_color"));
505-
NavigationServer3D::get_singleton()->set_debug_navigation_geometry_face_color(GLOBAL_GET("debug/shapes/navigation/geometry_face_color"));
506-
NavigationServer3D::get_singleton()->set_debug_navigation_geometry_edge_disabled_color(GLOBAL_GET("debug/shapes/navigation/geometry_edge_disabled_color"));
507-
NavigationServer3D::get_singleton()->set_debug_navigation_geometry_face_disabled_color(GLOBAL_GET("debug/shapes/navigation/geometry_face_disabled_color"));
508-
NavigationServer3D::get_singleton()->set_debug_navigation_enable_edge_connections(GLOBAL_GET("debug/shapes/navigation/enable_edge_connections"));
509-
NavigationServer3D::get_singleton()->set_debug_navigation_enable_edge_connections_xray(GLOBAL_GET("debug/shapes/navigation/enable_edge_connections_xray"));
510-
NavigationServer3D::get_singleton()->set_debug_navigation_enable_edge_lines(GLOBAL_GET("debug/shapes/navigation/enable_edge_lines"));
511-
NavigationServer3D::get_singleton()->set_debug_navigation_enable_edge_lines_xray(GLOBAL_GET("debug/shapes/navigation/enable_edge_lines_xray"));
512-
NavigationServer3D::get_singleton()->set_debug_navigation_enable_geometry_face_random_color(GLOBAL_GET("debug/shapes/navigation/enable_geometry_face_random_color"));
494+
NavigationServer2D::get_singleton()->set_debug_navigation_edge_connection_color(GLOBAL_GET("debug/shapes/navigation/2d/edge_connection_color"));
495+
NavigationServer2D::get_singleton()->set_debug_navigation_geometry_edge_color(GLOBAL_GET("debug/shapes/navigation/2d/geometry_edge_color"));
496+
NavigationServer2D::get_singleton()->set_debug_navigation_geometry_face_color(GLOBAL_GET("debug/shapes/navigation/2d/geometry_face_color"));
497+
NavigationServer2D::get_singleton()->set_debug_navigation_geometry_edge_disabled_color(GLOBAL_GET("debug/shapes/navigation/2d/geometry_edge_disabled_color"));
498+
NavigationServer2D::get_singleton()->set_debug_navigation_geometry_face_disabled_color(GLOBAL_GET("debug/shapes/navigation/2d/geometry_face_disabled_color"));
499+
NavigationServer2D::get_singleton()->set_debug_navigation_enable_edge_connections(GLOBAL_GET("debug/shapes/navigation/2d/enable_edge_connections"));
500+
NavigationServer2D::get_singleton()->set_debug_navigation_enable_edge_lines(GLOBAL_GET("debug/shapes/navigation/2d/enable_edge_lines"));
501+
NavigationServer2D::get_singleton()->set_debug_navigation_enable_geometry_face_random_color(GLOBAL_GET("debug/shapes/navigation/2d/enable_geometry_face_random_color"));
502+
503+
NavigationServer3D::get_singleton()->set_debug_navigation_edge_connection_color(GLOBAL_GET("debug/shapes/navigation/3d/edge_connection_color"));
504+
NavigationServer3D::get_singleton()->set_debug_navigation_geometry_edge_color(GLOBAL_GET("debug/shapes/navigation/3d/geometry_edge_color"));
505+
NavigationServer3D::get_singleton()->set_debug_navigation_geometry_face_color(GLOBAL_GET("debug/shapes/navigation/3d/geometry_face_color"));
506+
NavigationServer3D::get_singleton()->set_debug_navigation_geometry_edge_disabled_color(GLOBAL_GET("debug/shapes/navigation/3d/geometry_edge_disabled_color"));
507+
NavigationServer3D::get_singleton()->set_debug_navigation_geometry_face_disabled_color(GLOBAL_GET("debug/shapes/navigation/3d/geometry_face_disabled_color"));
508+
NavigationServer3D::get_singleton()->set_debug_navigation_enable_edge_connections(GLOBAL_GET("debug/shapes/navigation/3d/enable_edge_connections"));
509+
NavigationServer3D::get_singleton()->set_debug_navigation_enable_edge_connections_xray(GLOBAL_GET("debug/shapes/navigation/3d/enable_edge_connections_xray"));
510+
NavigationServer3D::get_singleton()->set_debug_navigation_enable_edge_lines(GLOBAL_GET("debug/shapes/navigation/3d/enable_edge_lines"));
511+
NavigationServer3D::get_singleton()->set_debug_navigation_enable_edge_lines_xray(GLOBAL_GET("debug/shapes/navigation/3d/enable_edge_lines_xray"));
512+
NavigationServer3D::get_singleton()->set_debug_navigation_enable_geometry_face_random_color(GLOBAL_GET("debug/shapes/navigation/3d/enable_geometry_face_random_color"));
513513
#endif // DEBUG_ENABLED
514514
}
515515

servers/navigation_server_2d.cpp

+62-26
Original file line numberDiff line numberDiff line change
@@ -222,32 +222,68 @@ NavigationServer2D::NavigationServer2D() {
222222
GLOBAL_DEF_BASIC(PropertyInfo(Variant::FLOAT, "navigation/2d/default_link_connection_radius", PROPERTY_HINT_RANGE, "0.01,10,0.001,or_greater"), NavigationDefaults2D::link_connection_radius);
223223

224224
#ifdef DEBUG_ENABLED
225-
debug_navigation_edge_connection_color = GLOBAL_GET("debug/shapes/navigation/edge_connection_color");
226-
debug_navigation_geometry_edge_color = GLOBAL_GET("debug/shapes/navigation/geometry_edge_color");
227-
debug_navigation_geometry_face_color = GLOBAL_GET("debug/shapes/navigation/geometry_face_color");
228-
debug_navigation_geometry_edge_disabled_color = GLOBAL_GET("debug/shapes/navigation/geometry_edge_disabled_color");
229-
debug_navigation_geometry_face_disabled_color = GLOBAL_GET("debug/shapes/navigation/geometry_face_disabled_color");
230-
debug_navigation_link_connection_color = GLOBAL_GET("debug/shapes/navigation/link_connection_color");
231-
debug_navigation_link_connection_disabled_color = GLOBAL_GET("debug/shapes/navigation/link_connection_disabled_color");
232-
debug_navigation_agent_path_color = GLOBAL_GET("debug/shapes/navigation/agent_path_color");
233-
234-
debug_navigation_enable_edge_connections = GLOBAL_GET("debug/shapes/navigation/enable_edge_connections");
235-
debug_navigation_enable_edge_lines = GLOBAL_GET("debug/shapes/navigation/enable_edge_lines");
236-
debug_navigation_enable_geometry_face_random_color = GLOBAL_GET("debug/shapes/navigation/enable_geometry_face_random_color");
237-
debug_navigation_enable_link_connections = GLOBAL_GET("debug/shapes/navigation/enable_link_connections");
238-
239-
debug_navigation_enable_agent_paths = GLOBAL_GET("debug/shapes/navigation/enable_agent_paths");
240-
debug_navigation_agent_path_point_size = GLOBAL_GET("debug/shapes/navigation/agent_path_point_size");
241-
242-
debug_navigation_avoidance_agents_radius_color = GLOBAL_GET("debug/shapes/avoidance/agents_radius_color");
243-
debug_navigation_avoidance_obstacles_radius_color = GLOBAL_GET("debug/shapes/avoidance/obstacles_radius_color");
244-
debug_navigation_avoidance_static_obstacle_pushin_face_color = GLOBAL_GET("debug/shapes/avoidance/obstacles_static_face_pushin_color");
245-
debug_navigation_avoidance_static_obstacle_pushin_edge_color = GLOBAL_GET("debug/shapes/avoidance/obstacles_static_edge_pushin_color");
246-
debug_navigation_avoidance_static_obstacle_pushout_face_color = GLOBAL_GET("debug/shapes/avoidance/obstacles_static_face_pushout_color");
247-
debug_navigation_avoidance_static_obstacle_pushout_edge_color = GLOBAL_GET("debug/shapes/avoidance/obstacles_static_edge_pushout_color");
248-
debug_navigation_avoidance_enable_agents_radius = GLOBAL_GET("debug/shapes/avoidance/enable_agents_radius");
249-
debug_navigation_avoidance_enable_obstacles_radius = GLOBAL_GET("debug/shapes/avoidance/enable_obstacles_radius");
250-
debug_navigation_avoidance_enable_obstacles_static = GLOBAL_GET("debug/shapes/avoidance/enable_obstacles_static");
225+
#ifndef DISABLE_DEPRECATED
226+
#define MOVE_PROJECT_SETTING(m_old_setting, m_new_setting) \
227+
if (!ProjectSettings::get_singleton()->has_setting(m_new_setting) && ProjectSettings::get_singleton()->has_setting(m_old_setting)) { \
228+
Variant value = GLOBAL_GET(m_old_setting); \
229+
ProjectSettings::get_singleton()->set_setting(m_new_setting, value); \
230+
ProjectSettings::get_singleton()->clear(m_old_setting); \
231+
}
232+
MOVE_PROJECT_SETTING("debug/shapes/navigation/edge_connection_color", "debug/shapes/navigation/2d/edge_connection_color");
233+
MOVE_PROJECT_SETTING("debug/shapes/navigation/geometry_edge_color", "debug/shapes/navigation/2d/geometry_edge_color");
234+
MOVE_PROJECT_SETTING("debug/shapes/navigation/geometry_face_color", "debug/shapes/navigation/2d/geometry_face_color");
235+
MOVE_PROJECT_SETTING("debug/shapes/navigation/geometry_edge_disabled_color", "debug/shapes/navigation/2d/geometry_edge_disabled_color");
236+
MOVE_PROJECT_SETTING("debug/shapes/navigation/geometry_face_disabled_color", "debug/shapes/navigation/2d/geometry_face_disabled_color");
237+
MOVE_PROJECT_SETTING("debug/shapes/navigation/link_connection_color", "debug/shapes/navigation/2d/link_connection_color");
238+
MOVE_PROJECT_SETTING("debug/shapes/navigation/link_connection_disabled_color", "debug/shapes/navigation/2d/link_connection_disabled_color");
239+
MOVE_PROJECT_SETTING("debug/shapes/navigation/agent_path_color", "debug/shapes/navigation/2d/agent_path_color");
240+
241+
MOVE_PROJECT_SETTING("debug/shapes/navigation/enable_edge_connections", "debug/shapes/navigation/2d/enable_edge_connections");
242+
MOVE_PROJECT_SETTING("debug/shapes/navigation/enable_edge_lines", "debug/shapes/navigation/2d/enable_edge_lines");
243+
MOVE_PROJECT_SETTING("debug/shapes/navigation/enable_geometry_face_random_color", "debug/shapes/navigation/2d/enable_geometry_face_random_color");
244+
MOVE_PROJECT_SETTING("debug/shapes/navigation/enable_link_connections", "debug/shapes/navigation/2d/enable_link_connections");
245+
246+
MOVE_PROJECT_SETTING("debug/shapes/navigation/enable_agent_paths", "debug/shapes/navigation/2d/enable_agent_paths");
247+
MOVE_PROJECT_SETTING("debug/shapes/navigation/agent_path_point_size", "debug/shapes/navigation/2d/agent_path_point_size");
248+
249+
MOVE_PROJECT_SETTING("debug/shapes/avoidance/agents_radius_color", "debug/shapes/avoidance/2d/agents_radius_color");
250+
MOVE_PROJECT_SETTING("debug/shapes/avoidance/obstacles_radius_color", "debug/shapes/avoidance/2d/obstacles_radius_color");
251+
MOVE_PROJECT_SETTING("debug/shapes/avoidance/obstacles_static_face_pushin_color", "debug/shapes/avoidance/2d/obstacles_static_face_pushin_color");
252+
MOVE_PROJECT_SETTING("debug/shapes/avoidance/obstacles_static_edge_pushin_color", "debug/shapes/avoidance/2d/obstacles_static_edge_pushin_color");
253+
MOVE_PROJECT_SETTING("debug/shapes/avoidance/obstacles_static_face_pushout_color", "debug/shapes/avoidance/2d/obstacles_static_face_pushout_color");
254+
MOVE_PROJECT_SETTING("debug/shapes/avoidance/obstacles_static_edge_pushout_color", "debug/shapes/avoidance/2d/obstacles_static_edge_pushout_color");
255+
MOVE_PROJECT_SETTING("debug/shapes/avoidance/enable_agents_radius", "debug/shapes/avoidance/2d/enable_agents_radius");
256+
MOVE_PROJECT_SETTING("debug/shapes/avoidance/enable_obstacles_radius", "debug/shapes/avoidance/2d/enable_obstacles_radius");
257+
MOVE_PROJECT_SETTING("debug/shapes/avoidance/enable_obstacles_static", "debug/shapes/avoidance/2d/enable_obstacles_static");
258+
#undef MOVE_PROJECT_SETTING
259+
#endif // DISABLE_DEPRECATED
260+
261+
debug_navigation_edge_connection_color = GLOBAL_DEF("debug/shapes/navigation/2d/edge_connection_color", Color(1.0, 0.0, 1.0, 1.0));
262+
debug_navigation_geometry_edge_color = GLOBAL_DEF("debug/shapes/navigation/2d/geometry_edge_color", Color(0.5, 1.0, 1.0, 1.0));
263+
debug_navigation_geometry_face_color = GLOBAL_DEF("debug/shapes/navigation/2d/geometry_face_color", Color(0.5, 1.0, 1.0, 0.4));
264+
debug_navigation_geometry_edge_disabled_color = GLOBAL_DEF("debug/shapes/navigation/2d/geometry_edge_disabled_color", Color(0.5, 0.5, 0.5, 1.0));
265+
debug_navigation_geometry_face_disabled_color = GLOBAL_DEF("debug/shapes/navigation/2d/geometry_face_disabled_color", Color(0.5, 0.5, 0.5, 0.4));
266+
debug_navigation_link_connection_color = GLOBAL_DEF("debug/shapes/navigation/2d/link_connection_color", Color(1.0, 0.5, 1.0, 1.0));
267+
debug_navigation_link_connection_disabled_color = GLOBAL_DEF("debug/shapes/navigation/2d/link_connection_disabled_color", Color(0.5, 0.5, 0.5, 1.0));
268+
debug_navigation_agent_path_color = GLOBAL_DEF("debug/shapes/navigation/2d/agent_path_color", Color(1.0, 0.0, 0.0, 1.0));
269+
270+
debug_navigation_enable_edge_connections = GLOBAL_DEF("debug/shapes/navigation/2d/enable_edge_connections", true);
271+
debug_navigation_enable_edge_lines = GLOBAL_DEF("debug/shapes/navigation/2d/enable_edge_lines", true);
272+
debug_navigation_enable_geometry_face_random_color = GLOBAL_DEF("debug/shapes/navigation/2d/enable_geometry_face_random_color", true);
273+
debug_navigation_enable_link_connections = GLOBAL_DEF("debug/shapes/navigation/2d/enable_link_connections", true);
274+
275+
debug_navigation_enable_agent_paths = GLOBAL_DEF("debug/shapes/navigation/2d/enable_agent_paths", true);
276+
debug_navigation_agent_path_point_size = GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "debug/shapes/navigation/2d/agent_path_point_size", PROPERTY_HINT_RANGE, "0.01,10,0.001,or_greater"), 4.0);
277+
278+
debug_navigation_avoidance_agents_radius_color = GLOBAL_DEF("debug/shapes/avoidance/2d/agents_radius_color", Color(1.0, 1.0, 0.0, 0.25));
279+
debug_navigation_avoidance_obstacles_radius_color = GLOBAL_DEF("debug/shapes/avoidance/2d/obstacles_radius_color", Color(1.0, 0.5, 0.0, 0.25));
280+
debug_navigation_avoidance_static_obstacle_pushin_face_color = GLOBAL_DEF("debug/shapes/avoidance/2d/obstacles_static_face_pushin_color", Color(1.0, 0.0, 0.0, 0.0));
281+
debug_navigation_avoidance_static_obstacle_pushin_edge_color = GLOBAL_DEF("debug/shapes/avoidance/2d/obstacles_static_edge_pushin_color", Color(1.0, 0.0, 0.0, 1.0));
282+
debug_navigation_avoidance_static_obstacle_pushout_face_color = GLOBAL_DEF("debug/shapes/avoidance/2d/obstacles_static_face_pushout_color", Color(1.0, 1.0, 0.0, 0.5));
283+
debug_navigation_avoidance_static_obstacle_pushout_edge_color = GLOBAL_DEF("debug/shapes/avoidance/2d/obstacles_static_edge_pushout_color", Color(1.0, 1.0, 0.0, 1.0));
284+
debug_navigation_avoidance_enable_agents_radius = GLOBAL_DEF("debug/shapes/avoidance/2d/enable_agents_radius", true);
285+
debug_navigation_avoidance_enable_obstacles_radius = GLOBAL_DEF("debug/shapes/avoidance/2d/enable_obstacles_radius", true);
286+
debug_navigation_avoidance_enable_obstacles_static = GLOBAL_DEF("debug/shapes/avoidance/2d/enable_obstacles_static", true);
251287

252288
if (Engine::get_singleton()->is_editor_hint()) {
253289
// enable NavigationServer3D when in Editor or else navigation mesh edge connections are invisible

0 commit comments

Comments
 (0)