Thread: Pref files
View Single Post
Old August 9, 2011, 00:42   #7
Max Stats
Swordsman
 
Join Date: Jun 2010
Posts: 324
Max Stats is on a distinguished road
Quote:
Originally Posted by relic View Post
I started a new character in 3.3.0, changed options as I want them, and saved them. In order to get these options for all characters, I figured that I would name the file something that would be loaded by Angband at startup, you know like it used to do.
There are two pref files that are loaded by default for all players: user.prf and pref.prf. However, the pref file loading code looks for pref files first in the lib/pref directory before trying the user pref directory. Since both of these files ship with the distribution, they will be found in lib/pref and even if you save your prefs to one of these names, they won't load. AFAIK, there are no other global pref filenames. Unless this has changed in 3.3, you can use a class name as a pref filename (Warrior.prf, Mage.prf, etc.) and it will be loaded every time you play a character of that class, but that is about the best you can do.

If you want global pref settings, I can think of three options:
  • Modify process_some_user_pref_files in dungeon.c and add a call to process_pref_file with a static filename of your choosing (like global.prf).
  • Save your options to a new file and copy the relevant lines into user.prf in your lib/pref directory.
  • Bug the maintainers to add a new global user pref filename (or open a ticket requesting it).
Max Stats is offline   Reply With Quote