src/ui-prefs.c
bool process_pref_file(const char *name, bool quiet, bool user)
{
	bool root_success = FALSE;
	bool user_success = FALSE;
	bool used_fallback = FALSE;

	/* This supports the old behavior: look for a file first in 'pref/', and
	 * if not found there, then 'user/'. */
	root_success = process_pref_file_layered(name, quiet, user,
											 ANGBAND_DIR_CUSTOMIZE,
											 ANGBAND_DIR_USER,
											 &used_fallback);

	/* If not found, do a check of the current graphics directory */
	if (!root_success && current_graphics_mode)
		root_success = process_pref_file_layered(name, quiet, user,
												 current_graphics_mode->path,
												 NULL, NULL);

	/* Next, we want to force a check for the file in the user/ directory.
	 * However, since we used the user directory as a fallback in the previous
	 * check, we only want to do this if the fallback wasn't used. This cuts
	 * down on unnecessary parsing. */
	if (!used_fallback) {
		/* Force quiet (since this is an optional file) and force user
		 * (since this should always be considered user-specific). */
		user_success = process_pref_file_layered(name, TRUE, TRUE,
												 ANGBAND_DIR_USER, NULL,
												 &used_fallback);
	}

	/* If only one load was successful, that's okay; we loaded something. */
	return root_success || user_success;
}
/**
 * Look for a pref file at its base location (falling back to another path if
 * needed) and then in the user location. This effectively will layer a user
 * pref file on top of a default pref file.
 *
 * Because of the way this function works, there might be some unexpected
 * effects when a pref file triggers another pref file to be loaded.
 * For example, pref/pref.prf causes message.prf to load. This means that the
 * game will load pref/pref.prf, then pref/message.prf, then user/message.prf,
 * and finally user/pref.prf.
 *
 * \param name is the name of the pref file.
 * \param quiet means "don't complain about not finding the file".
 * \param user should be TRUE if the pref file is user-specific and not a game
 * default.
 * \returns TRUE if everything worked OK, FALSE otherwise.
 */
Look for a pref file at its base location (falling back to another path if
needed) and then in the user location. This effectively will layer a user
pref file on top of a default pref file.

Because of the way this function works, there might be some unexpected
effects when a pref file triggers another pref file to be loaded.

\param name is the name of the pref file.
\param quiet means "don't complain about not finding the file".
\param user should be TRUE if the pref file is user-specific and not a game
default.
\returns TRUE if everything worked OK, FALSE otherwise.
Look for a pref file at its base location ( falling back to another path if needed ) and then in the user location . This effectively will layer a user pref file on top of a default pref file . Because of the way this function works there might be some unexpected effects when a pref file triggers another pref file to be loaded . \ param name is the name of the pref file . \ param quiet means " don ' t complain about not finding the file " . \ param user should be TRUE if the pref file is user - specific and not a game default . \ returns TRUE if everything worked OK FALSE otherwise .
bool process_pref_file(const char *name, bool quiet, bool user)
{
	bool root_success = FALSE;
	bool user_success = FALSE;
	bool used_fallback = FALSE;
	root_success = process_pref_file_layered(name, quiet, user,
											 ANGBAND_DIR_CUSTOMIZE,
											 ANGBAND_DIR_USER,
											 &used_fallback);
	if (!root_success && current_graphics_mode)
		root_success = process_pref_file_layered(name, quiet, user,
												 current_graphics_mode->path,
												 NULL, NULL);
	if (!used_fallback) {
		user_success = process_pref_file_layered(name, TRUE, TRUE,
												 ANGBAND_DIR_USER, NULL,
												 &used_fallback);
	}
	return root_success || user_success;
}
bool process_pref_file ( const char * name , bool quiet , bool user ) { bool root_success = FALSE ; bool user_success = FALSE ; bool used_fallback = FALSE ; root_success = process_pref_file_layered ( name , quiet , user , ANGBAND_DIR_CUSTOMIZE , ANGBAND_DIR_USER , & used_fallback ) ; if ( ! root_success && current_graphics_mode ) root_success = process_pref_file_layered ( name , quiet , user , current_graphics_mode -> path , NULL , NULL ) ; if ( ! used_fallback ) { user_success = process_pref_file_layered ( name , TRUE , TRUE , ANGBAND_DIR_USER , NULL , & used_fallback ) ; } return root_success || user_success ; }
Look for a pref file at its base location (falling back to another path if
 needed) and then in the user location.
Look for a pref file at its base location ( falling back to another path if needed ) and then in the user location .
/* This supports the old behavior: look for a file first in 'pref/', and
	 * if not found there, then 'user/'. */ /* If not found, do a check of the current graphics directory */ /* Next, we want to force a check for the file in the user/ directory.
	 * However, since we used the user directory as a fallback in the previous
	 * check, we only want to do this if the fallback wasn't used. This cuts
	 * down on unnecessary parsing. */ /* Force quiet (since this is an optional file) and force user
		 * (since this should always be considered user-specific). */ /* If only one load was successful, that's okay; we loaded something. */