The way I was handling undo/redo and tools in Fudge was not good. Not only were they totally divergent, they couldn't affect other important areas of Fudge or access relevant information about the program's general state. To fix these problems, I totally revamped the extension API, which is used by both aforementioned features.
I created a new state manager interface that is implemented only by the main form (instead of going through a whole bunch of lambdas). There are now separate objects for level generation and the view state. It took quite a while to go through and adjust the tools to use the view state object, but the fine-grained control made things a lot faster. The undo/redo API was massively simplified because the system of returning a list of visual updates has been removed. It is now fully up to the action manager to fire the updates - through the nice state manager.
All that made Fudge amazingly easier to think about. I've also started work on an attribute-based event bus system for letting extensions be more involved in creation of resources. The tool and renderer registrars will probably be moved over to that. Finally, to allow persistent configuration, both in program and file scope, XML components are exposed to extensions. Serialized document trees are stored in a "persist.fconf" file for general config and inside the .fudge file for file-specific config.
No comments:
Post a Comment