diff options
Diffstat (limited to 'editor/editor_undo_redo_manager.cpp')
-rw-r--r-- | editor/editor_undo_redo_manager.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/editor/editor_undo_redo_manager.cpp b/editor/editor_undo_redo_manager.cpp index 2ef52bd85a..f65f905b25 100644 --- a/editor/editor_undo_redo_manager.cpp +++ b/editor/editor_undo_redo_manager.cpp @@ -39,6 +39,8 @@ #include "editor/editor_node.h" #include "scene/main/node.h" +EditorUndoRedoManager *EditorUndoRedoManager::singleton = nullptr; + EditorUndoRedoManager::History &EditorUndoRedoManager::get_or_create_history(int p_idx) { if (!history_map.has(p_idx)) { History history; @@ -503,6 +505,16 @@ void EditorUndoRedoManager::_bind_methods() { BIND_ENUM_CONSTANT(INVALID_HISTORY); } +EditorUndoRedoManager *EditorUndoRedoManager::get_singleton() { + return singleton; +} + +EditorUndoRedoManager::EditorUndoRedoManager() { + if (!singleton) { + singleton = this; + } +} + EditorUndoRedoManager::~EditorUndoRedoManager() { for (const KeyValue<int, History> &E : history_map) { discard_history(E.key, false); |