CnCNet / WorldAlteringEditor

Map editor for C&C: Red Alert 2, C&C: Tiberian Sun and Dawn of the Tiberium Age.
Other
76 stars 25 forks source link

Undo Many Events At Once #204

Open Rampastring opened 1 week ago

Rampastring commented 1 week ago

Currently, undo/redo is strictly event based. Each time you Undo, only one event is undone. Sometimes it would be desirable to undo a larger amount of events at once.

For example, if you paint or alter the height of a large chunk of tiles at once by drag-painting on the map, you might want to undo the whole drag-paint in case you messed up with it. Drag-painting can generate several, or in the worst case, even dozens of events per second. Undoing such a sequence of events currently can take an annoyingly high amount of time due to requiring several presses of Undo to undo the whole drag-sequence.

For this, events could probably contain an event ID or time field when they were performed, and pressing Undo would not only undo the latest event, but all events with the same ID, or recursively, all events of the same type that have been performed within X seconds of the latest event.