浏览代码

Merge pull request #41203 from KoBeWi/post_mortem_xd

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

+ 3 - 0
doc/classes/Node.xml

@@ -918,6 +918,9 @@
 		<constant name="NOTIFICATION_INTERNAL_PHYSICS_PROCESS" value="26">
 		<constant name="NOTIFICATION_INTERNAL_PHYSICS_PROCESS" value="26">
 			Notification received every frame when the internal physics process flag is set (see [method set_physics_process_internal]).
 			Notification received every frame when the internal physics process flag is set (see [method set_physics_process_internal]).
 		</constant>
 		</constant>
+		<constant name="NOTIFICATION_POST_ENTER_TREE" value="27">
+			Notification received when the node is ready, just before [constant NOTIFICATION_READY] is received. Unlike the latter, it's sent every time the node enters tree, instead of only once.
+		</constant>
 		<constant name="NOTIFICATION_WM_MOUSE_ENTER" value="1002">
 		<constant name="NOTIFICATION_WM_MOUSE_ENTER" value="1002">
 			Notification received from the OS when the mouse enters the game window.
 			Notification received from the OS when the mouse enters the game window.
 			Implemented on desktop and web platforms.
 			Implemented on desktop and web platforms.

+ 1 - 0
scene/main/node.cpp

@@ -2852,6 +2852,7 @@ void Node::_bind_methods() {
 	BIND_CONSTANT(NOTIFICATION_PATH_CHANGED);
 	BIND_CONSTANT(NOTIFICATION_PATH_CHANGED);
 	BIND_CONSTANT(NOTIFICATION_INTERNAL_PROCESS);
 	BIND_CONSTANT(NOTIFICATION_INTERNAL_PROCESS);
 	BIND_CONSTANT(NOTIFICATION_INTERNAL_PHYSICS_PROCESS);
 	BIND_CONSTANT(NOTIFICATION_INTERNAL_PHYSICS_PROCESS);
+	BIND_CONSTANT(NOTIFICATION_POST_ENTER_TREE);
 
 
 	BIND_CONSTANT(NOTIFICATION_WM_MOUSE_ENTER);
 	BIND_CONSTANT(NOTIFICATION_WM_MOUSE_ENTER);
 	BIND_CONSTANT(NOTIFICATION_WM_MOUSE_EXIT);
 	BIND_CONSTANT(NOTIFICATION_WM_MOUSE_EXIT);