See the poll.
Here's an example of what the third option might look like:
new ScriptObject(MyAddonPrefs) // consistent object providing get/set access to actual values
{ // TODO: how to represent names and descriptions in a friendly way?
class = "BAMPrefs"; // magic happens in BAMPrefs::onAdd
rules = new ScriptGroup() // this is an array
{
// .type describes the type of each value in an array
type = new ScriptObject() // this is a mapping
{
text = string; // each of these defines the type of a property
highlight = bool; // either could be set to a ScriptGroup/ScriptObject to use an array/a map
};
};
mustAccept = bool;
titleOfBox = string;
// Maybe something like this for names, descriptions and defaults:
// titleOfBox = new ScriptObject()
// {
// type = string; // set to ScriptObject for map and ScriptGroup for array
// name = "Title of box";
// summary = "The text to use for the window title of the popup";
// default = "Server Rules";
// };
};
// .get() yields the actual user-provided value of the pref
echo(MyAddonPrefs.get("titleOfBox"));
%rules = MyAddonPrefs.get("rules");
for (%i = 0; %i < %rules.getCount(); %i++)
echo(%i + 1 @ ". " @ %rules.getObject(%i).get("text"));