diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-02-29 14:12:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-29 14:12:54 +0100 |
commit | 1399747532634c21b964b0a85080cecfa84fde5b (patch) | |
tree | c67c5de3a33256054ae9fdf50114fa361bb3e08c /editor/editor_data.cpp | |
parent | e4bc16b7b6a7a9354e6037cb571de934a8ec1430 (diff) | |
parent | f817ba83795ed4a8a44e569cce58bc37522860c0 (diff) |
Merge pull request #36667 from simpuid/paste-params-undo-feature
Implement undo-redo feature for Parameter Paste in the Inspector
Diffstat (limited to 'editor/editor_data.cpp')
-rw-r--r-- | editor/editor_data.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 26d132665c..192e7d286f 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -435,10 +435,14 @@ void EditorData::restore_editor_global_states() { void EditorData::paste_object_params(Object *p_object) { + ERR_FAIL_NULL(p_object); + undo_redo.create_action(TTR("Paste Params")); for (List<PropertyData>::Element *E = clipboard.front(); E; E = E->next()) { - - p_object->set(E->get().name, E->get().value); + String name = E->get().name; + undo_redo.add_do_property(p_object, name, E->get().value); + undo_redo.add_undo_property(p_object, name, p_object->get(name)); } + undo_redo.commit_action(); } bool EditorData::call_build() { |