In Part V we will examine the non-ingame setup menu and its associated overlay menus to see any special features they may contain. The setup menu uses overlay menus that are opened and closed to display the different sections of the menu. The setup menu is the master menu that is always on screen and, therefore, it is set to be a fullscreen menu. Each time you select a different section of the menu (using buttons) it closes out the current overlay menu and opens another one. This allows multiple menus to share the same screen area without conflict.
When using overlay menus one important thing must be remembered - it is not possible to open an overlay menu from the onOpen script of the master menu. Since you you want an overlay menu displayed when the master menu first opens another method must be used. If you remember back to our look at the main menu, you'll see that when we clicked on the SETUP button the action script opened the setup menu and then opened the player menu, which is the overlay menu we wish displayed when setup first opens.
Because we are using overlay menus rather than popup menus the items in both the master and overlay menus can recieve the focus. This allows us to use the buttons in the master menu to change which overlay menu is currently open.
The setup Menu
This menu consists of six buttons used to open specific overlay menus and a BACK button that allows us to return to the previous menu. Each of these six buttons, PLAYER, VIDEO, MORE VIDEO, SOUND, GAME OPTIONS and DEFAULT, action script does much the same thing - it closes the other five overlay menus and opens the overlay menu associated with it. Since none of the button items know which overlay menu is currently open, they close all menus that could possibly be open and then open the one they want. The BACK button's action script does a close all to close all the menus and then opens the main menu to return us to the previous menu.
The player Menu
This menu contains is used to set the options for the player. Because we are planning to use Quake 3 models for the player, rather than Team Arena models (the Freeze Tag mod is for Quake 3), in the onOpen script we must make sure that the Quake 3 models are avalible. We do this by using the setcvar "ui_q3model" 1 command. This cvar was also set in the main menu but it never hurts to be sure it remains at the correct value. Also, since we are using the player's name, we must load it into the appropriate cvar using the uiScript update "ui_GetName" command.
Since we may have changed the player's name in this menu, we must make sure it is saved when the menu closes. To accomplish this, in the onClose script, we execute the uiScript update "ui_SetName" command.
One of the quirks of using overlay menus is that the last menu opened controls the ESC key. Since this menu is opened last we must make the onEsc script handle closing all the menus and reopening the main menu. Otherwise the ESC will not have the effect we desire.
The items in this menu are :
- namefield
- effect
- headlist
- playermodel
The namefield item is an edit field item using ui_Name as the attached cvar. This cvar is loaded with the player's name when the menu is opened and the cvar contents are saved in the program when the menu closes. It uses the maxChars command to limit the length of the name we can enter.
The effect item is actually two items with the same name. One displays the text for the option and the other uses the ownerdraw UI_EFFECTS command to draw the player effects slider. It is done this way due to the way the effects slider is drawn in the item's window area. See here for details.
The headlist item is a horizontally scrolling List Box containing a graphical image of the various player models that are avalible. Since this List Box's elements are of type LISTBOX_IMAGE we can make it scroll horizontally using the horizontalscroll command. It uses the list box feeder FEEDER_Q3HEADS to give us the Quake 3 player models, rather than the Team Arena models.
The playermodel item uses the ownerdraw UI_PLAYERMODEL command to display the player model so we can see the model we are choosing.
The video Menu
This menu is used to set video options for the game. Because changing most video options requires a video restart we have a button item that we make visible any time a video option is altered. Clicking this button brings up a warning screen confirming that we wish to do a video restart. When the video menu first opens we want both the button and the warning screen to be invisible so we use the onOpen script to hide the applyChanges item and the restart group items.
One of the quirks of using overlay menus is that the last menu opened controls the ESC key. Since this menu is opened last we must make the onEsc script handle closing all the menus and reopening the main menu. Otherwise the ESC will not have the effect we desire.
The items in this menu are :
- gldriver
- graphics
- videomode
- colordepth
- fullscreen
- lighting
- geodetail
- texdetail
- texquality
- texfilter
- texcompress
All of these items, except the gldriver item, are multi selection items with an attached cvar. They all have an action script in their definition that shows the APPLY CHANGES button and then runs various uiScript commands to update all the related cvars. The APPLY CHANGES button is used to apply the changes to the video and then restart the system. This step must be done in order for the changes you have made to appear. All of the above items are part of a group named videoControls.
The gldriver item is an editfield attached to the r_gldriver cvar so the contents of that cvar are displayed in the edit field. Since this information is for display purposes only and is not to be changed, we have added the decoration command to the item definition. This stops the item from receiving the focus and therefore it can not be altered.
The graphics item is attached to the ui_glCustom cvar and is used to set the quality of the video. When you make a change to the value of this cvar the APPLY CHANGES button is shown and the uiScript update "ui_glCustom" command is executed. This updates all the cvars associated with the ui_glCustom cvar. It also may cause other items in this group to change their values to reflect the change in video quality.
The videomode item is attached to the r_mode cvar and allows you to change the screen resolution of the game. As usual, the APPLY CHANGES button is made to appear in the action script and then the uiScript glCustom command is run. This sets the video quality (shown by the graphics item) to Custom.
The colordepth item is attached to the r_colorbits cvar and allows changing the color resolution from 16 to 32 bits. The action script shows the APPLY CHANGES button, sets the video quality to Custom and then updates any cvar associated with the r_colorbits cvar.
The fullscreen item is attached to the r_fullscreen cvar and gives the option of running the game in a window or full screen. As usual, the APPLY CHANGES button is made to appear in the action script and then the uiScript glCustom command is run. This sets the video quality (shown by the graphics item) to Custom.
The lighting item is attached to the r_vertexlight cvar and gives the choice between Light Map or Vertex lighting. The action script shows the APPLY CHANGES button and sets the video quality to Custom.
The geodetail item is attached to the r_lodbais cvar and allows setting the geometric detail to Low, Medium or High. The action script shows the APPLY CHANGES button and sets the video quality to Custom.
The texdetail item is attached to the r_picmip cvar and lets you set the level of detail in the textures to Low, Normal or High. The action script shows the APPLY CHANGES button and sets the video quality to Custom.
The texquality item is attached to the r_texturebits cvar and allows setting the texture quality to 16 or 32 bit. The action script only shows the APPLY CHANGES button and nothing else.
The texfilter item is attached to the r_texturemode cvar and allows a choice between Bilinear or Trilinear filtering of the textures. The action script shows the APPLY CHANGES button and sets the video quality to Custom.
The texcompress item is attached to the r_ext_compressed_textures cvar and allows turning on and off the compression of the textures. The action script shows the APPLY CHANGES button and sets the video quality to Custom.
If any changes were made to the video options the applyChanges item will be made visible. This is a button item whose action script hides everything currently visible in the menu (itself and the videoControls group) and then shows the restart group of items, which will display the warning screen.
The restart group contains the four items named awarning, which display the warning message, and two buttons, one to accept the video restart and one to cancel it. The acceptbutton item is used when you wish to do the video restart. It's action script closes all menus and the runs exec "vid_restart", which will do the video restart. The cancelbutton item allows you to not do a video restart and it's action script hides the applyChanges item and the restart group and then shows the rest of the items (the videoControls group).

The morevideo Menu
This menu is used to set video options that could not be fitted into the video menu. One section of this menu is used to display information about the video driver being used but it is not normally visible. To make sure it isn't shown when this menu opens, we use the onOpen script to hide the items, which are all members of the dinfo group.
The items in this menu are :
- brightness
- screensize
- driverbutton
All of these items are part of the mvideo group.
The brightness item is a slider attached to the r_gamma cvar and allows you to control the gamma setting of the screen. The range is from 0.5 to 2. It uses another item, of the same name, to display the text describing the slider so that everything lines up correctly.
The screensize item is a slider attached to the cg_viewsize cvar and it allows you to adjust the size of the game's viewing area. The viewing area is set to a percentage of the screen size and can be in the range 30 to 100 percent. It uses another item, of the same name, to display the text describing the slider so that everything lines up correctly.
The driverbutton item is a button that is used to display the information on the OpenGl driver being used by the game. The action script of this button hides the mvideo group of items and displays the dinfo group of items.
The dinfo group of items consists of a title, a BACK button and the item that actually displays the driver info. This item, named driver, uses the ownerdraw UI_GLINFO command, along with the usual text formating commands, to display the information. The BACK button item simply hides the dinfo group and shows the mvideo group to return us to the normal menu display.
The sound Menu
This menu is used to set options related to game sound. The items in this group are :
- effects_volume
- music_volume
- soundquality
- doppler
The effects_volume item is a slider attached to the s_volume cvar. It allows you to change the cvar value from 0 to 1, which affects the sound effects volume. It uses another item, of the same name, to display the text describing the slider so that everything lines up correctly.
The music_volume item is also a slider attached to the s_musicvolume cvar. It allows you to change the cvar value from 0 to 1, which affects the music volume. It uses another item, of the same name, to display the text describing the slider so that everything lines up correctly.
The soundquality item is a multi selection item that is attached to the s_khz cvar. A choice of High sets this cvar to 22 while a Low choice sets it to 11.
The doppler item is a Yes/No item attached to the s_doppler cvar. This affects doppler sound in the game.
The game Menu
This menu is used to set the game related options. The items in this group are :
- simpleitems
- wallmarks
- brass
- dlight
- identify
- sky
- sync
- network
- crosshair
The simpleitems item is a multi selection item that is attached to the cg_simpleItems cvar. It sets the cvar to 1 (ON) or 0 (OFF) and allows the setting of simple items in the game.
The wallmarks item is a multi selection item attached to the cg_marks cvar. It sets the cvar to 1 (ON) or 0 (OFF) and allows the setting of wall marks in the game.
The brass item is also a multi selection item, this time attached to the cg_brassTime cvar. It allows the settings of High (2500), Med (1250) or Off (0) to control the ejection of brass from the weapons in the game.
The dlight item is yet another multi selection item attached to the r_dynamiclight cvar. It allows turning on and off the game's dynamic lights.
Another multi selection item, identify, is attached to the cg_drawCrosshairNames cvar and allows turning on or off the player name above the crosshair.
The sky item is a multi selection item attached to the r_fastsky cvar. This enables high quality skies by setting this cvar to 0 or disabling them by setting it to 1.
The sync item is yet another multi selection item attached to the r_finish cvar. This gives the option of having the game sync every frame by setting this cvar to 0 or 1.
The network item is a multi selection item attached to the rate cvar. It is used to set the network data rate of the user by selecting one of the values in the multi list. It also has an action script that is executed each time the data rate is changed. This runs the uiScript update ui_setRate command which updates all the cvars associated with the network data rate.
The crosshair item uses the ownerdraw UI_CROSSHAIR command to draw the current selected crosshair. The crosshairtext item draws the "Crosshair:" text, while the crosshairback item places a background behind the actual crosshair graphic.If you look at the bordercolor command of this item you will see that the alpha is set to 0. This makes the border invisible. In the crosshair item the mouseEnter script sets this bordercolor alpha to 1. This places a border around the crosshair graphic so it can be seen when the mouse is over it. The mouseExit script resets the alpha to 0 so it disappears when the mouse is not over the crosshair.

The default Menu
This menu is used to allow the user to reset all options back to their default state. It brings up a warning message, made up of the four items named awarning, and two buttons which allow to to chose to accept the reset or cancel it.
The acceptbutton item is a button item used to do the reset of the options. In it's action script it closes all menus and then executes the uiscript resetdefaults command. This will reset all the game options and then open the main menu.
The cancelbutton item is a button item used to cancel setting the options to default. It's action script closes all the menus, then reopens the setup and player menus so we return to the normal menu state.
Part VI : CreateServer and Associated Menus
[Part I] [Part II] [Part III] [Part IV] [Part V] [Part VI] [Part VII] [Part VIII] [Part IX] [Part X]