MENUDEF
From ZDoom Wiki
(development version r2768+ only)
This article is a stub. Please help the ZDoom Wiki by adding to it.
| Note: Much of the menu structure defined here is accessed internally by CCMDs and menu generation code. If you want to design your own menus make sure that they are named identically and that links to all important submenus are present. |
The basic syntax is the same as for most of ZDoom's most recent text lumps, such as the new MAPINFO format for example:
BlockType BlockName
{
Key = Value;
Key = Value1, Value2;
}
The main block types are the following:
- ListMenu
- A list of commands, such as the main menu in the various games.
- OptionMenu
- A list of options, pairing each one with its current value.
- OptionValue
- A way to pair meaningful names to values, they are referenced by OptionMenus.
A menu block can contain different kinds of instructions, settings and actions, as well as conditional subblocks.
Instructions
An instruction changes how the next elements will be treated. Instructions include:
- Font "<font name>", "<font color>"
- Chooses which font will be used from then on.
- Linespacing <y>
- Changes how much space to leave in between each line.
- LabelOffset <x>
- Changes how much labels are offset.
- PlayerDisplay <x>, <y>, "RR GG BB", "RR GG BB"
- Changes the position of the box where the player character is shown in the Player Class selection menu (when a new game is started). The color definitions (in hex) define the range of the background.
- Position <x>, <y>
- Forcibly changes the starting position for the next element. (The position of the each element is normally automatically calculated from the position of its predecessor.)
- StaticText "<text>"
- Displays non-interactive text.
- StaticPatch <x>, <y>, "<lump>"
- Displays a non-interactive image lump.
Settings
A setting is a way to change something, generally a console variable. Types of settings include:
- Control "<label>", "<command>"
- For changing key bindings
- Option "<label>", "<CVAR>", "<OptionValue reference>"
- Allows to set a console variable to different values, using an OptionValue block as a reference to give names to these values.
- Slider "<label>", "<CVAR>", <minimum>, <maximum>, <inc>
- Allows to set a console variable to a range of values between <min> and <max>, using steps of <inc> units.
Commands
A command performs an action when activated. Types of commands include:
- PatchItem "<lump>", "<key>", "<menu block reference>"
- Opens a menu, and allows to use key as a shortcut to activate it directly.
- TextItem "<label>", "<key>, "<menu block reference>"
- Opens a menu, and allows to use key as a shortcut to activate it directly.
- Submenu "<label>", "<menu block reference>"
- Opens the listed submenu.
- Command "<label>", "<command>"
- Calls a console command