You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently trying to build some kind of animation system alongside my game.
What I want to do is, declare some kind of animation state inside my game state and make each clients UI react to the animation respectively.
However this concept will somewhat clash with Undo, because the animation state will also be set to the last animation state and therefore trigger the animation again (which does not really make sense, when a move has just been undone).
First I thought of mutating the state from my react-ui and clearing the animation property whenever an undo happens, but that feels a) needlessly complicated and b) might trigger addiotional re-renders I don't want.
Now to the solution I'd prefer, but which currently seems not to be possible:
The cleanest way to achieve something like this, would be writing a plugin, which simply wraps undo.
So that when a move is being undone, we modify the state accordingly, remove the animation-declaration and set a new state, instead of the old one.
Is there already a way to build a middleware like this (the current plugin system does not seem to support such a use case) and if not would you be willing to accept PRs in that regard? Or do you have a better idea how I could solve this use case?
Thanks in advance
The text was updated successfully, but these errors were encountered:
Hey,
I am currently trying to build some kind of animation system alongside my game.
What I want to do is, declare some kind of animation state inside my game state and make each clients UI react to the animation respectively.
However this concept will somewhat clash with Undo, because the animation state will also be set to the last animation state and therefore trigger the animation again (which does not really make sense, when a move has just been undone).
First I thought of mutating the state from my react-ui and clearing the animation property whenever an undo happens, but that feels a) needlessly complicated and b) might trigger addiotional re-renders I don't want.
Now to the solution I'd prefer, but which currently seems not to be possible:
The cleanest way to achieve something like this, would be writing a plugin, which simply wraps undo.
So that when a move is being undone, we modify the state accordingly, remove the animation-declaration and set a new state, instead of the old one.
Is there already a way to build a middleware like this (the current plugin system does not seem to support such a use case) and if not would you be willing to accept PRs in that regard? Or do you have a better idea how I could solve this use case?
Thanks in advance
The text was updated successfully, but these errors were encountered: