Single Player Tutorial Part III

In Part III we will examine the non-ingame demo, mod and driver menus to see any special features they may contain.

As in all the previously examined menus, the first part of the file contains the itemDefs for the background, the main buttons and their associated glow and mouseover text. It is only after the section looking like the following that menu specific items are defined.

/*********************************************************************/
//
// Start of menu Specific Items
//
/*********************************************************************/

 

The demo Menu

This menu is opened from the PLAY DEMO button in the play menu and allows you to play a prerecorded demo. The interesting things start in the onOpen command in the Overall Menu Information section. Here we see the uiScript LoadDemos command. This loads the appropriate list box feeder so we can see what demos are avalible for us to play. Without this command we would not see any demos listed in our list box.

The demolist item is the list box used to display the demos avalible. It uses the FEEDER_DEMOS feeder we primed earlier to get the demo names. Only demos with the .dm_68 extension will be displayed. It is a standard text list box with a shader background and a border. It contains the doubleClick script command which is run when you double click on any of the demos listed in the box.

      close demo ; 
uiScript RunDemo

The first thing we do in the script is to close this menu. This is probably not strictly necessary but we do it anyway. Then we execute the uiScript RunDemo command. This takes the demo we selected in the list box and loads and plays it.

The PLAY DEMO button's action script duplicates the doubleClick script in the list box, since it does the exact same thing.


The mod Menu

This menu is opened from the PLAYMOD button in the play menu and allows you to play a game mod. The interesting things start in the onOpen command in the Overall Menu Information section. Here we see the uiScript LoadMods command. This loads the appropriate list box feeder so we can see what mods are avalible for us to play. Without this command we would not see any mods listed in our list box.

The modlist item is the list box used to display the mods avalible. It uses the FEEDER_MODS feeder we primed earlier to get the mod names. It is a standard text list box with a shader background and a border. It contains the doubleClick script command which is run when you double click on any of the mods listed in the box.

      close mod ; 
uiScript RunMod

The first thing we do in the script is to close this menu. This is probably not strictly necessary but we do it anyway. Then we execute the uiScript RunMod command. This takes the mod we selected in the list box and runs it.

The PLAY MOD button's action script does the same thing as the doubleClick script in the list box, since it does the exact same thing.


The driverinfo Menu

The driverinfo menu is a popup menu opened from the setup menu. To achieve this the popup command is added to the Overall Menu Information section. It is not set to be a fullscreen menu, since there will be a fullscreen menu underneath it, so it uses the rect command to define its window area.

The background item uses a shader to make the background for the window area and it has a border around it. Text is written overtop of the background by the driver_title item, defined after background so the text will be on top.

There is a DONE button which uses it's action script to close the menu when the button is clicked. Like other popup menus, closing this menu closes all other menus and opens the main menu.

The interesting stuff is all done by the driver item. It uses the ownerdraw UI_GLINFO command to display information about the OpenGl driver used by the program. The text alignment commands are used to format the text, which is automatically clipped at the edges and placed in two columns by the ownerdraw command.

 

The connect Menu

The connect menu is a very simple menu with one purpose - it is displayed on the screen while the program is starting to load a level and before the client displays its level loading graphics. This is one of those menus, like main or ingame, whose name is set by default but it can be changed in the assetGlobalDef section. See here to find out how. If you don't change the menu name then the program will look for the connect menu to display while it is getting ready to load the level.

This menu doesn't need any itemDefs since we can display a background in the Overall Menu Information section. All that is needed is to set the menu style to WINDOW_STYLE_SHADER and define a background graphic. You'll notice that the menu is not set to fullscreen but does cover the entire screen with its window. This is because the menu present when the program was asked to load the level (in our case the play menu) is still displayed underneath the connect menu.

 

Part IV : Controls Menu

 

[Part 1] [Part II] [Part III] [Part IV] [Part V] [Part VI] [Part VII]

 

Return to Home Page