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

Lack of Undo/Redo functionality #8

Closed
OverloadedOrama opened this issue Sep 27, 2019 · 4 comments
Closed

Lack of Undo/Redo functionality #8

OverloadedOrama opened this issue Sep 27, 2019 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@OverloadedOrama
Copy link
Member

I tried implementing an undo/redo system which worked, until I implemented the layer system. I gave up on it ever since so I could focus on adding new features, but it is a vital feature to have. And now that there are so many features compared to the past, it's going to be even harder. Any help would be appreciated, whether it's just ideas of what to do or even pull requests.

@OverloadedOrama OverloadedOrama added help wanted Extra attention is needed enhancement New feature or request labels Sep 27, 2019
@OverloadedOrama
Copy link
Member Author

Started working on it as of 7b8c6bb. I use Godot's UndoRedo class so it can be (theoretically) more easily ported as a plug-in in the future. Check the commit description for more details.

@OverloadedOrama
Copy link
Member Author

Closing this issue as Pixelorama now has a functioning UndoRedo system as of 40e0978. It could use some improvements, such as maybe it could take into account actions such as layer/frame adding/removing/cloning/moving/etc, button presses and all that. Right now it mostly deals with drawing itself, and edit menu tools like cropping, scaling, flipping. Feel free to open another issue or do pull requests if you'd like to see improvements.

I also hope it'll work if Pixelorama is ever to be ported as a Godot plug-in. If you encounter bugs, you can open a new issue or do pull requests.

@OverloadedOrama
Copy link
Member Author

OverloadedOrama commented Nov 7, 2019

Re-opening this because I realized that if layer and frame adding/removing/cloning/moving/etc don't have UndoRedo, it will lead to weird results. Now, I have successfully managed to implement this functionality for layers (ec7b212), but frames are harder, because it deals with creating new canvas instances and them freeing them from memory. Since it is impossible to access a node that has been deleted, I can't just "undo" a frame removal. The solution could be hidden behind these "add_do_reference()" and "add_undo_reference()" methods, but I find the documentation lacking on these, and I couldn't find any examples on how they are used.

I have some ideas for workarounds, and hopefully I'll commit them in the next few days. Otherwise if anyone is adventurous enough to give it a shot, go ahead!

@OverloadedOrama
Copy link
Member Author

All right, issue should be resolved as of e825cc0.

OverloadedOrama pushed a commit that referenced this issue Dec 18, 2019
Removed "Main Theme" from FrameButton.tscn and LayerContainer.tscn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant