1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-18 14:21:41 +00:00

Unify usage of undo_redo in editor

This commit is contained in:
kobewi
2022-08-29 12:10:32 +02:00
parent 604abb434f
commit 15831e381b
47 changed files with 205 additions and 224 deletions

View File

@@ -30,6 +30,9 @@
#include "line_2d_editor_plugin.h"
#include "editor/editor_node.h"
#include "editor/editor_undo_redo_manager.h"
Node2D *Line2DEditor::_get_node() const {
return node;
}
@@ -52,6 +55,7 @@ void Line2DEditor::_set_polygon(int p_idx, const Variant &p_polygon) const {
void Line2DEditor::_action_set_polygon(int p_idx, const Variant &p_previous, const Variant &p_polygon) {
Node2D *_node = _get_node();
Ref<EditorUndoRedoManager> &undo_redo = EditorNode::get_undo_redo();
undo_redo->add_do_method(_node, "set_points", p_polygon);
undo_redo->add_undo_method(_node, "set_points", p_previous);
}