hpeinar / planner_v3

A new version of stardew planner.
17 stars 1 forks source link

[FEATURE] - Implement history #11

Open hpeinar opened 1 year ago

hpeinar commented 1 year ago

Describe your idea / feature / improvement Planner should have a (local) history so it would be easy to undo / redo changes.

Describe the solution you'd like There could be undo / redo buttons (and keyboard shortcuts) to offer well known functionality.

Additional context Technical solution still needs figuring out, probably need to limit the size of the history as well. There are pretty much two ways to implement this:

  1. Snapshotting - essentially every change on the planner would generate a snapshot held in memory which can be then reloaded
  2. Reverse-action - Every action done would have reverse action, which can be executed to undo something. ie. when placing a building, reverse action would be to remove the building. When moving the building, reverse action would be putting it back in the previous place.

Latter is much more performant, but is a lot more complex to implement.