Merge pull request #94491 from iiMidknightii/fix-unique-name-on-scene-root

Disable unique name in scene when making a node the root node
This commit is contained in:
Rémi Verschelde 2024-07-18 10:45:46 +02:00
commit 5ae8ac5c59
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -990,6 +990,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
undo_redo->add_do_method(root, "set_scene_file_path", String()); undo_redo->add_do_method(root, "set_scene_file_path", String());
undo_redo->add_do_method(node, "set_owner", (Object *)nullptr); undo_redo->add_do_method(node, "set_owner", (Object *)nullptr);
undo_redo->add_do_method(root, "set_owner", node); undo_redo->add_do_method(root, "set_owner", node);
undo_redo->add_do_method(node, "set_unique_name_in_owner", false);
_node_replace_owner(root, root, node, MODE_DO); _node_replace_owner(root, root, node, MODE_DO);
undo_redo->add_undo_method(root, "set_scene_file_path", root->get_scene_file_path()); undo_redo->add_undo_method(root, "set_scene_file_path", root->get_scene_file_path());
@ -1000,6 +1001,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
undo_redo->add_undo_method(node->get_parent(), "move_child", node, node->get_index(false)); undo_redo->add_undo_method(node->get_parent(), "move_child", node, node->get_index(false));
undo_redo->add_undo_method(root, "set_owner", (Object *)nullptr); undo_redo->add_undo_method(root, "set_owner", (Object *)nullptr);
undo_redo->add_undo_method(node, "set_owner", root); undo_redo->add_undo_method(node, "set_owner", root);
undo_redo->add_undo_method(node, "set_unique_name_in_owner", node->is_unique_name_in_owner());
_node_replace_owner(root, root, root, MODE_UNDO); _node_replace_owner(root, root, root, MODE_UNDO);
undo_redo->add_do_method(scene_tree, "update_tree"); undo_redo->add_do_method(scene_tree, "update_tree");