Note that we don't make any assumptions in this base class about the type of the value associated with this setting, how it's stored, or how it's represented in the external configuration file. This means that each subclass has to provide the property or properties that store the item's value, and must also define the methods that operate on the value.
If you want to force a particular default setting for a particular preference item, overriding the setting stored in the global preferences file, you can override that SettingsItem's settingFromText() method. This is the method that interprets the information in the preferences file, so if you want to ignore the preferences file setting, override this method to set the hard-coded value of your choosing.
SettingsItem : object
The ID should be chosen to ensure uniqueness. To reduce the chances of name collisions, we suggest a convention of using a two part name: a prefix identifying the source of the name (an abbreviated version of the name of the library, library extension, or game), followed by a period as a separator, followed by a short descriptive name for the variable. The library follows this convention by using names of the form "adv3.xxx" - the "adv3" prefix indicates the standard library.
The ID should contain only letters, numbers, and periods. Don't use spaces or punctuation marks (other than periods).
Note that the ID string is for the program's use, not the player's, so this isn't something we translate to different languages. Note, though, that the configuration file is a simple text file, so it wouldn't hurt to use a reasonably meaningful name, in case the user takes it upon herself to look at the contents of the file.
This implementation is suitable for any scalar type, so this won't need to be overwritten for subclasses that only need to load a single string value from the file. Subclasses that implement complex (non-scalar) datatypes can override this as needed to read multiple line items from the file.
This implementation is suitable for any scalar type, so this won't need to be overwritten for subclasses that only need to store a single string value in the file. Subclasses that implement complex (non-scalar) datatypes can override this as needed to manipulate multiple line items in the file.
This is only needed if the default restoreItem() method is used.
Note that this is only needed if the default saveItem() method is used.