Next Previous Contents

4. menuDef { ... }

A menuDef is a grouping of itemDefs. The following describe keywords that are recognized in a menuDef body, but outside of any itemDef bodies.

4.1 font [string]

The given string is interpreted as a font name. The default is ``default''. This command should not be used as it only defines one of the three required font sizes that Team Aren uses.

4.2 name [string]

Sets a name for the menu. This keyword is primarily useful when opening the menu as a submenu, where an item in another menu can open this menu by name.

See also: `itemDef::name', `itemDef::group', `script::open', `Script actions'.

4.3 rect [rect]

Define a rectangle on the screen for the menu to occupy. Menu rectangles may overlap; the last rect defined sits on top. Nested items are offset from this rect's left and top edges (meaning this rect acts as a new "mini-screen" for coordinates for the items inside).

See also: `menuDef::fullscreen', `itemDef::rect', `script::transition'.

4.4 fullscreen [int]

A method of setting up a rectangle on the screen for the menu to occupy that covers the entire screen and to tell the program that nothing else is being rendered underneath this menu. This command must be used in place of the 'rect' command for the bottom menu.

See also: `menuDef::rect', `script::transition'.

4.5 style [int]

Defines a window style for the menu.

See also: Values for ``style'', `itemDef::style', Values for ``style''.

4.6 visible [int]

Sets visibility of this menu, whether it gets drawn or not. The visibility of a menu can be changed by an item, in conjunction with the menu name.

See also: `itemDef::visible', `script::show', `script::hide'.

4.7 onOpen { [script] }

Runs the provided script when the menu opens. When Quake III: Team Arena start up, the main menu runs this script (because it just opened). This action also occurs when the menu is opened as a submenu.

See also: `menuDef::onClose', `itemDef::leaveFocus', `script::open', `Script actions'.

4.8 onClose { [script] }

Runs the provided script when the menu closes. This action can be used for a limited amount of cleanup work and to mimick submenuing effects.

See also: `menuDef::onOpen', `menuDef::outOfBoundsClick', `script::close', `Script actions'.

4.9 onESC { [script] }

Runs the provided script when the Escape key (ESC) is pressed. This action usually closes the menu (by opening another).

See also: `menuDef::outOfBoundsClick', `script::open', `Script actions'.

4.10 border [int]

Sets a border type.

See also: Values for ``border'', `menuDef::bordersize', `menuDef::bordercolor', `itemDef::border'.

4.11 borderSize [float]

Sets the border thickness. The border is drawn inside of the menu rect. The origin coordinates for nested items is shifted, meaning that "0, 0" for itemDefs changes accordingly to avoid the border.

See also: `menuDef::border', `menuDef::bordercolor', `itemDef::bordersize'.

4.12 backcolor [color]

Sets the menu background color. Only meaningful if the rect `style' is set to WINDOW_STYLE_FILLED.

See also: `menuDef::style', `menuDef::background', `menuDef::bordercolor', `menuDef::focuscolor', `menuDef::disablecolor', `itemDef::backcolor'.

4.13 forecolor [color]

Sets menu foreground color. Used as tint color for background shaders.

See also: `menuDef::style', `menuDef::backcolor', `menuDef::bordercolor', `menuDef::focuscolor', `menuDef::disablecolor', `itemDef::forecolor', `script::setitemcolor'.

4.14 bordercolor [color]

Sets the border color.

See also: `menuDef::border', `menuDef::bordersize', `itemDef::bordercolor'.

4.15 focuscolor [color]

Sets the text color of items when they are focused -- that is, when the item is enabled and has the mouse cursor over it. See also disablecolor.

See also: `menuDef::disablecolor', `menuDef::backcolor', `itemDef::onFocus', `script::setfocus'.

4.16 disablecolor [color]

Sets the text color of items when they are disabled. See also focuscolor, cvartest, disableCvar.

4.17 background [string]

The provided string is interpreted as a Q3A shader or an image (JPG or TGA) to display in the rect background. Images are stretched to fit the rect, ignoring aspect ratios. Shaders can have their own instructions on how to fill the rect.

See also: `menuDef::style', `itemDef::background'.

4.18 ownerdraw [int]

Causes the Q3A engine to draw something within the confines of the menu rect. Primary use is in HUDs (such as showing health).

See also: Values for cgame ``ownerdraw'', Values for ui ``ownerdraw'', `menuDef::style', `menuDef::ownerdrawflag', `itemDef::ownerdraw'.

4.19 ownerdrawflag [int]

The menu asks the Q3A engine for a certain value; this value determines whether the menu (along with its items) gets drawn or not. If the menu was already invisible, nothing is drawn regardless of this flag value.

See also: Values for cgame ``ownerdrawflag''. Values for ui ``ownerdrawflag''. `menuDef::ownerdraw', `menuDef::ownerdrawflag'.

4.20 outOfBoundsClick

According to SweetnutZ, with this tag/flag in the menuDef, clicking outside the menu rectangle area causes the menu to close.

See also: `menuDef::onClose', `menuDef::onEsc'.

4.21 soundLoop [string]

The given string is interpreted as a sound name (filename for the most part) to play in a loop. The loop is stopped by providing an empty string (soundLoop "").

See also: `script::play', `script::playerlooped'.

4.22 cinematic [string]

Plays a cinematic (RoQ file) within the menu rect. The RoQ path name is provided in the string; the path name is as stored in the pk3 file. RoQs can be created from AVIs by tools provided by Id Software. AVIs can be created from multiple TGAs (or most any other image files) by various free/freeware/shareware/not-so-free tools.

See also: `menuDef::style', `itemDef::cinematic'.

4.23 popup

Causes the menu to be drawn overtop of the calling menu. Only items in this menu can gain the focus, even though items in the underlying menu can be seen.

4.24 fadeClamp [float]

Along with fadeAmount and fadeCycle, implements a fade-in effect. Best advice so far: fiddle with it.

See also: `menuDef::fadeAmount', `menuDef::fadeClamp', `script::fadein', `script::fadeout'.

4.25 fadeAmount [float]

Along with fadeClamp and fadeCycle, implements a fade-in effect. Best advice so far: fiddle with it.

See also: menuDef::fadeCycle, menuDef::fadeClamp, `script::fadein', `script::fadeout'.

4.26 fadeCycle [float]

Along with fadeClamp and fadeAmount, implements a fade-in effect. Best advice so far: fiddle with it.

See also: menuDef::fadeCycle, menuDef::fadeAmount, `script::fadein', `script::fadeout'.


Next Previous Contents