Monday, March 10, 2014

FMod - Slightly More Extensible Config

I determined that my previous strategy of having normal defaults in the general config file be copied to the local config was implemented poorly. The way I was doing it, I needed to have a separate instruction for each piece of information that needed to be copied. If I needed to add one, I would have to add at least three lines of code.

So, I changed how default config for profiles is stored. There is now one entry that contains a list of paths for the local config file and their default values. It looks something like this:

Core/InfoplaneTileCount=72;Core/MapEdge=76;Core/EnablePaths=False

Basically, it's paris of ConfigHelper paths and values, separated by semicolons. This works very well and is extensible - just add any entry to the profile config and it will be copied to the local config, no questions asked.

No comments:

Post a Comment