Over the last few weeks I added a new system to define the Rails user
configurations, which replaces the old configuration files ("my.properties"
and user-defined variants).
USER INFORMATION:
* The basic idea is that a collection of user defined settings is a user
profile and can be saved as a configuration file. Each user profile depends
on a system profile, which defines default settings.
Currently there is only one pre-defined system profile (called default), but
this allows pre-defined settings for pbem, ftf or online playing later on.
* There is a prototype for a UI under Options => Configuration which allows to
change the configurations.
It consists of two panels: The upper part allows to select a profile, create a
new or load a saved profile.
The second panel allows changes of the various options, which are collected by
the different panes.
The bottom row provides buttons to store and apply the new settings or cancel
the changes.
DEVELOPER INFORMATION:
* The composition of the UI is adjustable by changing the data/Properties.xml.
The section tags refer to the tabbed panes and the property tags to the
options. The property names are the same as in the old configuration files.
The property type attribute defines the UI element used and should be self
explaining.
* LocalisedText settings
The text for sections (pane) and properties can be changed in LocalisedText.
Keys are defined using the following patterns:
Section label:
Config.section.{name of section}
Example: Config.section.UI=Windows/Fonts
Property label:
Config.label.{name of property}
Example: Config.label.locale=Language Setting
Property toolTip:
Config.toolTip.{name of property}
Example:
Config.toolTip.local.player.name=Player name used as suffix for game save
Property infoText:
Config.infoText.{name of property}
Example:
Config.infoText.locale=<html>te_ST shows local text keys. <br> Requires
restart.</html>
* Implementation
UI is in rails.ui.swing.ConfigWindow
Behind the scenes all changes are in rails.util.Config and the properties are
defined using rails.util.ConfigItem.
* Files used
System profiles are stored in folder data.profiles.
The list of user profiles is stored in the working directory of Rails in the
file user.profiles.
User configurations can be stored anywhere in the folder system.
|