示例#1
0
/*
=================
UI_SPPostgameMenu_f
=================
*/
void UI_SPPostgameMenu_f( void ) {
	int			playerGameRank;
//	int			oldFrags, newFrags;
	const char	*arena;
	char		map[MAX_QPATH];
	char		info[MAX_INFO_STRING];

	Mouse_Show();

	memset( &postgameMenuInfo, 0, sizeof(postgameMenuInfo) );

	trap_GetConfigString( CS_SYSTEMINFO, info, sizeof(info) );
	postgameMenuInfo.serverId = atoi( Info_ValueForKey( info, "sv_serverid" ) );

	postgameMenuInfo.menu.nobackground = qtrue;

	trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) );
	Q_strncpyz( map, Info_ValueForKey( info, "mapname" ), sizeof(map) );
	arena = UI_GetArenaInfoByMap( map );
	if ( !arena ) {
		return;
	}
	Q_strncpyz( arenainfo, arena, sizeof(arenainfo) );

	postgameMenuInfo.level = atoi( Info_ValueForKey( arenainfo, "num" ) );

	playerGameRank = 8;		// in case they ended game as a spectator
	playerGameRank = atoi( UI_Argv(1));

	UI_SetBestScore( postgameMenuInfo.level, playerGameRank+1 );

	postgameMenuInfo.starttime = uis.realtime;
	postgameMenuInfo.scoreboardtime = uis.realtime;

	trap_Key_SetCatcher( KEYCATCH_UI );
	uis.menusp = 0;

	UI_SPPostgameMenu_Init();
	UI_PushMenu( &postgameMenuInfo.menu );

	if (playerGameRank == 0) 
	{
		postgameMenuInfo.won = 1;
		Menu_SetCursorToItem( &postgameMenuInfo.menu, &postgameMenuInfo.item_next );
	}
	else {
		Menu_SetCursorToItem( &postgameMenuInfo.menu, &postgameMenuInfo.item_menu );
	}

//	trap_Cmd_ExecuteText( EXEC_APPEND, "music music/win\n" );	//?? always win?  should this be deleted and playing cg_scoreboard now?

	postgameMenuInfo.lastTier = UI_GetNumSPTiers();
	if ( UI_GetSpecialArenaInfo( "final" ) ) {
		postgameMenuInfo.lastTier++;
	}
}
示例#2
0
void UI_PlayerModelMenu(int localClient) {
	PlayerModel_MenuInit(localClient);

	UI_PushMenu( &s_playermodel.menu );

	Menu_SetCursorToItem( &s_playermodel.menu, &s_playermodel.pics[s_playermodel.selectedmodel % MAX_MODELSPERPAGE] );
}
示例#3
0
文件: sound.c 项目: icanhas/yantar
/*
 * UI_SoundOptionsMenu
 */
void
UI_SoundOptionsMenu(void)
{
	UI_SoundOptionsMenu_Init();
	UI_PushMenu(&soundOptionsInfo.menu);
	Menu_SetCursorToItem(&soundOptionsInfo.menu, &soundOptionsInfo.sound);
}
示例#4
0
/*
===============
UI_CinematicsMenu_f
===============
*/
void UI_CinematicsMenu_f( void ) {
	int		n;

	n = atoi( UI_Argv( 1 ) );
	UI_CinematicsMenu();
	Menu_SetCursorToItem( &cinematicsMenuInfo.menu, cinematicsMenuInfo.menu.items[n + 3] );
}
示例#5
0
/*
=================
UI_ResetMenu
=================
*/
void UI_ResetMenu(void) {
	uiClientState_t	cstate;
	int	n1, n2, n3;
	int	l1, l2, l3;

	// zero set all our globals
	memset( &s_reset, 0, sizeof(s_reset) );

	Reset_Cache();

	n1 = UI_ProportionalStringWidth( "YES/NO" );
	n2 = UI_ProportionalStringWidth( "YES" ) + PROP_GAP_WIDTH;
	n3 = UI_ProportionalStringWidth( "/" )  + PROP_GAP_WIDTH;
	l1 = 320 - ( n1 / 2 );
	l2 = l1 + n2;
	l3 = l2 + n3;
	s_reset.slashX = l2;

	s_reset.menu.draw       = Reset_MenuDraw;
	s_reset.menu.key        = Reset_MenuKey;
	s_reset.menu.wrapAround = qtrue;

	trap_GetClientState( &cstate );

	if ( cstate.connState >= CA_CONNECTED ) {
		// float on top of running game
		s_reset.menu.fullscreen = qfalse;
	}
	else {
		// game not running
		s_reset.menu.fullscreen = qtrue;
	}

	s_reset.yes.generic.type		= MTYPE_PTEXT;      
	s_reset.yes.generic.flags		= QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS; 
	s_reset.yes.generic.callback	= Reset_MenuEvent;
	s_reset.yes.generic.id			= ID_YES;
	s_reset.yes.generic.x			= l1;
	s_reset.yes.generic.y			= 264;
	s_reset.yes.string				= "YES";
	s_reset.yes.color				= color_red;
	s_reset.yes.style				= UI_LEFT;

	s_reset.no.generic.type			= MTYPE_PTEXT;      
	s_reset.no.generic.flags		= QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS; 
	s_reset.no.generic.callback		= Reset_MenuEvent;
	s_reset.no.generic.id			= ID_NO;
	s_reset.no.generic.x		    = l3;
	s_reset.no.generic.y		    = 264;
	s_reset.no.string				= "NO";
	s_reset.no.color			    = color_red;
	s_reset.no.style			    = UI_LEFT;

	Menu_AddItem( &s_reset.menu,	&s_reset.yes );             
	Menu_AddItem( &s_reset.menu,	&s_reset.no );

	UI_PushMenu( &s_reset.menu );

	Menu_SetCursorToItem( &s_reset.menu, &s_reset.no );
}
示例#6
0
void UI_SPSkillMenu(const char *arenaInfo)
{
	UI_SPSkillMenu_Init();
	skillMenuInfo.arenaInfo = arenaInfo;
	UI_PushMenu(&skillMenuInfo.menu);
	Menu_SetCursorToItem(&skillMenuInfo.menu, &skillMenuInfo.item_fight);
}
示例#7
0
文件: network.c 项目: icanhas/yantar
/*
 * UI_NetworkOptionsMenu
 */
void
UI_NetworkOptionsMenu(void)
{
	UI_NetworkOptionsMenu_Init();
	UI_PushMenu(&networkOptionsInfo.menu);
	Menu_SetCursorToItem(&networkOptionsInfo.menu,
		&networkOptionsInfo.network);
}
示例#8
0
void UI_PlayerModelMenu(void)
{
	PlayerModel_MenuInit();
	uis.menuamount = 1;
	uis.showFrame = qfalse;
	uis.hideEarth = qtrue;	
	UI_PushMenu( &s_playermodel.menu );

	Menu_SetCursorToItem( &s_playermodel.menu, &s_playermodel.pics[s_playermodel.selectedmodel % MAX_MODELSPERPAGE] );
}
示例#9
0
/*
=================
UI_SPLevelMenu
=================
*/
void UI_SPLevelMenu( void ) {
	int			level;
	int			trainingLevel;
	const char	*arenaInfo;

	trainingTier = -1;
	arenaInfo = UI_GetSpecialArenaInfo( "training" );
	if( arenaInfo ) {
		minTier = trainingTier;
		trainingLevel = atoi( Info_ValueForKey( arenaInfo, "num" ) );
	}
	else {
		minTier = 0;
		trainingLevel = -2;
	}

	finalTier = UI_GetNumSPTiers();
	arenaInfo = UI_GetSpecialArenaInfo( "final" );
	if( arenaInfo ) {
		maxTier = finalTier;
	}
	else {
		maxTier = finalTier - 1;
		if( maxTier < minTier ) {
			maxTier = minTier;
		}
	}

	level = UI_GetCurrentGame();
	if ( level == -1 ) {
		level = UI_GetNumSPArenas() - 1;
		if( maxTier == finalTier ) {
			level++;
		}
	}

	if( level == trainingLevel ) {
		currentSet = -1;
		currentGame = 0;
	}
	else {
		currentSet = level / ARENAS_PER_TIER;
		currentGame = level % ARENAS_PER_TIER;
	}

	UI_SPLevelMenu_Init();
	UI_PushMenu( &levelMenuInfo.menu );
	Menu_SetCursorToItem( &levelMenuInfo.menu, &levelMenuInfo.item_next );
}
/*
=================
UI_Message
hacked over from Confirm stuff
=================
*/
void UI_Message( const char **lines ) {
	uiClientState_t	cstate;
	int n1, l1;
	
	// zero set all our globals
	memset( &s_confirm, 0, sizeof(s_confirm) );

	ConfirmMenu_Cache();

	n1 = UI_ProportionalStringWidth( "OK" );
	l1 = 320 - ( n1 / 2 );
	
	s_confirm.lines = lines;
	s_confirm.style = UI_CENTER|UI_INVERSE|UI_SMALLFONT;

	s_confirm.menu.draw       = MessageMenu_Draw;
	s_confirm.menu.key        = ConfirmMenu_Key;
	s_confirm.menu.wrapAround = qtrue;
	
	trap_GetClientState( &cstate );
	if ( cstate.connState >= CA_CONNECTED ) {
		s_confirm.menu.fullscreen = qfalse;
	}
	else {
		s_confirm.menu.fullscreen = qtrue;
	}

	s_confirm.yes.generic.type		= MTYPE_PTEXT;      
	s_confirm.yes.generic.flags		= QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS; 
	s_confirm.yes.generic.callback	= ConfirmMenu_Event;
	s_confirm.yes.generic.id		= ID_CONFIRM_YES;
	s_confirm.yes.generic.x			= l1;
	s_confirm.yes.generic.y			= 280;
	s_confirm.yes.string			= "OK";
	s_confirm.yes.color				= color_red;
	s_confirm.yes.style				= UI_LEFT;

	Menu_AddItem( &s_confirm.menu,	&s_confirm.yes );
	
	UI_PushMenu( &s_confirm.menu );

	Menu_SetCursorToItem( &s_confirm.menu, &s_confirm.yes );
}
示例#11
0
/*
=================
UI_GraphicsOptionsMenu
=================
*/
void UI_GraphicsOptionsMenu(void)
{
	GraphicsOptions_MenuInit();
	UI_PushMenu(&s_graphicsoptions.menu);
	Menu_SetCursorToItem(&s_graphicsoptions.menu, &s_graphicsoptions.graphics);
}
/*
=================
UI_ConfirmMenu_Stlye
=================
*/
void UI_ConfirmMenu_Style( const char *question, int style, void (*draw)( void ), void (*action)( qboolean result ) ) {
	uiClientState_t	cstate;
	int	n1, n2, n3;
	int	l1, l2, l3;

	// zero set all our globals
	memset( &s_confirm, 0, sizeof(s_confirm) );

	ConfirmMenu_Cache();

	n1 = UI_ProportionalStringWidth( "YES/NO" );
	n2 = UI_ProportionalStringWidth( "YES" ) + PROP_GAP_WIDTH;
	n3 = UI_ProportionalStringWidth( "/" )  + PROP_GAP_WIDTH;
	l1 = 320 - ( n1 / 2 );
	l2 = l1 + n2;
	l3 = l2 + n3;
	s_confirm.slashX = l2;

	s_confirm.question = question;
	s_confirm.draw = draw;
	s_confirm.action = action;
	s_confirm.style = style;

	s_confirm.menu.draw       = ConfirmMenu_Draw;
	s_confirm.menu.key        = ConfirmMenu_Key;
	s_confirm.menu.wrapAround = qtrue;

	trap_GetClientState( &cstate );
	if ( cstate.connState >= CA_CONNECTED ) {
		s_confirm.menu.fullscreen = qfalse;
	}
	else {
		s_confirm.menu.fullscreen = qtrue;
	}

	s_confirm.yes.generic.type		= MTYPE_PTEXT;      
	s_confirm.yes.generic.flags		= QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS; 
	s_confirm.yes.generic.callback	= ConfirmMenu_Event;
	s_confirm.yes.generic.id		= ID_CONFIRM_YES;
	s_confirm.yes.generic.x			= l1;
	s_confirm.yes.generic.y			= 264;
	s_confirm.yes.string			= "YES";
	s_confirm.yes.color				= color_red;
	s_confirm.yes.style				= UI_LEFT;

	s_confirm.no.generic.type		= MTYPE_PTEXT;      
	s_confirm.no.generic.flags		= QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS; 
	s_confirm.no.generic.callback	= ConfirmMenu_Event;
	s_confirm.no.generic.id			= ID_CONFIRM_NO;
	s_confirm.no.generic.x		    = l3;
	s_confirm.no.generic.y		    = 264;
	s_confirm.no.string				= "NO";
	s_confirm.no.color			    = color_red;
	s_confirm.no.style			    = UI_LEFT;

	Menu_AddItem( &s_confirm.menu,	&s_confirm.yes );             
	Menu_AddItem( &s_confirm.menu,	&s_confirm.no );

	UI_PushMenu( &s_confirm.menu );

	Menu_SetCursorToItem( &s_confirm.menu, &s_confirm.no );
}
示例#13
0
/*
===============
UI_LoadoutMenu_Init
===============
 */
static void UI_LoadoutMenu_Init(void) {
    int y;
    UI_LoadoutMenu_Cache();

    memset(&loadoutMenuInfo, 0, sizeof (loadoutMenuInfo));
    loadoutMenuInfo.menu.wrapAround = qtrue;
    loadoutMenuInfo.menu.fullscreen = qfalse;

    loadoutMenuInfo.banner.generic.type = MTYPE_BTEXT;
    loadoutMenuInfo.banner.generic.x = 320;
    loadoutMenuInfo.banner.generic.y = 16;
    loadoutMenuInfo.banner.string = "WEAPONS";
    loadoutMenuInfo.banner.color = color_white;
    loadoutMenuInfo.banner.style = UI_CENTER;

    loadoutMenuInfo.frame.generic.type = MTYPE_BITMAP;
    loadoutMenuInfo.frame.generic.name = ART_FRAME;
    loadoutMenuInfo.frame.generic.flags = QMF_INACTIVE;
    loadoutMenuInfo.frame.generic.x = 32;
    loadoutMenuInfo.frame.generic.y = 24;
    loadoutMenuInfo.frame.width = 576;
    loadoutMenuInfo.frame.height = 432;

    y = 64;
    loadoutMenuInfo.barrett.generic.type = MTYPE_PTEXT;
    loadoutMenuInfo.barrett.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;
    loadoutMenuInfo.barrett.generic.callback = UI_LoadoutMenu_Event;
    loadoutMenuInfo.barrett.generic.id = ID_BARRETT;
    loadoutMenuInfo.barrett.generic.x = 32;
    loadoutMenuInfo.barrett.generic.y = y;
    loadoutMenuInfo.barrett.string = "Barrett M82A1";
    loadoutMenuInfo.barrett.color = color_white;
    loadoutMenuInfo.barrett.style = UI_LEFT | UI_SMALLFONT;

    y += WEAPON_SPACING;
    loadoutMenuInfo.intervention.generic.type = MTYPE_PTEXT;
    loadoutMenuInfo.intervention.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;
    loadoutMenuInfo.intervention.generic.callback = UI_LoadoutMenu_Event;
    loadoutMenuInfo.intervention.generic.id = ID_INTERVENTION;
    loadoutMenuInfo.intervention.generic.x = 32;
    loadoutMenuInfo.intervention.generic.y = y;
    loadoutMenuInfo.intervention.string = "Cheytac M200 Intervention";
    loadoutMenuInfo.intervention.color = color_white;
    loadoutMenuInfo.intervention.style = UI_LEFT | UI_SMALLFONT;

    y += WEAPON_SPACING;
    loadoutMenuInfo.crossbow.generic.type = MTYPE_PTEXT;
    loadoutMenuInfo.crossbow.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;
    loadoutMenuInfo.crossbow.generic.callback = UI_LoadoutMenu_Event;
    loadoutMenuInfo.crossbow.generic.id = ID_CROSSBOW;
    loadoutMenuInfo.crossbow.generic.x = 32;
    loadoutMenuInfo.crossbow.generic.y = y;
    loadoutMenuInfo.crossbow.string = "Crossbow";
    loadoutMenuInfo.crossbow.color = color_white;
    loadoutMenuInfo.crossbow.style = UI_LEFT | UI_SMALLFONT;

    y += WEAPON_SPACING;
    loadoutMenuInfo.acr.generic.type = MTYPE_PTEXT;
    loadoutMenuInfo.acr.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;
    loadoutMenuInfo.acr.generic.callback = UI_LoadoutMenu_Event;
    loadoutMenuInfo.acr.generic.id = ID_ACR;
    loadoutMenuInfo.acr.generic.x = 32;
    loadoutMenuInfo.acr.generic.y = y;
    loadoutMenuInfo.acr.string = "Remington ACR";
    loadoutMenuInfo.acr.color = color_white;
    loadoutMenuInfo.acr.style = UI_LEFT | UI_SMALLFONT;

    y += WEAPON_SPACING * 2;
    loadoutMenuInfo.walther.generic.type = MTYPE_PTEXT;
    loadoutMenuInfo.walther.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;
    loadoutMenuInfo.walther.generic.callback = UI_LoadoutMenu_Event;
    loadoutMenuInfo.walther.generic.id = ID_WALTHER;
    loadoutMenuInfo.walther.generic.x = 32;
    loadoutMenuInfo.walther.generic.y = y;
    loadoutMenuInfo.walther.string = "Walther P22";
    loadoutMenuInfo.walther.color = color_white;
    loadoutMenuInfo.walther.style = UI_LEFT | UI_SMALLFONT;

    y += WEAPON_SPACING * 2;
    loadoutMenuInfo.he.generic.type = MTYPE_PTEXT;
    loadoutMenuInfo.he.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;
    loadoutMenuInfo.he.generic.callback = UI_LoadoutMenu_Event;
    loadoutMenuInfo.he.generic.id = ID_HE;
    loadoutMenuInfo.he.generic.x = 32;
    loadoutMenuInfo.he.generic.y = y;
    loadoutMenuInfo.he.string = "High-Explosive Grenade";
    loadoutMenuInfo.he.color = color_white;
    loadoutMenuInfo.he.style = UI_LEFT | UI_SMALLFONT;

    y += WEAPON_SPACING * 2;
    loadoutMenuInfo.bomb.generic.type = MTYPE_PTEXT;
    loadoutMenuInfo.bomb.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;
    loadoutMenuInfo.bomb.generic.callback = UI_LoadoutMenu_Event;
    loadoutMenuInfo.bomb.generic.id = ID_BOMB;
    loadoutMenuInfo.bomb.generic.x = 32;
    loadoutMenuInfo.bomb.generic.y = y;
    loadoutMenuInfo.bomb.string = "C4 Device";
    loadoutMenuInfo.bomb.color = color_white;
    loadoutMenuInfo.bomb.style = UI_LEFT | UI_SMALLFONT;

    y += WEAPON_SPACING;
    loadoutMenuInfo.injector.generic.type = MTYPE_PTEXT;
    loadoutMenuInfo.injector.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;
    loadoutMenuInfo.injector.generic.callback = UI_LoadoutMenu_Event;
    loadoutMenuInfo.injector.generic.id = ID_INJECTOR;
    loadoutMenuInfo.injector.generic.x = 32;
    loadoutMenuInfo.injector.generic.y = y;
    loadoutMenuInfo.injector.string = "Adrenaline Injector";
    loadoutMenuInfo.injector.color = color_white;
    loadoutMenuInfo.injector.style = UI_LEFT | UI_SMALLFONT;

    y += WEAPON_SPACING * 2;
    loadoutMenuInfo.clear.generic.type = MTYPE_PTEXT;
    loadoutMenuInfo.clear.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;
    loadoutMenuInfo.clear.generic.callback = UI_LoadoutMenu_Event;
    loadoutMenuInfo.clear.generic.id = ID_CLEAR;
    loadoutMenuInfo.clear.generic.x = 32;
    loadoutMenuInfo.clear.generic.y = y;
    loadoutMenuInfo.clear.string = "Clear Loadout";
    loadoutMenuInfo.clear.color = color_yellow;
    loadoutMenuInfo.clear.style = UI_LEFT | UI_SMALLFONT;

    loadoutMenuInfo.accept.generic.type = MTYPE_BITMAP;
    loadoutMenuInfo.accept.generic.name = ART_ACCEPT0;
    loadoutMenuInfo.accept.generic.flags = QMF_RIGHT_JUSTIFY | QMF_PULSEIFFOCUS;
    loadoutMenuInfo.accept.generic.id = ID_ACCEPT;
    loadoutMenuInfo.accept.generic.callback = UI_LoadoutMenu_Event;
    loadoutMenuInfo.accept.generic.x = 640;
    loadoutMenuInfo.accept.generic.y = 480 - 64;
    loadoutMenuInfo.accept.width = 128;
    loadoutMenuInfo.accept.height = 64;
    loadoutMenuInfo.accept.focuspic = ART_ACCEPT1;

    loadoutMenuInfo.back.generic.type = MTYPE_BITMAP;
    loadoutMenuInfo.back.generic.name = ART_BACK0;
    loadoutMenuInfo.back.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;
    loadoutMenuInfo.back.generic.id = ID_BACK;
    loadoutMenuInfo.back.generic.callback = UI_LoadoutMenu_Event;
    loadoutMenuInfo.back.generic.x = 0;
    loadoutMenuInfo.back.generic.y = 480 - 64;
    loadoutMenuInfo.back.width = 128;
    loadoutMenuInfo.back.height = 64;
    loadoutMenuInfo.back.focuspic = ART_BACK1;

    loadoutMenuInfo.frame.generic.ownerdraw = UI_LoadoutMenu_DrawWeapons;

    Menu_AddItem(&loadoutMenuInfo.menu, &loadoutMenuInfo.banner);
    Menu_AddItem(&loadoutMenuInfo.menu, &loadoutMenuInfo.frame);

    Menu_AddItem(&loadoutMenuInfo.menu, &loadoutMenuInfo.barrett);
    Menu_AddItem(&loadoutMenuInfo.menu, &loadoutMenuInfo.intervention);
    Menu_AddItem(&loadoutMenuInfo.menu, &loadoutMenuInfo.crossbow);
    Menu_AddItem(&loadoutMenuInfo.menu, &loadoutMenuInfo.acr);

    Menu_AddItem(&loadoutMenuInfo.menu, &loadoutMenuInfo.walther);

    Menu_AddItem(&loadoutMenuInfo.menu, &loadoutMenuInfo.he);

    Menu_AddItem(&loadoutMenuInfo.menu, &loadoutMenuInfo.bomb);
    Menu_AddItem(&loadoutMenuInfo.menu, &loadoutMenuInfo.injector);

    Menu_AddItem(&loadoutMenuInfo.menu, &loadoutMenuInfo.clear);
    Menu_AddItem(&loadoutMenuInfo.menu, &loadoutMenuInfo.accept);
    Menu_AddItem(&loadoutMenuInfo.menu, &loadoutMenuInfo.back);

    UI_PushMenu(&loadoutMenuInfo.menu);

    Menu_SetCursorToItem(&loadoutMenuInfo.menu, &loadoutMenuInfo.barrett);
}
示例#14
0
/*
===============
UI_DisplayOptionsMenu
===============
*/
void UI_DisplayOptionsMenu( void ) {
	UI_DisplayOptionsMenu_Init();
	UI_PushMenu( &displayOptionsInfo.menu );
	Menu_SetCursorToItem( &displayOptionsInfo.menu, &displayOptionsInfo.display );
}
/*
=================
UI_SPPostgameMenu_f
=================
*/
void UI_SPPostgameMenu_f( void ) {
    int			playerGameRank;
    int			playerClientNum;
    int			n;
    int			oldFrags, newFrags;
    const char	*arena;
    int			awardValues[6];
    char		map[MAX_QPATH];
    char		info[MAX_INFO_STRING];

    memset( &postgameMenuInfo, 0, sizeof(postgameMenuInfo) );

    trap_GetConfigString( CS_SYSTEMINFO, info, sizeof(info) );
    postgameMenuInfo.serverId = atoi( Info_ValueForKey( info, "sv_serverid" ) );

    trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) );
    Q_strncpyz( map, Info_ValueForKey( info, "mapname" ), sizeof(map) );
    arena = UI_GetArenaInfoByMap( map );
    if ( !arena ) {
        return;
    }
    Q_strncpyz( arenainfo, arena, sizeof(arenainfo) );

    postgameMenuInfo.level = atoi( Info_ValueForKey( arenainfo, "num" ) );

    postgameMenuInfo.numClients = atoi( UI_Argv( 1 ) );
    playerClientNum = atoi( UI_Argv( 2 ) );
    playerGameRank = 8;		// in case they ended game as a spectator

    if( postgameMenuInfo.numClients > MAX_SCOREBOARD_CLIENTS ) {
        postgameMenuInfo.numClients = MAX_SCOREBOARD_CLIENTS;
    }

    for( n = 0; n < postgameMenuInfo.numClients; n++ ) {
        postgameMenuInfo.clientNums[n] = atoi( UI_Argv( 8 + n * 3 + 1 ) );
        postgameMenuInfo.ranks[n] = atoi( UI_Argv( 8 + n * 3 + 2 ) );
        postgameMenuInfo.scores[n] = atoi( UI_Argv( 8 + n * 3 + 3 ) );

        if( postgameMenuInfo.clientNums[n] == playerClientNum ) {
            playerGameRank = (postgameMenuInfo.ranks[n] & ~RANK_TIED_FLAG) + 1;
        }
    }

    UI_SetBestScore( postgameMenuInfo.level, playerGameRank );

    // process award stats and prepare presentation data
    awardValues[AWARD_ACCURACY] = atoi( UI_Argv( 3 ) );
    awardValues[AWARD_IMPRESSIVE] = atoi( UI_Argv( 4 ) );
    awardValues[AWARD_EXCELLENT] = atoi( UI_Argv( 5 ) );
    awardValues[AWARD_GAUNTLET] = atoi( UI_Argv( 6 ) );
    awardValues[AWARD_FRAGS] = atoi( UI_Argv( 7 ) );
    awardValues[AWARD_PERFECT] = atoi( UI_Argv( 8 ) );

    postgameMenuInfo.numAwards = 0;

    if( awardValues[AWARD_ACCURACY] >= 50 ) {
        UI_LogAwardData( AWARD_ACCURACY, 1 );
        postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_ACCURACY;
        postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = awardValues[AWARD_ACCURACY];
        postgameMenuInfo.numAwards++;
    }

    if( awardValues[AWARD_IMPRESSIVE] ) {
        UI_LogAwardData( AWARD_IMPRESSIVE, awardValues[AWARD_IMPRESSIVE] );
        postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_IMPRESSIVE;
        postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = awardValues[AWARD_IMPRESSIVE];
        postgameMenuInfo.numAwards++;
    }

    if( awardValues[AWARD_EXCELLENT] ) {
        UI_LogAwardData( AWARD_EXCELLENT, awardValues[AWARD_EXCELLENT] );
        postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_EXCELLENT;
        postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = awardValues[AWARD_EXCELLENT];
        postgameMenuInfo.numAwards++;
    }

    if( awardValues[AWARD_GAUNTLET] ) {
        UI_LogAwardData( AWARD_GAUNTLET, awardValues[AWARD_GAUNTLET] );
        postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_GAUNTLET;
        postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = awardValues[AWARD_GAUNTLET];
        postgameMenuInfo.numAwards++;
    }

    oldFrags = UI_GetAwardLevel( AWARD_FRAGS ) / 100;
    UI_LogAwardData( AWARD_FRAGS, awardValues[AWARD_FRAGS] );
    newFrags = UI_GetAwardLevel( AWARD_FRAGS ) / 100;
    if( newFrags > oldFrags ) {
        postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_FRAGS;
        postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = newFrags * 100;
        postgameMenuInfo.numAwards++;
    }

    if( awardValues[AWARD_PERFECT] ) {
        UI_LogAwardData( AWARD_PERFECT, 1 );
        postgameMenuInfo.awardsEarned[postgameMenuInfo.numAwards] = AWARD_PERFECT;
        postgameMenuInfo.awardsLevels[postgameMenuInfo.numAwards] = 1;
        postgameMenuInfo.numAwards++;
    }

    if ( playerGameRank == 1 ) {
        postgameMenuInfo.won = UI_TierCompleted( postgameMenuInfo.level );
    }
    else {
        postgameMenuInfo.won = -1;
    }

    postgameMenuInfo.starttime = uis.realtime;
    postgameMenuInfo.scoreboardtime = uis.realtime;

    trap_Key_SetCatcher( KEYCATCH_UI );
    uis.menusp = 0;

    UI_SPPostgameMenu_Init();
    UI_PushMenu( &postgameMenuInfo.menu );

    if ( playerGameRank == 1 ) {
        Menu_SetCursorToItem( &postgameMenuInfo.menu, &postgameMenuInfo.item_next );
    }
    else {
        Menu_SetCursorToItem( &postgameMenuInfo.menu, &postgameMenuInfo.item_again );
    }

    Prepname( 0 );
    Prepname( 1 );
    Prepname( 2 );

    if ( playerGameRank != 1 ) {
        postgameMenuInfo.winnerSound = trap_S_RegisterSound( va( "sound/player/announce/%s_wins.wav", postgameMenuInfo.placeNames[0] ), qfalse );
        trap_Cmd_ExecuteText( EXEC_APPEND, "music music/loss\n" );
    }
    else {
        postgameMenuInfo.winnerSound = trap_S_RegisterSound( "sound/player/announce/youwin.wav", qfalse );
        trap_Cmd_ExecuteText( EXEC_APPEND, "music music/win\n" );
    }

    postgameMenuInfo.phase = 1;

    postgameMenuInfo.lastTier = UI_GetNumSPTiers();
    if ( UI_GetSpecialArenaInfo( "final" ) ) {
        postgameMenuInfo.lastTier++;
    }
}