DevBlog #3: Refactoriiiiing

This evil word … refactoring. People wan’t to see progress and not some nice and clean code, but those two things are very strongly connected: There’ll be less progress when the code is obfuscated, complicated and hacky. Unfortunately clean code becomes hacky and unnecessary complicated all by itself 🙁 … no really, sometimes it just feels like good code is changing itself into bad code …

Nearly one month ago (27th of may) I started a huge refactoring of the whole UI system I wrote in the early days of METRO. Unfortunately it was not build to handle a great amount of UI elements in a smart way. I’m currently changing everything in this package and make things less bad. This also includes the way you interact with UI elements which is sometimes a bit … tricky and buggy.

tl;dr – Rewriting the UI system. Will take some time.

More Details

The old system was build around a class called ControlActionManager. This class holds all controls (buttons, input fields, labels, …) and manages interactions like clicks and key presses. It also drawed all controls.
The problem was that there were windows which controls are always above others, which should not get interaction events.

Continue reading