Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

ui_sppostgame.c File Reference

#include "ui_local.h"

Include dependency graph for ui_sppostgame.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  postgameMenuInfo_t

Defines

#define ART_MENU0   "menu/art/menu_0"
#define ART_MENU1   "menu/art/menu_1"
#define ART_NEXT0   "menu/art/next_0"
#define ART_NEXT1   "menu/art/next_1"
#define ART_REPLAY0   "menu/art/replay_0"
#define ART_REPLAY1   "menu/art/replay_1"
#define AWARD_PRESENTATION_TIME   2000
#define ID_AGAIN   10
#define ID_MENU   12
#define ID_NEXT   11
#define MAX_SCOREBOARD_CLIENTS   8

Functions

void Prepname (int index)
void UI_SPPostgameMenu_AgainEvent (void *ptr, int event)
void UI_SPPostgameMenu_Cache (void)
void UI_SPPostgameMenu_DrawAwardsMedals (int max)
void UI_SPPostgameMenu_DrawAwardsPresentation (int timer)
void UI_SPPostgameMenu_f (void)
void UI_SPPostgameMenu_Init (void)
void UI_SPPostgameMenu_MenuDraw (void)
void UI_SPPostgameMenu_MenuDrawScoreLine (int n, int y)
void UI_SPPostgameMenu_MenuEvent (void *ptr, int event)
sfxHandle_t UI_SPPostgameMenu_MenuKey (int key)
void UI_SPPostgameMenu_NextEvent (void *ptr, int event)

Variables

char arenainfo [MAX_INFO_VALUE]
int medalLocations [6] = {144, 448, 88, 504, 32, 560}
postgameMenuInfo_t postgameMenuInfo
char * ui_medalNames [] = {"Accuracy", "Impressive", "Excellent", "Gauntlet", "Frags", "Perfect"}
char * ui_medalPicNames []
char * ui_medalSounds []


Define Documentation

#define ART_MENU0   "menu/art/menu_0"
 

Definition at line 37 of file ui_sppostgame.c.

Referenced by UI_SPPostgameMenu_Cache().

#define ART_MENU1   "menu/art/menu_1"
 

Definition at line 38 of file ui_sppostgame.c.

Referenced by UI_SPPostgameMenu_Cache().

#define ART_NEXT0   "menu/art/next_0"
 

Definition at line 41 of file ui_sppostgame.c.

Referenced by UI_SPPostgameMenu_Cache().

#define ART_NEXT1   "menu/art/next_1"
 

Definition at line 42 of file ui_sppostgame.c.

Referenced by UI_SPPostgameMenu_Cache().

#define ART_REPLAY0   "menu/art/replay_0"
 

Definition at line 39 of file ui_sppostgame.c.

Referenced by UI_SPPostgameMenu_Cache().

#define ART_REPLAY1   "menu/art/replay_1"
 

Definition at line 40 of file ui_sppostgame.c.

Referenced by UI_SPPostgameMenu_Cache().

#define AWARD_PRESENTATION_TIME   2000
 

Definition at line 35 of file ui_sppostgame.c.

Referenced by UI_SPPostgameMenu_DrawAwardsPresentation().

#define ID_AGAIN   10
 

Definition at line 44 of file ui_sppostgame.c.

#define ID_MENU   12
 

Definition at line 46 of file ui_sppostgame.c.

#define ID_NEXT   11
 

Definition at line 45 of file ui_sppostgame.c.

#define MAX_SCOREBOARD_CLIENTS   8
 

Definition at line 33 of file ui_sppostgame.c.


Function Documentation

void Prepname int  index  )  [static]
 

Definition at line 479 of file ui_sppostgame.c.

References postgameMenuInfo_t::clientNums, CS_PLAYERS, Info_ValueForKey(), MAX_INFO_STRING, name, postgameMenuInfo_t::placeNames, postgameMenuInfo, Q_CleanStr(), Q_strncpyz(), strlen(), trap_GetConfigString(), and UI_ProportionalStringWidth().

Referenced by UI_SPPostgameMenu_f().

00479                                   {
00480     int     len;
00481     char    name[64];
00482     char    info[MAX_INFO_STRING];
00483 
00484     trap_GetConfigString( CS_PLAYERS + postgameMenuInfo.clientNums[index], info, MAX_INFO_STRING );
00485     Q_strncpyz( name, Info_ValueForKey( info, "n" ), sizeof(name) );
00486     Q_CleanStr( name );
00487     len = strlen( name );
00488 
00489     while( len && UI_ProportionalStringWidth( name ) > 256 ) {
00490         len--;
00491         name[len] = 0;
00492     }
00493 
00494     Q_strncpyz( postgameMenuInfo.placeNames[index], name, sizeof(postgameMenuInfo.placeNames[index]) );
00495 }

Here is the call graph for this function:

void UI_SPPostgameMenu_AgainEvent void *  ptr,
int  event
[static]
 

Definition at line 104 of file ui_sppostgame.c.

References EXEC_APPEND, trap_Cmd_ExecuteText(), and UI_PopMenu().

00105 {
00106     if (event != QM_ACTIVATED) {
00107         return;
00108     }
00109     UI_PopMenu();
00110     trap_Cmd_ExecuteText( EXEC_APPEND, "map_restart 0\n" );
00111 }

Here is the call graph for this function:

void UI_SPPostgameMenu_Cache void   ) 
 

Definition at line 402 of file ui_sppostgame.c.

References ART_MENU0, ART_MENU1, ART_NEXT0, ART_NEXT1, ART_REPLAY0, ART_REPLAY1, n, qboolean, qfalse, trap_Cvar_VariableValue(), trap_R_RegisterShaderNoMip(), trap_S_RegisterSound(), ui_medalPicNames, and ui_medalSounds.

00402                                      {
00403     int         n;
00404     qboolean    buildscript;
00405 
00406     buildscript = trap_Cvar_VariableValue("com_buildscript");
00407 
00408     trap_R_RegisterShaderNoMip( ART_MENU0 );
00409     trap_R_RegisterShaderNoMip( ART_MENU1 );
00410     trap_R_RegisterShaderNoMip( ART_REPLAY0 );
00411     trap_R_RegisterShaderNoMip( ART_REPLAY1 );
00412     trap_R_RegisterShaderNoMip( ART_NEXT0 );
00413     trap_R_RegisterShaderNoMip( ART_NEXT1 );
00414     for( n = 0; n < 6; n++ ) {
00415         trap_R_RegisterShaderNoMip( ui_medalPicNames[n] );
00416         trap_S_RegisterSound( ui_medalSounds[n], qfalse );
00417     }
00418 
00419     if( buildscript ) {
00420         trap_S_RegisterSound( "music/loss.wav", qfalse );
00421         trap_S_RegisterSound( "music/win.wav", qfalse );
00422         trap_S_RegisterSound( "sound/player/announce/youwin.wav", qfalse );
00423     }
00424 }

Here is the call graph for this function:

void UI_SPPostgameMenu_DrawAwardsMedals int  max  )  [static]
 

Definition at line 209 of file ui_sppostgame.c.

References postgameMenuInfo_t::awardsEarned, postgameMenuInfo_t::awardsLevels, color_yellow, Com_sprintf(), medalLocations, n, postgameMenuInfo, UI_CENTER, UI_DrawNamedPic(), UI_DrawString(), ui_medalPicNames, x, and y.

Referenced by UI_SPPostgameMenu_DrawAwardsPresentation(), and UI_SPPostgameMenu_MenuDraw().

00209                                                           {
00210     int     n;
00211     int     medal;
00212     int     amount;
00213     int     x, y;
00214     char    buf[16];
00215 
00216     for( n = 0; n < max; n++ ) {
00217         x = medalLocations[n];
00218         y = 64;
00219         medal = postgameMenuInfo.awardsEarned[n];
00220         amount = postgameMenuInfo.awardsLevels[n];
00221 
00222         UI_DrawNamedPic( x, y, 48, 48, ui_medalPicNames[medal] );
00223 
00224         if( medal == AWARD_ACCURACY ) {
00225             Com_sprintf( buf, sizeof(buf), "%i%%", amount );
00226         }
00227         else {
00228             if( amount == 1 ) {
00229                 continue;
00230             }
00231             Com_sprintf( buf, sizeof(buf), "%i", amount );
00232         }
00233 
00234         UI_DrawString( x + 24, y + 52, buf, UI_CENTER, color_yellow );
00235     }
00236 }

Here is the call graph for this function:

void UI_SPPostgameMenu_DrawAwardsPresentation int  timer  )  [static]
 

Definition at line 239 of file ui_sppostgame.c.

References AWARD_PRESENTATION_TIME, postgameMenuInfo_t::awardsEarned, CHAN_ANNOUNCER, postgameMenuInfo_t::playedSound, postgameMenuInfo, qfalse, trap_S_RegisterSound(), trap_S_StartLocalSound(), UI_CENTER, UI_DrawProportionalString(), ui_medalNames, ui_medalSounds, and UI_SPPostgameMenu_DrawAwardsMedals().

Referenced by UI_SPPostgameMenu_MenuDraw().

00239                                                                   {
00240     int     awardNum;
00241     int     atimer;
00242     vec4_t  color;
00243 
00244     awardNum = timer / AWARD_PRESENTATION_TIME;
00245     atimer = timer % AWARD_PRESENTATION_TIME;
00246 
00247     color[0] = color[1] = color[2] = 1.0f;
00248     color[3] = (float)( AWARD_PRESENTATION_TIME - atimer ) / (float)AWARD_PRESENTATION_TIME;
00249     UI_DrawProportionalString( 320, 64, ui_medalNames[postgameMenuInfo.awardsEarned[awardNum]], UI_CENTER, color );
00250 
00251     UI_SPPostgameMenu_DrawAwardsMedals( awardNum + 1 );
00252 
00253     if( !postgameMenuInfo.playedSound[awardNum] ) {
00254         postgameMenuInfo.playedSound[awardNum] = qtrue;
00255         trap_S_StartLocalSound( trap_S_RegisterSound( ui_medalSounds[postgameMenuInfo.awardsEarned[awardNum]], qfalse ), CHAN_ANNOUNCER );
00256     }
00257 }

Here is the call graph for this function:

void UI_SPPostgameMenu_f void   ) 
 

Definition at line 503 of file ui_sppostgame.c.

References arenainfo, atoi, AWARD_ACCURACY, AWARD_EXCELLENT, AWARD_FRAGS, AWARD_GAUNTLET, AWARD_IMPRESSIVE, AWARD_PERFECT, postgameMenuInfo_t::awardsEarned, postgameMenuInfo_t::awardsLevels, postgameMenuInfo_t::clientNums, CS_SERVERINFO, CS_SYSTEMINFO, EXEC_APPEND, Info_ValueForKey(), postgameMenuInfo_t::item_again, postgameMenuInfo_t::item_next, KEYCATCH_UI, postgameMenuInfo_t::lastTier, postgameMenuInfo_t::level, memset(), postgameMenuInfo_t::menu, Menu_SetCursorToItem(), uiStatic_t::menusp, n, postgameMenuInfo_t::numAwards, postgameMenuInfo_t::numClients, postgameMenuInfo_t::phase, postgameMenuInfo_t::placeNames, postgameMenuInfo, Prepname(), Q_strncpyz(), qfalse, postgameMenuInfo_t::ranks, uiStatic_t::realtime, postgameMenuInfo_t::scoreboardtime, postgameMenuInfo_t::scores, postgameMenuInfo_t::serverId, postgameMenuInfo_t::starttime, trap_Cmd_ExecuteText(), trap_GetConfigString(), trap_Key_SetCatcher(), trap_S_RegisterSound(), UI_Argv(), UI_GetArenaInfoByMap(), UI_GetAwardLevel(), UI_GetNumSPTiers(), UI_GetSpecialArenaInfo(), UI_LogAwardData(), UI_PushMenu(), UI_SetBestScore(), UI_SPPostgameMenu_Init(), UI_TierCompleted(), uis, va(), postgameMenuInfo_t::winnerSound, and postgameMenuInfo_t::won.

00503                                  {
00504     int         playerGameRank;
00505     int         playerClientNum;
00506     int         n;
00507     int         oldFrags, newFrags;
00508     const char  *arena;
00509     int         awardValues[6];
00510     char        map[MAX_QPATH];
00511     char        info[MAX_INFO_STRING];
00512 
00513     memset( &postgameMenuInfo, 0, sizeof(postgameMenuInfo) );
00514 
00515     trap_GetConfigString( CS_SYSTEMINFO, info, sizeof(info) );
00516     postgameMenuInfo.serverId = atoi( Info_ValueForKey( info, "sv_serverid" ) );
00517 
00518     trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) );
00519     Q_strncpyz( map, Info_ValueForKey( info, "mapname" ), sizeof(map) );
00520     arena = UI_GetArenaInfoByMap( map );
00521     if ( !arena ) {
00522         return;
00523     }
00524     Q_strncpyz( arenainfo, arena, sizeof(arenainfo) );
00525 
00526     postgameMenuInfo.level = atoi( Info_ValueForKey( arenainfo, "num" ) );
00527 
00528     postgameMenuInfo.numClients = atoi( UI_Argv( 1 ) );
00529     playerClientNum = atoi( UI_Argv( 2 ) );
00530     playerGameRank = 8;     // in case they ended game as a spectator
00531 
00532     if( postgameMenuInfo.numClients > MAX_SCOREBOARD_CLIENTS ) {
00533         postgameMenuInfo.numClients = MAX_SCOREBOARD_CLIENTS;
00534     }
00535 
00536     for( n = 0; n < postgameMenuInfo.numClients; n++ ) {
00537         postgameMenuInfo.clientNums[n] = atoi( UI_Argv( 8 + n * 3 + 1 ) );
00538         postgameMenuInfo.ranks[n] = atoi( UI_Argv( 8 + n * 3 + 2 ) );
00539         postgameMenuInfo.scores[n] = atoi( UI_Argv( 8 + n * 3 + 3 ) );
00540 
00541         if( postgameMenuInfo.clientNums[n] == playerClientNum ) {
00542             playerGameRank = (postgameMenuInfo.ranks[n] & ~RANK_TIED_FLAG) + 1;
00543         }
00544     }
00545 
00546     UI_SetBestScore( postgameMenuInfo.level, playerGameRank );
00547 
00548     // process award stats and prepare presentation data
00549     awardValues[AWARD_ACCURACY] = atoi( UI_Argv( 3 ) );
00550     awardValues[AWARD_IMPRESSIVE] = atoi( UI_Argv( 4 ) );
00551     awardValues[AWARD_EXCELLENT] = atoi( UI_Argv( 5 ) );
00552     awardValues[AWARD_GAUNTLET] = atoi( UI_Argv( 6 ) );
00553     awardValues[AWARD_FRAGS] = atoi( UI_Argv( 7 ) );
00554     awardValues[AWARD_PERFECT] = atoi( UI_Argv( 8 ) );
00555 
00556     postgameMenuInfo.numAwards = 0;
00557 
00558     if( awardValues[AWARD_ACCURACY] >= 50 ) {
00559         UI_LogAwardData( AWARD_ACCURACY, 1 );
00560         postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_ACCURACY;
00561         postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = awardValues[AWARD_ACCURACY];
00562         postgameMenuInfo.numAwards++;
00563     }
00564 
00565     if( awardValues[AWARD_IMPRESSIVE] ) {
00566         UI_LogAwardData( AWARD_IMPRESSIVE, awardValues[AWARD_IMPRESSIVE] );
00567         postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_IMPRESSIVE;
00568         postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = awardValues[AWARD_IMPRESSIVE];
00569         postgameMenuInfo.numAwards++;
00570     }
00571 
00572     if( awardValues[AWARD_EXCELLENT] ) {
00573         UI_LogAwardData( AWARD_EXCELLENT, awardValues[AWARD_EXCELLENT] );
00574         postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_EXCELLENT;
00575         postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = awardValues[AWARD_EXCELLENT];
00576         postgameMenuInfo.numAwards++;
00577     }
00578 
00579     if( awardValues[AWARD_GAUNTLET] ) {
00580         UI_LogAwardData( AWARD_GAUNTLET, awardValues[AWARD_GAUNTLET] );
00581         postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_GAUNTLET;
00582         postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = awardValues[AWARD_GAUNTLET];
00583         postgameMenuInfo.numAwards++;
00584     }
00585 
00586     oldFrags = UI_GetAwardLevel( AWARD_FRAGS ) / 100;
00587     UI_LogAwardData( AWARD_FRAGS, awardValues[AWARD_FRAGS] );
00588     newFrags = UI_GetAwardLevel( AWARD_FRAGS ) / 100;
00589     if( newFrags > oldFrags ) {
00590         postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_FRAGS;
00591         postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = newFrags * 100;
00592         postgameMenuInfo.numAwards++;
00593     }
00594 
00595     if( awardValues[AWARD_PERFECT] ) {
00596         UI_LogAwardData( AWARD_PERFECT, 1 );
00597         postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_PERFECT;
00598         postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = 1;
00599         postgameMenuInfo.numAwards++;
00600     }
00601 
00602     if ( playerGameRank == 1 ) {
00603         postgameMenuInfo.won = UI_TierCompleted( postgameMenuInfo.level );
00604     }
00605     else {
00606         postgameMenuInfo.won = -1;
00607     }
00608 
00609     postgameMenuInfo.starttime = uis.realtime;
00610     postgameMenuInfo.scoreboardtime = uis.realtime;
00611 
00612     trap_Key_SetCatcher( KEYCATCH_UI );
00613     uis.menusp = 0;
00614 
00615     UI_SPPostgameMenu_Init();
00616     UI_PushMenu( &postgameMenuInfo.menu );
00617 
00618     if ( playerGameRank == 1 ) {
00619         Menu_SetCursorToItem( &postgameMenuInfo.menu, &postgameMenuInfo.item_next );
00620     }
00621     else {
00622         Menu_SetCursorToItem( &postgameMenuInfo.menu, &postgameMenuInfo.item_again );
00623     }
00624 
00625     Prepname( 0 );
00626     Prepname( 1 );
00627     Prepname( 2 );
00628 
00629     if ( playerGameRank != 1 ) {
00630         postgameMenuInfo.winnerSound = trap_S_RegisterSound( va( "sound/player/announce/%s_wins.wav", postgameMenuInfo.placeNames[0] ), qfalse );
00631         trap_Cmd_ExecuteText( EXEC_APPEND, "music music/loss\n" );
00632     }
00633     else {
00634         postgameMenuInfo.winnerSound = trap_S_RegisterSound( "sound/player/announce/youwin.wav", qfalse );
00635         trap_Cmd_ExecuteText( EXEC_APPEND, "music music/win\n" );
00636     }
00637 
00638     postgameMenuInfo.phase = 1;
00639 
00640     postgameMenuInfo.lastTier = UI_GetNumSPTiers();
00641     if ( UI_GetSpecialArenaInfo( "final" ) ) {
00642         postgameMenuInfo.lastTier++;
00643     }
00644 }

Here is the call graph for this function:

void UI_SPPostgameMenu_Init void   )  [static]
 

Definition at line 432 of file ui_sppostgame.c.

References menucommon_s::callback, _tag_menuframework::draw, menucommon_s::flags, menubitmap_s::focuspic, menubitmap_s::generic, menubitmap_s::height, menucommon_s::id, postgameMenuInfo_t::ignoreKeysTime, postgameMenuInfo_t::item_again, postgameMenuInfo_t::item_menu, postgameMenuInfo_t::item_next, _tag_menuframework::key, postgameMenuInfo_t::menu, Menu_AddItem(), menucommon_s::name, postgameMenuInfo, QMF_CENTER_JUSTIFY, QMF_LEFT_JUSTIFY, QMF_PULSEIFFOCUS, QMF_RIGHT_JUSTIFY, uiStatic_t::realtime, menucommon_s::type, UI_SPPostgameMenu_Cache(), uis, menubitmap_s::width, _tag_menuframework::wrapAround, menucommon_s::x, and menucommon_s::y.

Referenced by UI_SPPostgameMenu_f().

00432                                            {
00433     postgameMenuInfo.menu.wrapAround    = qtrue;
00434     postgameMenuInfo.menu.key           = UI_SPPostgameMenu_MenuKey;
00435     postgameMenuInfo.menu.draw          = UI_SPPostgameMenu_MenuDraw;
00436     postgameMenuInfo.ignoreKeysTime     = uis.realtime + 1500;
00437 
00438     UI_SPPostgameMenu_Cache();
00439 
00440     postgameMenuInfo.item_menu.generic.type         = MTYPE_BITMAP;
00441     postgameMenuInfo.item_menu.generic.name         = ART_MENU0;
00442     postgameMenuInfo.item_menu.generic.flags        = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
00443     postgameMenuInfo.item_menu.generic.x            = 0;
00444     postgameMenuInfo.item_menu.generic.y            = 480-64;
00445     postgameMenuInfo.item_menu.generic.callback     = UI_SPPostgameMenu_MenuEvent;
00446     postgameMenuInfo.item_menu.generic.id           = ID_MENU;
00447     postgameMenuInfo.item_menu.width                = 128;
00448     postgameMenuInfo.item_menu.height               = 64;
00449     postgameMenuInfo.item_menu.focuspic             = ART_MENU1;
00450 
00451     postgameMenuInfo.item_again.generic.type        = MTYPE_BITMAP;
00452     postgameMenuInfo.item_again.generic.name        = ART_REPLAY0;
00453     postgameMenuInfo.item_again.generic.flags       = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
00454     postgameMenuInfo.item_again.generic.x           = 320;
00455     postgameMenuInfo.item_again.generic.y           = 480-64;
00456     postgameMenuInfo.item_again.generic.callback    = UI_SPPostgameMenu_AgainEvent;
00457     postgameMenuInfo.item_again.generic.id          = ID_AGAIN;
00458     postgameMenuInfo.item_again.width               = 128;
00459     postgameMenuInfo.item_again.height              = 64;
00460     postgameMenuInfo.item_again.focuspic            = ART_REPLAY1;
00461 
00462     postgameMenuInfo.item_next.generic.type         = MTYPE_BITMAP;
00463     postgameMenuInfo.item_next.generic.name         = ART_NEXT0;
00464     postgameMenuInfo.item_next.generic.flags        = QMF_RIGHT_JUSTIFY|QMF_PULSEIFFOCUS|QMF_INACTIVE;
00465     postgameMenuInfo.item_next.generic.x            = 640;
00466     postgameMenuInfo.item_next.generic.y            = 480-64;
00467     postgameMenuInfo.item_next.generic.callback     = UI_SPPostgameMenu_NextEvent;
00468     postgameMenuInfo.item_next.generic.id           = ID_NEXT;
00469     postgameMenuInfo.item_next.width                = 128;
00470     postgameMenuInfo.item_next.height               = 64;
00471     postgameMenuInfo.item_next.focuspic             = ART_NEXT1;
00472 
00473     Menu_AddItem( &postgameMenuInfo.menu, ( void * )&postgameMenuInfo.item_menu );
00474     Menu_AddItem( &postgameMenuInfo.menu, ( void * )&postgameMenuInfo.item_again );
00475     Menu_AddItem( &postgameMenuInfo.menu, ( void * )&postgameMenuInfo.item_next );
00476 }

Here is the call graph for this function:

void UI_SPPostgameMenu_MenuDraw void   )  [static]
 

Definition at line 296 of file ui_sppostgame.c.

References ARENAS_PER_TIER, atoi, CHAN_ANNOUNCER, color_white, CS_SYSTEMINFO, uiStatic_t::demoversion, EXEC_APPEND, menucommon_s::flags, menubitmap_s::generic, Info_ValueForKey(), postgameMenuInfo_t::item_again, postgameMenuInfo_t::item_menu, postgameMenuInfo_t::item_next, postgameMenuInfo_t::lastTier, postgameMenuInfo_t::menu, Menu_Draw(), n, postgameMenuInfo_t::numAwards, postgameMenuInfo_t::numClients, postgameMenuInfo_t::phase, postgameMenuInfo_t::placeNames, postgameMenuInfo, PROP_HEIGHT, uiStatic_t::realtime, postgameMenuInfo_t::scoreboardtime, postgameMenuInfo_t::serverId, SMALLCHAR_HEIGHT, postgameMenuInfo_t::starttime, trap_Cmd_ExecuteText(), trap_Cvar_Set(), trap_Cvar_SetValue(), trap_Cvar_VariableValue(), trap_GetConfigString(), trap_S_StartLocalSound(), UI_CENTER, UI_DrawProportionalString(), UI_PopMenu(), UI_ShowTierVideo(), UI_SPPostgameMenu_DrawAwardsMedals(), UI_SPPostgameMenu_DrawAwardsPresentation(), UI_SPPostgameMenu_MenuDrawScoreLine(), uis, va(), postgameMenuInfo_t::winnerSound, and postgameMenuInfo_t::won.

00296                                                {
00297     int     timer;
00298     int     serverId;
00299     int     n;
00300     char    info[MAX_INFO_STRING];
00301 
00302     trap_GetConfigString( CS_SYSTEMINFO, info, sizeof(info) );
00303     serverId = atoi( Info_ValueForKey( info, "sv_serverid" ) );
00304     if( serverId != postgameMenuInfo.serverId ) {
00305         UI_PopMenu();
00306         return;
00307     }
00308 
00309     // phase 1
00310     if ( postgameMenuInfo.numClients > 2 ) {
00311         UI_DrawProportionalString( 510, 480 - 64 - PROP_HEIGHT, postgameMenuInfo.placeNames[2], UI_CENTER, color_white );
00312     }
00313     UI_DrawProportionalString( 130, 480 - 64 - PROP_HEIGHT, postgameMenuInfo.placeNames[1], UI_CENTER, color_white );
00314     UI_DrawProportionalString( 320, 480 - 64 - 2 * PROP_HEIGHT, postgameMenuInfo.placeNames[0], UI_CENTER, color_white );
00315 
00316     if( postgameMenuInfo.phase == 1 ) {
00317         timer = uis.realtime - postgameMenuInfo.starttime;
00318 
00319         if( timer >= 1000 && postgameMenuInfo.winnerSound ) {
00320             trap_S_StartLocalSound( postgameMenuInfo.winnerSound, CHAN_ANNOUNCER );
00321             postgameMenuInfo.winnerSound = 0;
00322         }
00323 
00324         if( timer < 5000 ) {
00325             return;
00326         }
00327         postgameMenuInfo.phase = 2;
00328         postgameMenuInfo.starttime = uis.realtime;
00329     }
00330 
00331     // phase 2
00332     if( postgameMenuInfo.phase == 2 ) {
00333         timer = uis.realtime - postgameMenuInfo.starttime;
00334         if( timer >= ( postgameMenuInfo.numAwards * AWARD_PRESENTATION_TIME ) ) {
00335 
00336             if( timer < 5000 ) {
00337                 return;
00338             }
00339 
00340             postgameMenuInfo.phase = 3;
00341             postgameMenuInfo.starttime = uis.realtime;
00342         }
00343         else {
00344             UI_SPPostgameMenu_DrawAwardsPresentation( timer );
00345         }
00346     }
00347 
00348     // phase 3
00349     if( postgameMenuInfo.phase == 3 ) {
00350         if( uis.demoversion ) {
00351             if( postgameMenuInfo.won == 1 && UI_ShowTierVideo( 8 )) {
00352                 trap_Cvar_Set( "nextmap", "" );
00353                 trap_Cmd_ExecuteText( EXEC_APPEND, "disconnect; cinematic demoEnd.RoQ\n" );
00354                 return;
00355             }
00356         }
00357         else if( postgameMenuInfo.won > -1 && UI_ShowTierVideo( postgameMenuInfo.won + 1 )) {
00358             if( postgameMenuInfo.won == postgameMenuInfo.lastTier ) {
00359                 trap_Cvar_Set( "nextmap", "" );
00360                 trap_Cmd_ExecuteText( EXEC_APPEND, "disconnect; cinematic end.RoQ\n" );
00361                 return;
00362             }
00363 
00364             trap_Cvar_SetValue( "ui_spSelection", postgameMenuInfo.won * ARENAS_PER_TIER );
00365             trap_Cvar_Set( "nextmap", "levelselect" );
00366             trap_Cmd_ExecuteText( EXEC_APPEND, va( "disconnect; cinematic tier%i.RoQ\n", postgameMenuInfo.won + 1 ) );
00367             return;
00368         }
00369 
00370         postgameMenuInfo.item_again.generic.flags &= ~QMF_INACTIVE;
00371         postgameMenuInfo.item_next.generic.flags &= ~QMF_INACTIVE;
00372         postgameMenuInfo.item_menu.generic.flags &= ~QMF_INACTIVE;
00373 
00374         UI_SPPostgameMenu_DrawAwardsMedals( postgameMenuInfo.numAwards );
00375 
00376         Menu_Draw( &postgameMenuInfo.menu );
00377     }
00378 
00379     // draw the scoreboard
00380     if( !trap_Cvar_VariableValue( "ui_spScoreboard" ) ) {
00381         return;
00382     }
00383 
00384     timer = uis.realtime - postgameMenuInfo.scoreboardtime;
00385     if( postgameMenuInfo.numClients <= 3 ) {
00386         n = 0;
00387     }
00388     else {
00389         n = timer / 1500 % (postgameMenuInfo.numClients + 2);
00390     }
00391     UI_SPPostgameMenu_MenuDrawScoreLine( n, 0 );
00392     UI_SPPostgameMenu_MenuDrawScoreLine( n + 1, 0 + SMALLCHAR_HEIGHT );
00393     UI_SPPostgameMenu_MenuDrawScoreLine( n + 2, 0 + 2 * SMALLCHAR_HEIGHT );
00394 }

Here is the call graph for this function:

void UI_SPPostgameMenu_MenuDrawScoreLine int  n,
int  y
[static]
 

Definition at line 265 of file ui_sppostgame.c.

References postgameMenuInfo_t::clientNums, color_white, CS_PLAYERS, Info_ValueForKey(), MAX_INFO_STRING, n, name, postgameMenuInfo_t::numClients, postgameMenuInfo, Q_CleanStr(), Q_strncpyz(), postgameMenuInfo_t::ranks, postgameMenuInfo_t::scores, SMALLCHAR_WIDTH, trap_GetConfigString(), UI_DrawString(), UI_LEFT, UI_SMALLFONT, va(), and y.

Referenced by UI_SPPostgameMenu_MenuDraw().

00265                                                                 {
00266     int     rank;
00267     char    name[64];
00268     char    info[MAX_INFO_STRING];
00269 
00270     if( n > (postgameMenuInfo.numClients + 1) ) {
00271         n -= (postgameMenuInfo.numClients + 2);
00272     }
00273 
00274     if( n >= postgameMenuInfo.numClients ) {
00275         return;
00276     }
00277 
00278     rank = postgameMenuInfo.ranks[n];
00279     if( rank & RANK_TIED_FLAG ) {
00280         UI_DrawString( 640 - 31 * SMALLCHAR_WIDTH, y, "(tie)", UI_LEFT|UI_SMALLFONT, color_white );
00281         rank &= ~RANK_TIED_FLAG;
00282     }
00283     trap_GetConfigString( CS_PLAYERS + postgameMenuInfo.clientNums[n], info, MAX_INFO_STRING );
00284     Q_strncpyz( name, Info_ValueForKey( info, "n" ), sizeof(name) );
00285     Q_CleanStr( name );
00286 
00287     UI_DrawString( 640 - 25 * SMALLCHAR_WIDTH, y, va( "#%i: %-16s %2i", rank + 1, name, postgameMenuInfo.scores[n] ), UI_LEFT|UI_SMALLFONT, color_white );
00288 }

Here is the call graph for this function:

void UI_SPPostgameMenu_MenuEvent void *  ptr,
int  event
[static]
 

Definition at line 164 of file ui_sppostgame.c.

References EXEC_APPEND, trap_Cmd_ExecuteText(), and UI_PopMenu().

00165 {
00166     if (event != QM_ACTIVATED) {
00167         return;
00168     }
00169     UI_PopMenu();
00170     trap_Cmd_ExecuteText( EXEC_APPEND, "disconnect; levelselect\n" );
00171 }

Here is the call graph for this function:

sfxHandle_t UI_SPPostgameMenu_MenuKey int  key  )  [static]
 

Definition at line 179 of file ui_sppostgame.c.

References EXEC_APPEND, postgameMenuInfo_t::ignoreKeysTime, K_ESCAPE, postgameMenuInfo_t::menu, Menu_DefaultKey(), postgameMenuInfo_t::phase, postgameMenuInfo, uiStatic_t::realtime, sfxHandle_t, postgameMenuInfo_t::starttime, trap_Cmd_ExecuteText(), and uis.

00179                                                         {
00180     if ( uis.realtime < postgameMenuInfo.ignoreKeysTime ) {
00181         return 0;
00182     }
00183 
00184     if( postgameMenuInfo.phase == 1 ) {
00185         trap_Cmd_ExecuteText( EXEC_APPEND, "abort_podium\n" );
00186         postgameMenuInfo.phase = 2;
00187         postgameMenuInfo.starttime = uis.realtime;
00188         postgameMenuInfo.ignoreKeysTime = uis.realtime + 250;
00189         return 0;
00190     }
00191 
00192     if( postgameMenuInfo.phase == 2 ) {
00193         postgameMenuInfo.phase = 3;
00194         postgameMenuInfo.starttime = uis.realtime;
00195         postgameMenuInfo.ignoreKeysTime = uis.realtime + 250;
00196         return 0;
00197     }
00198 
00199     if( key == K_ESCAPE || key == K_MOUSE2 ) {
00200         return 0;
00201     }
00202 
00203     return Menu_DefaultKey( &postgameMenuInfo.menu, key );
00204 }

Here is the call graph for this function:

void UI_SPPostgameMenu_NextEvent void *  ptr,
int  event
[static]
 

Definition at line 119 of file ui_sppostgame.c.

References postgameMenuInfo_t::level, level, postgameMenuInfo, UI_GetArenaInfoByNumber(), UI_GetCurrentGame(), UI_GetNumSPTiers(), UI_PopMenu(), UI_SPArena_Start(), and postgameMenuInfo_t::won.

00119                                                                 {
00120     int         currentSet;
00121     int         levelSet;
00122     int         level;
00123     int         currentLevel;
00124     const char  *arenaInfo;
00125 
00126     if (event != QM_ACTIVATED) {
00127         return;
00128     }
00129     UI_PopMenu();
00130 
00131     // handle specially if we just won the training map
00132     if( postgameMenuInfo.won == 0 ) {
00133         level = 0;
00134     }
00135     else {
00136         level = postgameMenuInfo.level + 1;
00137     }
00138     levelSet = level / ARENAS_PER_TIER;
00139 
00140     currentLevel = UI_GetCurrentGame();
00141     if( currentLevel == -1 ) {
00142         currentLevel = postgameMenuInfo.level;
00143     }
00144     currentSet = currentLevel / ARENAS_PER_TIER;
00145 
00146     if( levelSet > currentSet || levelSet == UI_GetNumSPTiers() ) {
00147         level = currentLevel;
00148     }
00149 
00150     arenaInfo = UI_GetArenaInfoByNumber( level );
00151     if ( !arenaInfo ) {
00152         return;
00153     }
00154 
00155     UI_SPArena_Start( arenaInfo );
00156 }

Here is the call graph for this function:


Variable Documentation

char arenainfo[MAX_INFO_VALUE] [static]
 

Definition at line 78 of file ui_sppostgame.c.

Referenced by UI_SPPostgameMenu_f().

int medalLocations[6] = {144, 448, 88, 504, 32, 560} [static]
 

Definition at line 207 of file ui_sppostgame.c.

Referenced by UI_SPPostgameMenu_DrawAwardsMedals().

postgameMenuInfo_t postgameMenuInfo [static]
 

Definition at line 77 of file ui_sppostgame.c.

Referenced by Prepname(), UI_SPPostgameMenu_DrawAwardsMedals(), UI_SPPostgameMenu_DrawAwardsPresentation(), UI_SPPostgameMenu_f(), UI_SPPostgameMenu_Init(), UI_SPPostgameMenu_MenuDraw(), UI_SPPostgameMenu_MenuDrawScoreLine(), UI_SPPostgameMenu_MenuKey(), and UI_SPPostgameMenu_NextEvent().

char* ui_medalNames[] = {"Accuracy", "Impressive", "Excellent", "Gauntlet", "Frags", "Perfect"}
 

Definition at line 80 of file ui_sppostgame.c.

char* ui_medalPicNames[]
 

Initial value:

 {
    "menu/medals/medal_accuracy",
    "menu/medals/medal_impressive",
    "menu/medals/medal_excellent",
    "menu/medals/medal_gauntlet",
    "menu/medals/medal_frags",
    "menu/medals/medal_victory"
}

Definition at line 81 of file ui_sppostgame.c.

char* ui_medalSounds[]
 

Initial value:

 {
    "sound/feedback/accuracy.wav",
    "sound/feedback/impressive_a.wav",
    "sound/feedback/excellent_a.wav",
    "sound/feedback/gauntlet.wav",
    "sound/feedback/frags.wav",
    "sound/feedback/perfect.wav"
}

Definition at line 89 of file ui_sppostgame.c.


Generated on Thu Aug 25 14:35:17 2005 for Quake III Arena by  doxygen 1.3.9.1