You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Merge pull request #87252 from ajreckof/Fix-renaming-a-node-to-the-name-of-its-siblings-breaking-NodePath
Fix renaming a node to the name of its siblings breaking NodePath
This commit is contained in:
@@ -1051,10 +1051,9 @@ void SceneTreeEditor::_rename_node(Node *p_node, const String &p_name) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
new_name = p_node->get_parent()->prevalidate_child_name(p_node, new_name);
|
||||||
if (new_name == p_node->get_name()) {
|
if (new_name == p_node->get_name()) {
|
||||||
if (item->get_text(0).is_empty()) {
|
|
||||||
item->set_text(0, new_name);
|
item->set_text(0, new_name);
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1214,6 +1214,11 @@ String Node::validate_child_name(Node *p_child) {
|
|||||||
_generate_serial_child_name(p_child, name);
|
_generate_serial_child_name(p_child, name);
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String Node::prevalidate_child_name(Node *p_child, StringName p_name) {
|
||||||
|
_generate_serial_child_name(p_child, p_name);
|
||||||
|
return p_name;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
String Node::adjust_name_casing(const String &p_name) {
|
String Node::adjust_name_casing(const String &p_name) {
|
||||||
|
|||||||
@@ -614,6 +614,7 @@ public:
|
|||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
String validate_child_name(Node *p_child);
|
String validate_child_name(Node *p_child);
|
||||||
|
String prevalidate_child_name(Node *p_child, StringName p_name);
|
||||||
#endif
|
#endif
|
||||||
static String adjust_name_casing(const String &p_name);
|
static String adjust_name_casing(const String &p_name);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user