Difference between revisions of "OptionWML"
From The Battle for Wesnoth Wiki
(r56176, r56177) |
(Added [combo] and sorted alphabetically.) |
||
Line 6: | Line 6: | ||
The following subtags are recognized for '''[options]''': | The following subtags are recognized for '''[options]''': | ||
− | * '''[ | + | * '''[checkbox]''': registers a checkbox. |
+ | ** '''id''': the id for this option. Must be unique. | ||
+ | ** '''default''': boolean value, determines if the box should be checked initially. Default no. | ||
+ | ** '''name''': a string to be displayed next to the widget. | ||
+ | ** '''description''': the tooltip text to be displayed when the user hovers the mouse over the widget. | ||
+ | * '''[combo]''': registers a combo box. | ||
** '''id''': the id for this option. Must be unique. | ** '''id''': the id for this option. Must be unique. | ||
− | ** '''default''': the | + | ** '''default''': the default value of the widget. |
** '''name''': a string to be displayed next to the widget. | ** '''name''': a string to be displayed next to the widget. | ||
** '''description''': the tooltip text to be displayed when the user hovers the mouse over the widget. | ** '''description''': the tooltip text to be displayed when the user hovers the mouse over the widget. | ||
− | * '''[ | + | ** '''[item]''': adds an item to the combo box. |
+ | *** '''name''': the displayed name of this item. | ||
+ | *** '''value''': the value the widget will take when this item is selected. | ||
+ | * '''[entry]''': registers a text entry. | ||
** '''id''': the id for this option. Must be unique. | ** '''id''': the id for this option. Must be unique. | ||
− | ** '''default''': | + | ** '''default''': the string initially displayed by the widget. |
** '''name''': a string to be displayed next to the widget. | ** '''name''': a string to be displayed next to the widget. | ||
** '''description''': the tooltip text to be displayed when the user hovers the mouse over the widget. | ** '''description''': the tooltip text to be displayed when the user hovers the mouse over the widget. |
Revision as of 10:07, 28 December 2013
The [options] tag
Template:DevFeature1.11 This tag might be a child of an [era], [multiplayer] or [modification] tag. Its subtags describe a set of configuration options which are displayed to the user as widgets on the game creation screen, and the entered values are translated into WML variables in the game. Please note that the option variables are initialized in a prestart event, therefore they can't be used before the first prestart event. The created variables' name is identical to the option's id they're attached to, so option ids must be unique across all kinds of options.
The following subtags are recognized for [options]:
- [checkbox]: registers a checkbox.
- id: the id for this option. Must be unique.
- default: boolean value, determines if the box should be checked initially. Default no.
- name: a string to be displayed next to the widget.
- description: the tooltip text to be displayed when the user hovers the mouse over the widget.
- [combo]: registers a combo box.
- id: the id for this option. Must be unique.
- default: the default value of the widget.
- name: a string to be displayed next to the widget.
- description: the tooltip text to be displayed when the user hovers the mouse over the widget.
- [item]: adds an item to the combo box.
- name: the displayed name of this item.
- value: the value the widget will take when this item is selected.
- [entry]: registers a text entry.
- id: the id for this option. Must be unique.
- default: the string initially displayed by the widget.
- name: a string to be displayed next to the widget.
- description: the tooltip text to be displayed when the user hovers the mouse over the widget.
- [slider]: registers an integer slider.
- id: the id for this option. Must be unique.
- default: an integer value. The slider will be positioned at this value by default.
- min: the minimal value the slider can take.
- max: the maximal value the slider can take.
- step: the difference between adjacent values the slider can take. Default 1.
- name: a string to be displayed next to the widget.
- description: the tooltip text to be displayed when the user hovers the mouse over the widget.