– Add basic scenario list to main menu (WiP)
– Make the scroll button ratio for the dynamic row container .. dynamic as well
– Fix container-in-container case in the dynamic row container
– Always re-calculate the visible child indices when clearing and adding child elements
– Enforce a 16:9 ratio to make UI elements draw more predictably
Relates to #86
Hi! It has been quite some time since the last commit/post, this is mostly due to two factors: I was quite a bit distracted in my free time and, as always, working on UI code tends to get somewhat messy.
While the first factor was definitely a big one, it was worth noting that I stumbled over quite a few issues, which can be seen by the sheer number of separate issues addressed in this commit. The biggest ones of these were definitely certain shortcomings in the DynamicRowContainer class, so far mostly used in the very specific use case in the main content area on the right hand side .
While that in itself is no problem, it also made me do some assumptions about how to scale some things – also it was not the most dynamic (there is a certain irony given the name of the class) use case. The biggest and by far most frustrating problem was the missing support for having containers as child elements in the dynamic containers.
This was no issue when a simple non-container element was used (like the buttons when buying an object), however when a container was used instead, the reported number of active widgets and the amount of model data did no longer match, as fetching the actual model data in fact did work as expected.
The fact that these two numbers much however is one of the assumptions made by the renderer to determine if it can already draw the UI or if it has to wait until the synchronisation from the main thread (which will modify the UI data) to the render thread (which takes the provided data and turns it into something that can be shown on screen using Vulkan) is done. In this case, the synchronisation was already done, it simply didn’t return all the element it should have, leaving the renderer to draw no UI.
To make this extra frustrating, while in menu mode, there is nothing but UI, leaving me with a blank black screen. The issue it self once identified was fixed withing minutes, tracking it down however lead me on a wild goose chase of dead ends. Oh well.
This very bare bones list is the result of all that, please also note that OLives now enforces a 16:9 screen ratio, as the number of UI issues arising from this being freely changeable were simply too many.
The selection is not done yet, I’m not quite sure how much information about each scenario to show here (besides simply the title, as it is the case now). It is also still very much work in progress as there are some remaining issues that need to be ironed out. Feels good to finally have something worth committing again.
So until next time, definitely not with such a big gap in between. Byeeee 🙂