aboutsummaryrefslogtreecommitdiff
path: root/Buildscr
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2017-11-18 19:54:10 +0000
committerSimon Tatham <anakin@pobox.com>2017-11-18 20:08:34 +0000
commitee8ea9b9785964694cb2b3ad77c3fb2460f49510 (patch)
tree58c8e0b2ecd9ed076e51821ae7af7fd031d92f71 /Buildscr
parente2514a72e6c8d0269264d75d58186875cc5c027c (diff)
downloadpuzzles-ee8ea9b9785964694cb2b3ad77c3fb2460f49510.zip
puzzles-ee8ea9b9785964694cb2b3ad77c3fb2460f49510.tar.gz
puzzles-ee8ea9b9785964694cb2b3ad77c3fb2460f49510.tar.bz2
puzzles-ee8ea9b9785964694cb2b3ad77c3fb2460f49510.tar.xz
Permit redoing past an undone New Game action.
Now, when we undo a New Game by deserialising the stored version of the previous game, we start by serialising the _current_ game into a second serialisation buffer in the midend. Then, if the user tries to redo back past that undo action, we can re-serialise the earlier game and re-deserialise the newer one. A few users had complained (with various degrees of politeness) at the lack of this ability, because in true xkcd #1172 style, it broke their workflow. Specifically, if you were a fan of holding down 'u' to undo all the way back to the start of your current game, you'd have overshot into the previous game and then have no way to return to the game you wanted to be at the start of. This slightly changes the previous interaction of Redo with New Game. Previously, New Game would save the entire undo chain of the serialised game, including anything forward of the current position; so if you took actions move1,move2,undo,newgame then the serialised game state would include both move1 and move2 with the current position between them; hence, an undo would restore the old game to a position just after move1, and then a redo action would re-enact move2. Now, midend_purge_states is called before serialising the old game, so in that scenario move2 would be completely lost as a side effect of the new-game action. (Just as it would be if you made any _other_ undoable move in that situation.) Conversely, making a move in the old game after you've undone back into it will now wipe out the record of the later game, so you can't redo into it any more.
Diffstat (limited to 'Buildscr')
0 files changed, 0 insertions, 0 deletions