From: Elias P. <el...@us...> - 2005-07-29 21:19:44
|
On Fri, 2005-07-29 at 13:02 -0700, chr...@gm... wrote: > On Friday 29 July 2005 06:17 am, Elias Pschernig wrote: > > Game is compiled for a debian distribution, so game data reside > > in /usr/share/game-name/, global configuration in /etc/game-name/, and > > per-user configuration in ~/.game-name/. > > I think we can, currently, leave it to the programmer to worry about where the > game data is stored, and just worry about default game data paths as > something to do in 4.3. > > About the /etc/game-name/ and ~/.game-name/ paths for the config file, I do > still think that the set_config_file function should just override the name, > not the search path. I don't remember what was decided on before, if > anything, and I'm still new to KMail and haven't been able to go back in this > thread to see. > > But one thing to note, is that for all the programs I've run across in Linux, > the program never ever alters the config in /etc/game-name/. It will read the > config in /etc/game-name/, but all changes will go in ~/.game-name/. I've yet > to figure out how to use one config file to read default values from, > override those values with a custom/user config, and have changes go in the > override file. Everytime I've tried override_config_file, it's not done > this.. though I suppose I just could've been doing it wrong. > It's not very intuitive since everything had to stay compatible.. it should work like this: set_config_file("/etc/game-name/my.cfg") override_config_file($(HOME) + "/.game-name/my.cfg") // however you actually read HOME.. get_config_string(...) // will try first the one in home, then the other set_config_string(...) // will always use the one in home If it doesn't work, it's most likely a bug.. And the real problem is of course how it is not platform independent, but as we said, changing that is too much for 4.2.0 at this point.. -- Elias Pschernig |