Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo functionality #184

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from
Draft

Undo functionality #184

wants to merge 25 commits into from

Conversation

griffi-gh
Copy link
Contributor

@griffi-gh griffi-gh commented Oct 15, 2024

Experimental undo functionality, needs testing

closes #139


TODO (in rough order of importance):

  • Reset undo stack when loading another level
  • In-memory compression (large levels can create ~10mb of data per undo step without it)
    • Asynchronous compression using a background worker thread
    • Incremental snapshots (since changes are minimal, find a way to compress just the deltas)
  • Fix icon visibility
    • Only show while in sandbox mode
    • Gray out if nothing to undo
  • Add checkpoints on events:
    • Object created
    • Connect/disconnect
      • "Connect all" shortcut (Shift+E)
      • "Connect" shortcut (the F key)
      • Connect (only using the ui button)
      • Inter-layer connect (only using the ui buttons)
      • Disconnect
        • (ui button)
        • (Disconnect shortcut?)
    • Object moved
    • Object props changes?
    • Pasted partial
    • Deleted object
    • (Lock/unlock object?)
    • Change layer
  • Redo (keep data when undoing for restore)
  • Keyboard shortcut (ctrl+z)
  • Better undo icon (current one doesn't fit in)
  • Performance, check and try to improve it if needed (possible stutters on checkpoints!)
    • Currently takes up to ~50ms to save a snapshot of a decently sized level on my PC

Etc:

  • Should level properties be undone/preserved as well?
    • (currently they are undone as well as object changes, since im saving the entire level data to ram)

@griffi-gh griffi-gh changed the title Undo functionality (experimental) Undo functionality Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undo functionality
1 participant