summaryrefslogtreecommitdiffstats
path: root/editor/plugins/particles_editor_plugin.cpp
diff options
context:
space:
mode:
authorTomasz Chabora <kobewi4e@gmail.com>2019-05-30 23:08:57 +0200
committerTomasz Chabora <kobewi4e@gmail.com>2019-05-30 23:08:57 +0200
commit1141ab8b25a836278f244f4270163271395d475c (patch)
tree522aa569906ccfe961b1fb26348e5020dbd1133b /editor/plugins/particles_editor_plugin.cpp
parenta2cf1c3d049d0ca4de9d939550d1fb21c4d54297 (diff)
downloadredot-engine-1141ab8b25a836278f244f4270163271395d475c.tar.gz
Allow undo conversion to CPUParticles
Diffstat (limited to 'editor/plugins/particles_editor_plugin.cpp')
-rw-r--r--editor/plugins/particles_editor_plugin.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp
index 09180edf2a..66cecf7068 100644
--- a/editor/plugins/particles_editor_plugin.cpp
+++ b/editor/plugins/particles_editor_plugin.cpp
@@ -312,7 +312,13 @@ void ParticlesEditor::_menu_option(int p_option) {
cpu_particles->set_visible(node->is_visible());
cpu_particles->set_pause_mode(node->get_pause_mode());
- EditorNode::get_singleton()->get_scene_tree_dock()->replace_node(node, cpu_particles, false);
+ UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ ur->create_action(TTR("Convert to CPUParticles"));
+ ur->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", node, cpu_particles, true, false);
+ ur->add_do_reference(node);
+ ur->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock(), "replace_node", cpu_particles, node, false, false);
+ ur->add_undo_reference(this);
+ ur->commit_action();
} break;
}