浏览代码

Merge pull request #59590 from Calinou/rename-print-stray-nodes

Rémi Verschelde 3 年之前
父节点
当前提交
8e5d927af5
共有 3 个文件被更改,包括 9 次插入8 次删除
  1. 3 2
      doc/classes/Node.xml
  2. 4 4
      scene/main/node.cpp
  3. 2 2
      scene/main/node.h

+ 3 - 2
doc/classes/Node.xml

@@ -483,10 +483,11 @@
 				[b]Note:[/b] Internal children can only be moved within their expected "internal range" (see [code]internal[/code] parameter in [method add_child]).
 				[b]Note:[/b] Internal children can only be moved within their expected "internal range" (see [code]internal[/code] parameter in [method add_child]).
 			</description>
 			</description>
 		</method>
 		</method>
-		<method name="print_stray_nodes">
+		<method name="print_orphan_nodes">
 			<return type="void" />
 			<return type="void" />
 			<description>
 			<description>
-				Prints all stray nodes (nodes outside the [SceneTree]). Used for debugging. Works only in debug builds.
+				Prints all orphan nodes (nodes outside the [SceneTree]). Used for debugging.
+				[b]Note:[/b] [method print_orphan_nodes] only works in debug builds. When called in a project exported in release mode, [method print_orphan_nodes] will not print anything.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="print_tree">
 		<method name="print_tree">

+ 4 - 4
scene/main/node.cpp

@@ -2485,11 +2485,11 @@ static void _Node_debug_sn(Object *p_obj) {
 }
 }
 #endif // DEBUG_ENABLED
 #endif // DEBUG_ENABLED
 
 
-void Node::_print_stray_nodes() {
-	print_stray_nodes();
+void Node::_print_orphan_nodes() {
+	print_orphan_nodes();
 }
 }
 
 
-void Node::print_stray_nodes() {
+void Node::print_orphan_nodes() {
 #ifdef DEBUG_ENABLED
 #ifdef DEBUG_ENABLED
 	ObjectDB::debug_objects(_Node_debug_sn);
 	ObjectDB::debug_objects(_Node_debug_sn);
 #endif
 #endif
@@ -2701,7 +2701,7 @@ void Node::_bind_methods() {
 	ClassDB::bind_method(D_METHOD("set_process_mode", "mode"), &Node::set_process_mode);
 	ClassDB::bind_method(D_METHOD("set_process_mode", "mode"), &Node::set_process_mode);
 	ClassDB::bind_method(D_METHOD("get_process_mode"), &Node::get_process_mode);
 	ClassDB::bind_method(D_METHOD("get_process_mode"), &Node::get_process_mode);
 	ClassDB::bind_method(D_METHOD("can_process"), &Node::can_process);
 	ClassDB::bind_method(D_METHOD("can_process"), &Node::can_process);
-	ClassDB::bind_method(D_METHOD("print_stray_nodes"), &Node::_print_stray_nodes);
+	ClassDB::bind_method(D_METHOD("print_orphan_nodes"), &Node::_print_orphan_nodes);
 
 
 	ClassDB::bind_method(D_METHOD("set_display_folded", "fold"), &Node::set_display_folded);
 	ClassDB::bind_method(D_METHOD("set_display_folded", "fold"), &Node::set_display_folded);
 	ClassDB::bind_method(D_METHOD("is_displayed_folded"), &Node::is_displayed_folded);
 	ClassDB::bind_method(D_METHOD("is_displayed_folded"), &Node::is_displayed_folded);

+ 2 - 2
scene/main/node.h

@@ -168,7 +168,7 @@ private:
 	void _propagate_ready();
 	void _propagate_ready();
 	void _propagate_exit_tree();
 	void _propagate_exit_tree();
 	void _propagate_after_exit_tree();
 	void _propagate_after_exit_tree();
-	void _print_stray_nodes();
+	void _print_orphan_nodes();
 	void _propagate_process_owner(Node *p_owner, int p_pause_notification, int p_enabled_notification);
 	void _propagate_process_owner(Node *p_owner, int p_pause_notification, int p_enabled_notification);
 	Array _get_node_and_resource(const NodePath &p_path);
 	Array _get_node_and_resource(const NodePath &p_path);
 
 
@@ -435,7 +435,7 @@ public:
 
 
 	void request_ready();
 	void request_ready();
 
 
-	static void print_stray_nodes();
+	static void print_orphan_nodes();
 
 
 #ifdef TOOLS_ENABLED
 #ifdef TOOLS_ENABLED
 	String validate_child_name(Node *p_child);
 	String validate_child_name(Node *p_child);