GrogHeads Forum

Grog Friends and Affiliates => General Staff Support Forum => Army Editor Tech Support => Topic started by: Mickey3D on August 17, 2018, 04:02:59 PM

Title: Undo
Post by: Mickey3D on August 17, 2018, 04:02:59 PM
What about an "Undo" feature to rollback the latest action in case of error ?
Title: Re: Undo
Post by: Andy ONeill on August 18, 2018, 03:52:45 AM
Changes aren't persisted to disk until you choose save.
If you make a mistake you can "just" not save.

The problem with undo is identifying when something changes.
eg
As you type, a...b...c in the name box each letter changes something in memory.
Except you probably don't want to undo just that last letter.

Title: Re: Undo
Post by: Mickey3D on August 18, 2018, 05:10:07 AM
I understand the challenge of creating an undo feature but the option to reload the file from disk is not always sufficient : imagine you have worked for 15 minutes without saving  :'(

I think the "command" pattern can be used to implement the undo :
https://en.wikipedia.org/wiki/Command_pattern (https://en.wikipedia.org/wiki/Command_pattern)
https://www.codeproject.com/Articles/33384/Multilevel-Undo-and-Redo-Implementation-in-Cshar-2 (https://www.codeproject.com/Articles/33384/Multilevel-Undo-and-Redo-Implementation-in-Cshar-2)
https://matt.berther.io/2004/09/16/using-the-command-pattern-for-undo-functionality/ (https://matt.berther.io/2004/09/16/using-the-command-pattern-for-undo-functionality/)

But I agree that the "undo" is only a nice to have and people can work without it.