As the title suggests, I got the minimap to work (more) properly. The minimap viewport rectangle is a bit off still, but at least it gives you a general impression of which part of the map you're looking at.
Instead of doing one pixel per tile I just made a map of very small tiles, like this: (isn't that cute?), and palette-shifted them to match the given terraintype. This would be tedious to render every frame, of course, so when a tile is changed it just gets drawn over individually -- there's no overlapping in the minimap like there is on the gamemap, so I can get away with it. (Which leads me to thinking that it'd be a good idea to draw Terrain/TerrainQuads and TerrainEffects to a single layer that's updated on-demand rather than every frame because I could totally get away with it!)
Oh, here's the screenshot:
Easy. Only an order of magnitude more difficult than I first thought it was going to be, which is quite good in the business of coding. I hear. Of course, to get an image element in the GUI to update based on changes in a random class without doing a bunch of stupid hacking was the real problem, which brings us to ...
I modified GUI ImageElements and TextElements to accept a class that I'm calling "DynamicVariable" which can be defined in a GUI definition text file. So take the minimap as an example: It's given a target + varname, eg. "isomap","minimap", then it creates a link to a DynamicVariableCache in the class identified by the Relay as "isomap" and it updates from the variable labled "minimap" in said cache. Got that? Point is, it's more robust than before. A DynamicVariable will try to establish a link each update until it works, so order of creation is not an issue. (Now I just have to make sure that it can handle its link being broken and re-established with a different instance of the same object, though the situation has not come up in which this takes place.)
The GUI is coming together. I think I need to be able to minimize and move the minimap and do some other options on it ...
Yeah, this was what I planned to be the next step today except I kinda balked at the prospect. I don't think that I have ever written files with Python before I wrote a little test this afternoon, so it's .. interesting and surprisingly easy -- when it's simple. And my maps are not. Marcel gave me some good advice on how to approach the problem (thanks!), so I think that I know where to start now.
Un(?)fortunately it really makes me want to refactor my isomap and isotile code now that I see what a mess they are in trying to sort how how to write them to file. Consider that all TODO. ... then once I've got THOSE working, I can start on gameplay ... or polish up the GUI more.. and then .. And so on with the putting off gameplay coding. Honestly, it's not my fault that I want everything working, it simply must. I swear, something will be happening by the end of January.
Speaking of January, I'm going to try to pick up some more graphic/design 'clients' then -- Need something to replace your programmer art with - at reasonable rates? Drop me a line!
I won't be doing MWF updates next week, possibly not until after the new year, 'cause ... you know, holidays! Let me just say "Have a Happy Fun Time" to everyone reading this.
'Til next time!