summaryrefslogtreecommitdiff
path: root/tools/editor/scene_tree_dock.cpp
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2016-10-08 20:37:05 +0200
committerPedro J. Estébanez <pedrojrulez@gmail.com>2016-10-08 21:49:15 +0200
commit88a32c11f1d35c57a7af4b8f6733595b95ab4e4b (patch)
tree8eb74ef3570daaf23bdb9e822ea9b59b384f58bd /tools/editor/scene_tree_dock.cpp
parent78d97b060a6873a454e710380cb9ef1bde5e4c65 (diff)
Fix reparent undo not renaming back
Diffstat (limited to 'tools/editor/scene_tree_dock.cpp')
-rw-r--r--tools/editor/scene_tree_dock.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp
index 9c4e641535..d69f1ac58f 100644
--- a/tools/editor/scene_tree_dock.cpp
+++ b/tools/editor/scene_tree_dock.cpp
@@ -1109,6 +1109,7 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec
editor_data->get_undo_redo().create_action(TTR("Reparent Node"));
List<Pair<NodePath,NodePath> > path_renames;
+ Vector<StringName> former_names;
int inc=0;
@@ -1118,6 +1119,7 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec
Node *node = p_nodes[ni];
fill_path_renames(node,new_parent,&path_renames);
+ former_names.push_back(node->get_name());
List<Node*> owned;
node->get_owned_by(node->get_owner(),&owned);
@@ -1159,6 +1161,7 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec
editor_data->get_undo_redo().add_do_method(AnimationPlayerEditor::singleton->get_key_editor(),"set_root",node);
editor_data->get_undo_redo().add_undo_method(new_parent,"remove_child",node);
+ editor_data->get_undo_redo().add_undo_method(node,"set_name",former_names[ni]);
inc++;