Extra Settings JSON Layout

Extra Settings JSON Layout - Is a special file which is used to declare set of extra propertes for your element in the config pack.

Specification
The full specification of Extra Settings Layout. JSON file you are creating must be saved in UTF8 encoding.



Root

 * style - string, Defines the type of layout
 * frame - Same as groupbox, but without border and without title
 * groupbox - Show extra settings as GUI elements
 * title - string, Defines the title of extra settings layout box
 * layout - array, Contains list of control elements are will be presented on the layout

Control element

 * control - [REQUIRED], string, type of control.
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover

Control: spinBox
Gives integer or decimal setting.
 * control - must be set to "spinBox" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover


 * type - [REQUIRED], string, Type of value: integer or decimal:
 * int - Integer type
 * double - Decimal type


 * value-default - [REQUIRED], integer/decimal, Initial value of this control
 * value-min - [Optional], integer/decimal, Minimal allowed value
 * value-max - [Optional], integer/decimal, Maximal allowed value
 * single-step - [Optional], integer/decimal, Size of one value change step, done by mouse wheel or arrow buttons on the control
 * decimals - [Optional], integer, Precission of the decimal number value

Control: checkBox
Gives boolean settings.


 * control - must be set to "checkBox" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * value-default - [REQUIRED], boolean (`true` or `false`), Initial value of this control
 * text-at-left - [Optional], boolean (`true` or `false`), Show the text at the left side of a checkbox

Control: color
Gives color settings.


 * control - must be set to "color" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * value-default - [REQUIRED], a hex color (`#RRGGBB`, or `#RRGGBBAA`, or constant color name, etc. that approvable by QColor), Initial value of this control
 * alpha-channel - [Optional], boolean (`true` or `false`), Enable or disable using of an alpha-channel (true by default)
 * placeholder - [Optional], string, a gray text shown in the empty field

Quote from Qt documentation related to color string format

Sets the RGB value of this QColor to name, which may be in one of these formats:
 * #RGB (each of R, G, and B is a single hex digit)
 * #RRGGBB
 * #AARRGGBB (Since 5.2)
 * #RRRGGGBBB
 * #RRRRGGGGBBBB
 * A name from the list of colors defined in the list of SVG color keyword names provided by the World Wide Web Consortium; for example, "steelblue" or "gainsboro". These color names work on all platforms. Note that these color names are not the same as defined by the Qt::GlobalColor enums, e.g. "green" and Qt::green does not refer to the same color.
 * transparent - representing the absence of a color.

The color is invalid if name cannot be parsed.

Control: comboBox
Gives an indexed labeled list of settings.


 * control - must be set to "comboBox" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * elements - [REQUIRED], array of strings, Elements for choice.
 * value-default - [REQUIRED], integer, Initial value of this control, index of element in the given list

Control: flagBox
Gives a group of boolean settings are stored as integer and indexed bitwisely per bit at left.


 * control - must be set to "flagBox" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * elements - [REQUIRED], array of strings, Elements for choice.
 * value-default - [REQUIRED], integer, Initial value of this control, a bitwise mask of all flags are set or unset.

Control: lineEdit
Gives a single-line text string setting.


 * control - must be set to "lineEdit" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * value-default - [REQUIRED], string, Initial value of this control.
 * max-length - [Optional], integer, String length limitation. If not defined, string length is not limited.
 * validator - [Optional], string, Regular Expression which stricts specific string format that must be typed into this field.
 * placeholder - [Optional], string, a gray text shown in the empty field
 * read-only - [Optional], boolean (`true` or `false`), set this field as read-only

Control: multiLineEdit
Gives a multi-line text string setting.


 * control - must be set to "multiLineEdit" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * value-default - [REQUIRED], string, Initial value of this control.
 * read-only - [Optional], boolean (`true` or `false`), set this field as read-only

Control: file
Gives a string field with a file choosing button


 * control - must be set to "file" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * value-default - [REQUIRED], string, Initial value of this control.
 * directory - [Optional], "episode" or "data", a root directory to list files: episode or level/world data (episode is a default), file browser can't go upper than this directory
 * directory-relative - [Optional], "episode" or "data", an initial root directory to list files (data is a default), it should be equal or lower than root
 * dialog-title - [Optional], string, Title of the file selection dialog
 * dialog-description - [Optional], string, Description label on the file selection dialog
 * filters - [Optional]', array of strings, A list of filename filters to show (default is ["*.*"])

Control: musicFile
Gives a string field with a music file choosing button and play button for a preview


 * control - must be set to "musicFile" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * value-default - [REQUIRED], string, Initial value of this control.
 * directory - [Optional], "episode" or "data", a root directory to list files: episode or level/world data (episode is a default), file browser can't go upper than this directory
 * directory-relative - [Optional], "episode" or "data", an initial root directory to list files (data is a default), it should be equal or lower than root
 * dialog-title - [Optional], string, Title of the file selection dialog
 * dialog-description - [Optional], string, Description label on the file selection dialog
 * filters - [Optional]', array of strings, A list of filename filters to show (default is a built-in list of supported music formats)

Control: soundFile
Gives a string field with a sound effect file choosing button and play button for a preview


 * control - must be set to "soundFile" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * value-default - [REQUIRED], string, Initial value of this control.
 * directory - [Optional], "episode" or "data", a root directory to list files: episode or level/world data (episode is a default), file browser can't go upper than this directory
 * directory-relative - [Optional], "episode" or "data", an initial root directory to list files (data is a default), it should be equal or lower than root
 * dialog-title - [Optional], string, Title of the file selection dialog
 * dialog-description - [Optional], string, Description label on the file selection dialog
 * filters - [Optional]', array of strings, A list of filename filters to show (default is a built-in list of supported SFX formats)

Control: levelFile
Gives a string field with a level file choosing button


 * control - must be set to "levelFile" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * value-default - [REQUIRED], string, Initial value of this control.
 * directory - [Optional], "episode" or "data", a root directory to list files: episode or level/world data (episode is a default), file browser can't go upper than this directory
 * directory-relative - [Optional], "episode" or "data", an initial root directory to list files (episode is a default), it should be equal or lower than root
 * dialog-title - [Optional], string, Title of the file selection dialog
 * dialog-description - [Optional], string, Description label on the file selection dialog
 * filters - [Optional]', array of strings, A list of filename filters to show (default is a built-in list of supported level file formats)

Control: itemSelect
Gives a button to select one of game elements


 * control - must be set to "itemSelect" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * type - [REQUIRED], "block", "bgo", "npc", "terrain", "scenery", "path", "level", A type of a game element to select.
 * value-default - [REQUIRED], string, Initial value of this control.

Control: description
A non-editable block of HTML-formatted text


 * control - must be set to "description" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover
 * text - [REQUIRED], string, An HTML text that will be shown on the box. Any clickable URLs can be added here.

Control: sizeBox
Gives a group of two integer or decimal settings are labeled as Width and Height.


 * control - must be set to "sizeBox" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover


 * type - [REQUIRED], string, Type of value: integer or decimal:
 * int - Integer type
 * double - Decimal type


 * value-default - [REQUIRED], object, Initial value of this control
 * w - [REQUIRED], integer/decimal, Width value
 * h - [REQUIRED], integer/decimal, Height value


 * value-min - [Optional], object, Minimal allowed value
 * w - [REQUIRED], integer/decimal, Width value
 * h - [REQUIRED], integer/decimal, Height value


 * value-max - [Optional], object, Maximal allowed value
 * w - [REQUIRED], integer/decimal, Width value
 * h - [REQUIRED], integer/decimal, Height value

Control: pointBox
Gives a group of two integer or decimal settings are labeled as X and Y.


 * control - must be set to "pointBox" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover


 * type - [REQUIRED], string, Type of value: integer or decimal:
 * int - Integer type
 * double - Decimal type


 * value-default - [REQUIRED], object, Initial value of this control
 * x - [REQUIRED], integer/decimal, X position value
 * y - [REQUIRED], integer/decimal, Y position value


 * value-min - [Optional], object, Minimal allowed value
 * x - [REQUIRED], integer/decimal, X position value
 * y - [REQUIRED], integer/decimal, Y position value


 * value-max - [Optional], object, Maximal allowed value
 * x - [REQUIRED], integer/decimal, X position value
 * y - [REQUIRED], integer/decimal, Y position value

Control: rectBox
Gives a group of four integer or decimal settings are labeled as X, Y, Width, and Height.


 * control - must be set to "rectBox" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.
 * title - [REQUIRED], string, Understandible name of field will be shown in the Editor.
 * tooltip - [Optional], string, Pop-up hint that appears on mouse hover


 * type - [REQUIRED], string, Type of value: integer or decimal:
 * int - Integer type
 * double - Decimal type


 * value-default - [REQUIRED], object, Initial value of this control
 * x - [REQUIRED], integer/decimal, X position value
 * y - [REQUIRED], integer/decimal, Y position value
 * w - [REQUIRED], integer/decimal, Width value
 * h - [REQUIRED], integer/decimal, Height value


 * value-min - [Optional], object, Minimal allowed value
 * x - [REQUIRED], integer/decimal, X position value
 * y - [REQUIRED], integer/decimal, Y position value
 * w - [REQUIRED], integer/decimal, Width value
 * h - [REQUIRED], integer/decimal, Height value


 * value-max - [Optional], object, Maximal allowed value
 * x - [REQUIRED], integer/decimal, X position value
 * y - [REQUIRED], integer/decimal, Y position value
 * w - [REQUIRED], integer/decimal, Width value
 * h - [REQUIRED], integer/decimal, Height value

Control: Group of controls (sub-tree)
Gives you a sub-tree of elements.


 * control - must be set to "group" (case insensitive)
 * name - [REQUIRED], string, Name of data field accessible from the Lua API.


 * title - [REQUIRED] (optional when "name" is equal to ".."), string, Understandible name of field will be shown in the Editor.
 * children - [REQUIRED], array, Child controls are included into this group.

Example layout
An example layout

Example of settings dump
An example settings dump generated from given sample.