The Intermediate Hud expands on the Basic Hud by adding some more displayed information and completing the Hud for nonteam games.
Last Killer's Name
A noncritical piece of information you may wish to have on your Hud is the name of the last player to have killed you. This can be provided by an ownerdraw command as in the following :
itemDef
{
name "lastkiller"
rect 37 7 80 16
visible MENU_TRUE
textstyle ITEM_TEXTSTYLE_SHADOWED
text "Last Killed by:"
decoration
textscale .25
ownerdraw CG_KILLER
}
Like all text ownerdraw commands, this one uses the text formatting commands in the item when displaying its information.
Frag/Capture Limit
A somewhat more vital piece of information you will wish to include in the Hud is the frag or capture limit for the game. This complements the player's score as it allows you to see how close to ending the game you are. In nonteam games this would be called the frag limit and in team games it would be the capture limit. It can be displayed like :
itemDef
{
name "fragcaplimit"
rect 8 32 40 12
visible MENU_TRUE
textstyle ITEM_TEXTSTYLE_SHADOWED
text "Frag Limit:"
decoration
textscale .25
ownerdraw CG_CAPFRAGLIMIT
ownerdrawflag CG_SHOW_ANYNONTEAMGAME
}
for nonteam games and like the following for team games :
itemDef
{
name "fragcaplimit"
rect 8 32 40 12
visible MENU_TRUE
textstyle ITEM_TEXTSTYLE_SHADOWED
text "Capture Limit:"
decoration
textscale .25
ownerdraw CG_CAPFRAGLIMIT
ownerdrawflag CG_SHOW_ANYTEAMGAME
}
The ownerdrawflag command is used to display the proper item for the current game type.
Player's Item
Another bit of information that can be useful is to show what item the player is holding. It can be displayed as a graphic by :
itemDef
{
name "playeritem"
rect 27 25 22 22
visible MENU_TRUE
ownerdraw CG_PLAYER_ITEM
}
This will draw the item as a 22x22 graphic.
Powerups
A player can have up to 16 powerups in his possession and it is necessary to show which ones you have and how much time is left on them. There is an ownerdraw command will display the powerup as a graphic and place the time left beside it. It can be used as follows :
itemDef
{
name "powerupArea"
rect 0 0 40 40
visible MENU_TRUE
textscale .35
ownerdraw CG_AREA_POWERUP
special 4
align HUD_VERTICAL
}
This is an unusual ownerdraw command in that you use the item's window area to specify the location of the first powerup graphic/text and all the other powerups are drawn outside the window. The align command tells us if the powerups are to be displayed in a horizontal row or a vertical column and the special command tells how many pixels of space should be placed between each powerup. The text portion of the display (the time remaining) uses the textscale command to determine the size of the text.