diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_properties.cpp | 5 | ||||
-rw-r--r-- | editor/editor_properties.h | 1 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 17 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 1 |
4 files changed, 17 insertions, 7 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 690808ddac..90c7a4d1e9 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2144,10 +2144,6 @@ void EditorPropertyColor::_color_changed(const Color &p_color) { emit_changed(get_edited_property(), p_color, "", true); } -void EditorPropertyColor::_popup_closed() { - emit_changed(get_edited_property(), picker->get_pick_color(), "", false); -} - void EditorPropertyColor::_picker_created() { // get default color picker mode from editor settings int default_color_mode = EDITOR_GET("interface/inspector/default_color_picker_mode"); @@ -2191,7 +2187,6 @@ EditorPropertyColor::EditorPropertyColor() { add_child(picker); picker->set_flat(true); picker->connect("color_changed", callable_mp(this, &EditorPropertyColor::_color_changed)); - picker->connect("popup_closed", callable_mp(this, &EditorPropertyColor::_popup_closed)); picker->connect("picker_created", callable_mp(this, &EditorPropertyColor::_picker_created)); } diff --git a/editor/editor_properties.h b/editor/editor_properties.h index ab908244ba..856a406e62 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -547,7 +547,6 @@ class EditorPropertyColor : public EditorProperty { GDCLASS(EditorPropertyColor, EditorProperty); ColorPickerButton *picker; void _color_changed(const Color &p_color); - void _popup_closed(); void _picker_created(); protected: diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 67b7a2af79..498f9d5c19 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -963,9 +963,24 @@ void CanvasItemEditor::_restore_canvas_item_state(List<CanvasItem *> p_canvas_it } void CanvasItemEditor::_commit_canvas_item_state(List<CanvasItem *> p_canvas_items, String action_name, bool commit_bones) { - undo_redo->create_action(action_name); + List<CanvasItem *> modified_canvas_items; for (List<CanvasItem *>::Element *E = p_canvas_items.front(); E; E = E->next()) { CanvasItem *canvas_item = E->get(); + Dictionary old_state = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item)->undo_state; + Dictionary new_state = canvas_item->_edit_get_state(); + + if (old_state.hash() != new_state.hash()) { + modified_canvas_items.push_back(canvas_item); + } + } + + if (modified_canvas_items.is_empty()) { + return; + } + + undo_redo->create_action(action_name); + for (List<CanvasItem *>::Element *E = modified_canvas_items.front(); E; E = E->next()) { + CanvasItem *canvas_item = E->get(); CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); undo_redo->add_do_method(canvas_item, "_edit_set_state", canvas_item->_edit_get_state()); undo_redo->add_undo_method(canvas_item, "_edit_set_state", se->undo_state); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index f317ac581f..17d3883689 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -228,6 +228,7 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node } editor_data->get_undo_redo().commit_action(); + editor->push_item(instances[instances.size() - 1]); } void SceneTreeDock::_replace_with_branch_scene(const String &p_file, Node *base) { |