How preferences work
Adding a user preference:
To access a user preference in code, a global called gSavedSettings is used to store stuff in settings.xml. Adding a new setting to settings.xml requires that you add it to your personal settings file, as well as settings_default.xml. Additonally, you need to declare it in llcontroldef.cpp for it to be accessible.
gSavedSettings is of type llcontrolgroup inside of llcontrol.h, which may be nonobvious.