Why must you do this to me, WhenMouseLeave / WhenMouseEnter / IsUnderMouse? These methods are extremely hard to get perfect. And even when you think you are done, you get a popup window out of nowhere that does not notify you of a mouse move event or the OS does something strange with the mouse and you are left dangling. Anyway, I solved most of these.
I also solved a huge yet elusive bug, that only happened once the widget nesting reached a depth of over four. It took me hours to find and solve this bug. But everything is starting to come together. The new GUI system is not only a lot more stable and mature when compared to yesterday, but it is also more feature rich. So I removed the old action bar in favor of the new only (but I only commented the code out).
I also made animations a little more FPS agnostic. It is not perfect yet, because the resolution of the timer I am using is not high enough, but it is a big step in the right direction.
Since the bug fixing took me such an extended period of time, in today's post I will only talk about two topics.
Pause screen effect
I added a full screen effect when you pause the game, to differentiate between the two states. The screen becomes darker. But then I realized that this is an idiotic change since the game remains interactive in pause mode. To add insult to injury, I mark selected cells by making them darker. So I restricted this effect to when you you have full pause, like when a dialog pops up. I will signal normal pause some other way, probably by a blinking play button. Here is a sample:
You can see here the new action bar too. The three letter labels will be replaced with suggestive icons. No, not that kind of suggestions!
The question is how does one make such an effect. There are multiple ways, so I chose the fastest and easiest method, which literally took me three lines of code. It is a known fact that drawing something with transparency is slower than without. It is less known that colorizing can also share these properties. Depending on the hardware/rendering mode combination, I saw anywhere from better to 3-4 times worse performance when doing colorization. It is particularly bad with software rendering. So this effect could be improved.
I am not going to add a possibly disastrous rendering mode without making it optional, am I? This leads me well to my next topic.
In game options dialog
See the small button in the lower left corner of the screen? Pressing this bring up the following dialog:
The layout is a little bit rough around the edges, but this is a full featured dialog, with current quality standards (i.e. it opens up with a small animation and buttons enable and disable properly based on the values entered in the dialog).
The first option enables or disables the above mentioned pause effect. It is enabled by default.
The second option controls Super Special Rendering. It is enabled by default. But what could this option be? Foreshadowing!!! FORRREEEESHADOWING!
The third option controls the number of Z levels that will be rendered, the fourth the rendering of half height/full height walls and the fifth the rendering of wall borders.
Then we have three numeric values that can be altered. Speed is the speed of the time compression algorithm. This will allow you to fine tune the speed if you are not happy with the default of 6. Values range from 1 to 12. Zoom controls the three zoom levels that you are already accustomed to seeing. And finally we have cycle, that is related to the in game cycle clock. It is the scheduling "FPS", or more correctly the delay. This option is more for me than for the potential player, and it might not make the final product. Values are from 0 to 30.
And finally the small button in the corner, that unceremoniously closes this option panel (read: without animation).