cambridge-alpha-team / unvisual-frontend

This is the frontend part for the unvisual project
1 stars 0 forks source link

Undo and redo added #55

Closed Psyclone150 closed 9 years ago

Psyclone150 commented 9 years ago

Fixes issue #14. The user can press Ctrl+Z for undo and Ctrl+Y for redo. Also fixes a bug related to binding cubelets. Does not impose a hard limit on the number of actions that may be remembered. Any opinions on what would be a sensible limit?

tjvr commented 9 years ago

Please remove commented code (example) and console.log(…) statements.

LauraneS commented 9 years ago

The undo command seems to work fine for me, but whenever I try to redo something, it displays "there is nothing to redo."

Also, when there is nothing to undo anymore, the error displayed is pretty confusing: "ERROR: The currently selected piece of code is not recognised as a child by its parent."

Psyclone150 commented 9 years ago

@blob8108 Sorry, I overlooked those. They're gone now. @LauraneS Could you please describe exactly what you did that caused those effects? Undo and redo both worked fine in the cases I tested (which included adding and deleting multiple nodes, changing values and assigning cubelets).

Psyclone150 commented 9 years ago

Actually I bet there'll be a bug related to adding/deleting fx nodes because of reparenting of child nodes. That will be non-trivial to fix. Shall I work on it as part of this pull request, or simply disable that for now (should be quicker) and work on that issue afterwards in a separate pull request?

RusticFlare commented 9 years ago

change reGenerate to regenerate and fix the bug when redoing fx

RusticFlare commented 9 years ago

If I create an fx then press ctrl+z to undo, then press ctrl+y to redo then when I try to select the second item in the fx (third if you count the fx name) then it jumps up a level in the tree. This is causing other issues with adding and deleting code inside remade fx's. It will also read out "0 of 1" selected when it should read "2 of X".

Psyclone150 commented 9 years ago

Does it work now?

RusticFlare commented 9 years ago

Seems good to me. I'm going to work on the conflicts.