diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-06-26 20:57:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-26 20:57:39 +0200 |
commit | f036353b93269e1162437f188f6792f3953ac155 (patch) | |
tree | d07d0dea2a5fd07b62a1bade2235ede65e795483 /editor/plugins/tile_map_editor_plugin.h | |
parent | c8617565d84d69b1966878debe61b4c712750780 (diff) | |
parent | cadd72793b8d9c21d0b70bdef6427125fd008a40 (diff) |
Merge pull request #19164 from marcelofg55/tilemap_undo2
Improve TileMap undo operations, second try
Diffstat (limited to 'editor/plugins/tile_map_editor_plugin.h')
-rw-r--r-- | editor/plugins/tile_map_editor_plugin.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h index a1f5d93a8d..77e9a33892 100644 --- a/editor/plugins/tile_map_editor_plugin.h +++ b/editor/plugins/tile_map_editor_plugin.h @@ -129,6 +129,7 @@ class TileMapEditor : public VBoxContainer { bool xf; bool yf; bool tr; + Vector2 ac; CellOp() : idx(TileMap::INVALID_CELL), @@ -155,6 +156,8 @@ class TileMapEditor : public VBoxContainer { List<TileData> copydata; + Map<Point2i, CellOp> undo_data; + void _pick_tile(const Point2 &p_pos); PoolVector<Vector2> _bucket_fill(const Point2i &p_start, bool erase = false, bool preview = false); @@ -181,6 +184,9 @@ class TileMapEditor : public VBoxContainer { void _menu_option(int p_option); void _palette_selected(int index); + void _start_undo(const String &p_action); + void _finish_undo(); + void _create_set_cell_undo(const Vector2 &p_vec, const CellOp &p_cell_old, const CellOp &p_cell_new); void _set_cell(const Point2i &p_pos, int p_value, bool p_flip_h = false, bool p_flip_v = false, bool p_transpose = false); void _canvas_mouse_enter(); |