Interrupt / delverengine

Delver game engine and editor
zlib License
794 stars 79 forks source link

Adjusting Entity Fields Does Not Add to Editor History #273

Open joshuaskelly opened 2 years ago

joshuaskelly commented 2 years ago

Summary

Editing entity properties does not get recorded and does not allow undo/redo. This will likely require changes to PropertiesMenu.java to save history when fields are changed.

PythooonUser commented 2 years ago

Started working on this! 🎉

PythooonUser commented 2 years ago

One problem I faced is that the properties menu hides when performing an undo action. In case you made a change to an entity field and the entity still exists after the undo action, I want the properties menu to stay open and simply refresh.

The issue here is that we are deserializing the level anew, therefore, the entity before and after the undo action is not the same anymore.

We need some way to establish equality of entities. Is there a way to introduce a unique hash? Obviously, after the undo action at least one field value is different between them.