mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 14:11:15 +00:00
Fix replace node deleting Node properties.
Update editor/scene_tree_dock.cpp Co-Authored-By: Hugo Locurcio <hugo.locurcio@hugo.pro>
This commit is contained in:
parent
c0d8d91b15
commit
4da9927faf
5 changed files with 114 additions and 31 deletions
|
|
@ -115,11 +115,8 @@ void GPUParticles2DEditorPlugin::_menu_callback(int p_idx) {
|
|||
|
||||
EditorUndoRedoManager *ur = EditorUndoRedoManager::get_singleton();
|
||||
ur->create_action(TTR("Convert to CPUParticles2D"));
|
||||
ur->add_do_method(SceneTreeDock::get_singleton(), "replace_node", particles, cpu_particles, true, false);
|
||||
ur->add_do_reference(cpu_particles);
|
||||
ur->add_undo_method(SceneTreeDock::get_singleton(), "replace_node", cpu_particles, particles, false, false);
|
||||
ur->add_undo_reference(particles);
|
||||
ur->commit_action();
|
||||
SceneTreeDock::get_singleton()->replace_node(particles, cpu_particles);
|
||||
ur->commit_action(false);
|
||||
|
||||
} break;
|
||||
case MENU_RESTART: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue