I can get pretty OCD when I'm writing code. I've resisted the urge to
reformat everything so {'s are on their own line (where they
belong!! :) ) but every time I try to attack the GUI code, I find
myself in Configuration.pde, poking at that. So, I've embraced my
madness and attacked Configuration.pde instead.
The short story is that I've prototyped a version where Configuration
now only contains a Hashtable of settings. Load() and Save() no longer
know anything about various settings - Load() just sucks in whatever
happens to be in the config file into the hash table and Save() just
dumps whatever's in the hash table back out to the config.txt file.
Upsides are that this allows the trimming down of the number of
globals and that it lets new code get access to persistant storage
without having to poke at configuration.pde. Though I haven't done
anything like this yet, I think it'll also make it easier to move to
some sort of hierarchacal storage with multiple configs and maybe
rhyming a lot with XML.
Downside is that it's a bit of a wide-spread change and that it's not
quite as easy to use.. EG: a global "string SomeVar" can today just be
accessed and set via it's name from anywhere in the code. With my
changes, you'd have to do something like 'string x = config.String
("SomeVar");' to get it and 'config.Set ("SomeVar", val);' to set it.
> Any objections to this?
Same question as before!
> > - Show quoted text -- Hide quoted text -