Skip to content

Commit

Permalink
Merge pull request #52387 from Calinou/node-rename-path-changed-notif…
Browse files Browse the repository at this point in the history
…ication

Rename Node's `NOTIFICATION_PATH_CHANGED` to `NOTIFICATION_PATH_RENAMED`
  • Loading branch information
mhilbrunner authored Nov 25, 2021
2 parents b3ec5a1 + 879c37d commit a6a2e0f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions doc/classes/Node.xml
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,8 @@
<constant name="NOTIFICATION_DRAG_END" value="22">
Notification received when a drag ends.
</constant>
<constant name="NOTIFICATION_PATH_CHANGED" value="23">
Notification received when the node's [NodePath] changed.
<constant name="NOTIFICATION_PATH_RENAMED" value="23">
Notification received when the node's name or one of its parents' name is changed. This notification is [i]not[/i] received when the node is removed from the scene tree to be added to another parent later on.
</constant>
<constant name="NOTIFICATION_INTERNAL_PROCESS" value="25">
Notification received every frame when the internal process flag is set (see [method set_process_internal]).
Expand Down
6 changes: 3 additions & 3 deletions scene/main/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void Node::_notification(int p_notification) {
get_multiplayer()->scene_enter_exit_notify(data.scene_file_path, this, false);
}
} break;
case NOTIFICATION_PATH_CHANGED: {
case NOTIFICATION_PATH_RENAMED: {
if (data.path_cache) {
memdelete(data.path_cache);
data.path_cache = nullptr;
Expand Down Expand Up @@ -899,7 +899,7 @@ void Node::set_name(const String &p_name) {
data.parent->_validate_child_name(this);
}

propagate_notification(NOTIFICATION_PATH_CHANGED);
propagate_notification(NOTIFICATION_PATH_RENAMED);

if (is_inside_tree()) {
emit_signal(SNAME("renamed"));
Expand Down Expand Up @@ -2829,7 +2829,7 @@ void Node::_bind_methods() {
BIND_CONSTANT(NOTIFICATION_INSTANCED);
BIND_CONSTANT(NOTIFICATION_DRAG_BEGIN);
BIND_CONSTANT(NOTIFICATION_DRAG_END);
BIND_CONSTANT(NOTIFICATION_PATH_CHANGED);
BIND_CONSTANT(NOTIFICATION_PATH_RENAMED);
BIND_CONSTANT(NOTIFICATION_INTERNAL_PROCESS);
BIND_CONSTANT(NOTIFICATION_INTERNAL_PHYSICS_PROCESS);
BIND_CONSTANT(NOTIFICATION_POST_ENTER_TREE);
Expand Down
2 changes: 1 addition & 1 deletion scene/main/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class Node : public Object {
NOTIFICATION_INSTANCED = 20,
NOTIFICATION_DRAG_BEGIN = 21,
NOTIFICATION_DRAG_END = 22,
NOTIFICATION_PATH_CHANGED = 23,
NOTIFICATION_PATH_RENAMED = 23,
//NOTIFICATION_TRANSLATION_CHANGED = 24, moved below
NOTIFICATION_INTERNAL_PROCESS = 25,
NOTIFICATION_INTERNAL_PHYSICS_PROCESS = 26,
Expand Down

0 comments on commit a6a2e0f

Please sign in to comment.