Sample Team Scoreboard

The Team scoreboard is displayed when you are playing a team game such as CTF. Since there are team members in these games the scoreboard is laidout differently that a nonteam game scoreboard. The scripted Hud system sets up a specific menuDef for the nonteam scoreboard that must be named teamscore_menu. The rest of the menuDefs in the Hud are hidden and this menuDef is made visible whenever the scoreboard is shown in a team game.

The most important thing about the teamscore_menu menuDef is that it must be invisible by default. This is accomplished by using the visible MENU_FALSE command in the menuDef. Since the scoreboard can cover most of the screen area we set the menuDef's window area to the entire screen with the rect 0 0 640 480 command. Note that the menuDef is not fullscreen.

 

The teamcolor item draws an outlined box at the top of the scoreboard that is colored the player's team color. If the player is spectating then no color is used. The killer item uses the ownerdraw CG_KILLER command to display the name of the last player to kill you inside this box. It uses the text formatting commands in the item to place the text on the screen.

The statusWindow item displays a colored, outlined box which will contain the team names and the game score. The gamestatus item uses the ownerdraw CG_GAME_STATUS command to display the game score. It uses the text formatting commands in the item to place the text on the screen. The redteamname item and the blueteamname item use the ownerdraw CG_RED_NAME and the ownerdraw CG_BLUE_NAME commands, respectively, to display the name of the teams playing the game. They use the text formatting commands in their item to place the text on the screen. Since team names are only used in the single player skirmish game we make these items visible only in that game type by using the cvartest "ui_singlePlayerActive" and showCvar { "1" } commands.

Information about the players on each team are displayed in two boxes placed side by side. These boxes are broken up into columns and the titles for each column are placed above them. The titles for the columns of the left side box are placed in the box drawn by the leftteambar item. Since the left box contains the Red team information, this box is colored red by the backcolor command. The actual titles are displayed by the leftteamheadings item, which is a text item. The titles for the columns of the right side box are placed in the box drawn by the rightteambar item. Since the right box contains the Blue team information, this box is colored blue by the backcolor command. The actual titles are displayed by the rightteamheadings item, which is a text item.

The listborder item draws the actual box around the area that holds the player's information. The two items named leftscrollbar draw vertical lines to each side of the scroll bar for the left side List box. The rightscrollbar item draws a vertical line to the side of the scroll bar for the right side List box.

The redlogo item displays a graphic in the area containing the Red team's information and the leftbackground item fills that area with a graphic background that is tinted red and is partially transparent. The bluelogo item displays a graphic in the area containing the Blue team's information and the rightbackground item fills that area with a graphic background that is tinted blue and is partially transparent.

There are two List boxes used to display information about both teams. The leftlist item uses the feeder FEEDER_REDTEAM_LIST command to provide the Red teams player information and place it in the left side of the area outlined by the listborder item. The columns command is used to format the provided information so it is displayed under the correct titles. The rightlist item uses the feeder FEEDER_BLUETEAM_LIST command to provide the Blue teams player information and place it in the right side of the area outlined by the listborder item. The columns command is used to format the provided information so it is displayed under the correct titles.

Underneath the player information area is the area displaying the medals for the player's team. The medalwindow item draws a colored, outlined box around this area. The seven medals the team can have are drawn by the medal_accuracy, medal_assist, medal_defend, medal_excellent, medal_gauntlet, medal_impressive and medal_capture_team items. They all use the background command to display a graphic representing their particular medal (the size of the graphic is set by the window area of the item, 32x32 in this case) and then use an ownerdraw command to display the actual medal value or percentage. The text size is controlled by the textscale command in the item. The color of the text is set by the forecolor command, which in this case, makes the text slightly transparent.

The spectatorwindow item draws a colored, outlined box that will contain the list of players who are spectating. The spectatingtext item displays the Spectating: title for the box. The spectatorlist item uses the ownerdraw CG_SPECTATORS command to display the list of spectator as a marquee scrolling list in it's window area. It uses the textscale command to set the size of the text.

The gametypewindow item displays the colored, outlined box at the bottom of the scoreboard. The gametype item uses the ownerdraw CG_GAME_TYPE command to show the type of game in the left side of this box, while the playerscore item uses the ownerdraw CG_PLAYER_SCORE command to display the player's score to the right. The scrolltextwindow item draws another colored, outlined box in the center of the box drawn by the gametypewindow item and the scrolltext item displays some text reminding the player to use the Scroll Keys to scroll the player lists to see all the player's information.

 

[Part I] [Part II] [Part III]

 

Return to Home Page