Game Development Community

Prefs.cs files always get overwritten

by Sam Bloomquist · in Technical Issues · 03/17/2006 (12:58 am) · 3 replies

I've been implementing the cel shading outline code from http://tdn.garagegames.com/wiki/WorldBuilding/Visual_Style/Cel_Shading/ and it seems to be working except that every time I start the game up and exit, my client/prefs.cs file gets overwritten, losing the following necessary prefs:

$pref::renderOutline = "true";
$pref::outlineWidth = "3";

Anyone know of a way to keep new prefs like this around?

About the author

Recent Threads


#1
03/17/2006 (2:04 am)
Either remove the line that saves the prefs(not recommended unless you have specific settings you want to never change) or make sure the prefs are loaded into memory before the file is saved. Those prefs should be saved with the others.
#2
03/17/2006 (3:44 am)
The initial prefs come from defaults.cs, prefs.cs is written out every time because it's providing end user preferences, not developer preferences. If you have prefs you need to add, add them to defaults.cs and then delete all your prefs.cs files to ensure they update. You should never edit prefs.cs files unless you're actually changing a pref that isnt available in the GUI in the same way an end user would.

Note that for keybinds, the defaults are in default.bind.cs and are written out to config.cs. Same as above applies.

When following a resource that says "edit your prefs.cs files" or "edit your config.cs files" ignore it, it's bad advice. Edit only the correct defaults file and then delete your prefs/config files.

T.
#3
03/17/2006 (1:18 pm)
Good to know, Tom. Thanks a lot.