A few months back I started on a complete re-write on the UI system.
For the most part it is complete, uses less resources and is more responsive and flexible in design.
The first major hurdle was the creation of and management of a simple database of UI forms.
While this system is now in place and functioning correctly, it is possible that the render and processing systems are using the database incorrectly, as they both need to transverse the database from different angles.
Another and the primary issue at the moment is the processing of the UI forms themselves.
The current implementation handles the entire UI processing in a single function.
While this was a practical solution to begin with, its size and complexity has evolved into a difficult to manage function. Whilst thinking about it further this evening, I came to the logical conclusion that I have to break it down into smaller more manageable pieces in order to have code that is easily manageable in the future.
I am still contemplating the exact approach I will take. Either have the main processing function call smaller functions, or create "code blocks" within the function and label them appropriately.