summaryrefslogtreecommitdiff
path: root/editor/editor_data.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_data.cpp')
-rw-r--r--editor/editor_data.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 1468b8fc35..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() {
@@ -1024,7 +1028,7 @@ void EditorSelection::add_node(Node *p_node) {
}
selection[p_node] = meta;
- p_node->connect("tree_exiting", this, "_node_removed", varray(p_node), CONNECT_ONESHOT);
+ p_node->connect("tree_exiting", callable_mp(this, &EditorSelection::_node_removed), varray(p_node), CONNECT_ONESHOT);
//emit_signal("selection_changed");
}
@@ -1042,7 +1046,7 @@ void EditorSelection::remove_node(Node *p_node) {
if (meta)
memdelete(meta);
selection.erase(p_node);
- p_node->disconnect("tree_exiting", this, "_node_removed");
+ p_node->disconnect("tree_exiting", callable_mp(this, &EditorSelection::_node_removed));
//emit_signal("selection_changed");
}
bool EditorSelection::is_selected(Node *p_node) const {
@@ -1076,7 +1080,6 @@ Array EditorSelection::get_selected_nodes() {
void EditorSelection::_bind_methods() {
- ClassDB::bind_method(D_METHOD("_node_removed"), &EditorSelection::_node_removed);
ClassDB::bind_method(D_METHOD("clear"), &EditorSelection::clear);
ClassDB::bind_method(D_METHOD("add_node", "node"), &EditorSelection::add_node);
ClassDB::bind_method(D_METHOD("remove_node", "node"), &EditorSelection::remove_node);