Feature: Undo
- setup empty
undo[]
array - setup
currentUndo
index value - when
.save()
is called, snapshot thetiles[]
array and unshift it ontoundo[]
; updatecurrentUndo = 0
- when
ctrl+z
is fired, updatethis.currentUndo += 1
; assignthis.tiles = this.undo[this.currentUndo]
- when
ctrl+shift+z
is fired, updatethis.currentUndo -= 1
; assignthis.tiles = this.undo[this.currentUndo]
Notes:
- need a macro for
undoAction(direction)
wheredirection = +-1
=====