summaryrefslogtreecommitdiff
path: root/modules/visual_script
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-08-22 22:37:33 +0200
committerGitHub <noreply@github.com>2022-08-22 22:37:33 +0200
commitb8a64313f0675a7e781e21b530a43d824651f44d (patch)
treeaaa24e4d70cbc2135edade0780650c8c666fc196 /modules/visual_script
parent9c567a0604f1cedcce3dfa1a707d3671c51a0155 (diff)
parentece3df39386af85b069cbb67ae1893b4365f1bd3 (diff)
Merge pull request #59564 from KoBeWi/FINALLY,_ULTIMATE_UNDO_REDO
Diffstat (limited to 'modules/visual_script')
-rw-r--r--modules/visual_script/editor/visual_script_editor.cpp9
-rw-r--r--modules/visual_script/editor/visual_script_editor.h4
2 files changed, 5 insertions, 8 deletions
diff --git a/modules/visual_script/editor/visual_script_editor.cpp b/modules/visual_script/editor/visual_script_editor.cpp
index 2c7d23a3c4..a5eb09f786 100644
--- a/modules/visual_script/editor/visual_script_editor.cpp
+++ b/modules/visual_script/editor/visual_script_editor.cpp
@@ -43,6 +43,7 @@
#include "editor/editor_resource_preview.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
+#include "editor/editor_undo_redo_manager.h"
#include "scene/gui/check_button.h"
#include "scene/gui/graph_edit.h"
#include "scene/gui/separator.h"
@@ -74,7 +75,7 @@ class VisualScriptEditorSignalEdit : public Object {
StringName sig;
public:
- UndoRedo *undo_redo;
+ Ref<EditorUndoRedoManager> undo_redo;
Ref<VisualScript> script;
protected:
@@ -197,8 +198,6 @@ public:
sig = p_sig;
notify_property_list_changed();
}
-
- VisualScriptEditorSignalEdit() { undo_redo = nullptr; }
};
class VisualScriptEditorVariableEdit : public Object {
@@ -207,7 +206,7 @@ class VisualScriptEditorVariableEdit : public Object {
StringName var;
public:
- UndoRedo *undo_redo;
+ Ref<EditorUndoRedoManager> undo_redo;
Ref<VisualScript> script;
protected:
@@ -355,8 +354,6 @@ public:
var = p_var;
notify_property_list_changed();
}
-
- VisualScriptEditorVariableEdit() { undo_redo = nullptr; }
};
static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) {
diff --git a/modules/visual_script/editor/visual_script_editor.h b/modules/visual_script/editor/visual_script_editor.h
index 6b337e52f6..306f71ecf8 100644
--- a/modules/visual_script/editor/visual_script_editor.h
+++ b/modules/visual_script/editor/visual_script_editor.h
@@ -38,6 +38,7 @@
class GraphEdit;
+class EditorUndoRedoManager;
class VisualScriptEditorSignalEdit;
class VisualScriptEditorVariableEdit;
@@ -135,8 +136,7 @@ class VisualScriptEditor : public ScriptEditorBase {
EditorProperty *default_property_editor = nullptr;
Ref<VisualScriptEditedProperty> edited_default_property_holder;
- UndoRedo *undo_redo = nullptr;
-
+ Ref<EditorUndoRedoManager> undo_redo;
Tree *members = nullptr;
AcceptDialog *function_name_edit = nullptr;
LineEdit *function_name_box = nullptr;