diff options
| author | Franklin Sobrinho <franklin_gs@hotmail.com> | 2016-08-17 17:14:51 -0300 |
|---|---|---|
| committer | Franklin Sobrinho <franklin_gs@hotmail.com> | 2016-08-17 17:14:51 -0300 |
| commit | debf574df35caf8e0880b65120e3c79c45e1c92a (patch) | |
| tree | 10e512fc5bca08cc20ad593ef70c9c6d85fba125 /core/undo_redo.h | |
| parent | 56fa741b7a729bd5a00cff17e4382af547de92ad (diff) | |
| download | redot-engine-debf574df35caf8e0880b65120e3c79c45e1c92a.tar.gz | |
Implemented UndoRedo mergeable modes
Diffstat (limited to 'core/undo_redo.h')
| -rw-r--r-- | core/undo_redo.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/undo_redo.h b/core/undo_redo.h index 7f63ba9ed6..208eb6ed5e 100644 --- a/core/undo_redo.h +++ b/core/undo_redo.h @@ -41,6 +41,12 @@ class UndoRedo : public Object { OBJ_SAVE_TYPE( UndoRedo ); public: + enum MergeMode { + MERGE_DISABLE, + MERGE_ENDS, + MERGE_ALL + }; + typedef void (*CommitNotifyCallback)(void *p_ud,const String& p_name); Variant _add_do_method(const Variant** p_args, int p_argcount, Variant::CallError& r_error); Variant _add_undo_method(const Variant** p_args, int p_argcount, Variant::CallError& r_error); @@ -76,7 +82,7 @@ private: int current_action; int action_level; int max_steps; - bool merging; + MergeMode merge_mode; uint64_t version; void _pop_history_tail(); @@ -98,7 +104,7 @@ protected: public: - void create_action(const String& p_name="",bool p_mergeable=false); + void create_action(const String& p_name="",MergeMode p_mode=MERGE_DISABLE); void add_do_method(Object *p_object,const String& p_method,VARIANT_ARG_LIST); void add_undo_method(Object *p_object,const String& p_method,VARIANT_ARG_LIST); @@ -128,4 +134,6 @@ public: ~UndoRedo(); }; +VARIANT_ENUM_CAST( UndoRedo::MergeMode ); + #endif // UNDO_REDO_H |
