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

Extending Undo Functionality #157

Closed
elmodor opened this issue Dec 2, 2022 · 0 comments
Closed

Extending Undo Functionality #157

elmodor opened this issue Dec 2, 2022 · 0 comments
Assignees
Labels
feature New feature or request
Milestone

Comments

@elmodor
Copy link
Contributor

elmodor commented Dec 2, 2022

Is your feature request related to a problem? Please describe.
Currently an undo state is created for:

  • Adding a piece
  • Removing a piece
  • Flipping table

When you play a pre-setup boardgame you usually don't spawn in or remove any pieces. The game is already setup and you just play.
In this case no new undo states are created.
Sure we have the autosave functionality but it seems kind of a waste if the undo functionality is not usable. Even after 20 minutes of playing you could hit "undo" and end up at the start of the game.

Describe the solution you'd like
Adding undo states for more actions:

  • Starting to hover a piece
  • Adding/removing piece from container

Timeouts could be set to like 1-3min each?

Also the hand state should be included in the undo states. It is never included currently - so using undo will ignore the hand cards?

Describe alternatives you've considered
Using autosaves instead. However, the undo functionality seems only half implemented this way (to me).

@drwhut drwhut added the feature New feature or request label Dec 6, 2022
@drwhut drwhut added this to the v0.1.0 milestone Dec 6, 2022
@drwhut drwhut self-assigned this Dec 6, 2022
drwhut added a commit that referenced this issue Dec 8, 2022
Functionally, nothing should be different.

- push_undo_state now takes an additional argument, 'func_name', which
automatically checks the timeout for that function.

- Functions have been made to disable and enable the creation of undo
states. This should account for multiple calls within a call stack.

- Instead of storing timers which count down every physics frame,
OS.get_ticks_ms() is used to store the last time at which a function was
called.
@drwhut drwhut closed this as completed in 3134b0b Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants