您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ trap_GetConfigString函数代码示例

51自学网 2021-06-03 08:57:46
  C++
这篇教程C++ trap_GetConfigString函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中trap_GetConfigString函数的典型用法代码示例。如果您正苦于以下问题:C++ trap_GetConfigString函数的具体用法?C++ trap_GetConfigString怎么用?C++ trap_GetConfigString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了trap_GetConfigString函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: UI_TeamOrdersMenu_f

/*===============UI_TeamOrdersMenu_f===============*/void UI_TeamOrdersMenu_f(void){	uiClientState_t	cs;	char	info[MAX_INFO_STRING];	int		team;	// make sure it's a team game	trap_GetConfigString(CS_SERVERINFO, info, sizeof(info));	teamOrdersMenuInfo.gametype = atoi(Info_ValueForKey(info, "g_gametype"));	if (teamOrdersMenuInfo.gametype < GT_TEAM)	{		return;	}	// not available to spectators	trap_GetClientState(&cs);	trap_GetConfigString(CS_PLAYERS + cs.clientNum, info, MAX_INFO_STRING);	team = atoi(Info_ValueForKey(info, "t"));	if (team == TEAM_SPECTATOR)	{		return;	}	UI_TeamOrdersMenu();}
开发者ID:ElderPlayerX,项目名称:Invasion,代码行数:30,


示例2: UI_TeamOrdersMenu_BuildBotList

/*===============UI_TeamOrdersMenu_BuildBotList===============*/static void UI_TeamOrdersMenu_BuildBotList(void){	uiClientState_t	cs;	int		numPlayers;	int		isBot;	int		n;	char	playerTeam;	char	botTeam;	char	info[MAX_INFO_STRING];	for (n = 0; n < 9; n++)	{		teamOrdersMenuInfo.bots[n] = teamOrdersMenuInfo.botNames[n];	}	trap_GetClientState(&cs);	Q_strncpyz(teamOrdersMenuInfo.botNames[0], "Everyone", 16);	teamOrdersMenuInfo.numBots = 1;	trap_GetConfigString(CS_SERVERINFO, info, sizeof(info));	numPlayers = atoi(Info_ValueForKey(info, "sv_maxclients"));	teamOrdersMenuInfo.gametype = atoi(Info_ValueForKey(info, "g_gametype"));	//Too: get the player team before the loop, so If player enter after bots in game, the menu still works !	trap_GetConfigString(CS_PLAYERS + cs.clientNum, info, MAX_INFO_STRING);	playerTeam = *Info_ValueForKey(info, "t");	for (n = 0; n < numPlayers && teamOrdersMenuInfo.numBots < 9; n++)	{		trap_GetConfigString(CS_PLAYERS + n, info, MAX_INFO_STRING);		//playerTeam = TEAM_SPECTATOR; // bk001204 = possible uninit use		/*if (n == cs.clientNum)		{			playerTeam = *Info_ValueForKey(info, "t");			continue;		}*/		isBot = atoi(Info_ValueForKey(info, "skill"));		if (!isBot)		{			continue;		}		botTeam = *Info_ValueForKey(info, "t");		if (botTeam != playerTeam)		{			continue;		}		Q_strncpyz(teamOrdersMenuInfo.botNames[teamOrdersMenuInfo.numBots], Info_ValueForKey(info, "n"), 16);		Q_CleanStr(teamOrdersMenuInfo.botNames[teamOrdersMenuInfo.numBots]);		teamOrdersMenuInfo.numBots++;	}}
开发者ID:ElderPlayerX,项目名称:Invasion,代码行数:62,


示例3: UI_SPPostgameMenu_f

/*=================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++;	}}
开发者ID:gitter-badger,项目名称:rpgxEF,代码行数:61,


示例4: UI_ServerInfo

void UI_ServerInfo( void ){  char      info[ MAX_INFO_VALUE ];  info[0] = '/0';  if( trap_GetConfigString( CS_SERVERINFO, info, sizeof( info ) ) )  {    trap_Cvar_Set( "ui_serverinfo_mapname",                   Info_ValueForKey( info, "mapname" ) );    trap_Cvar_Set( "ui_serverinfo_timelimit",                   Info_ValueForKey( info, "timelimit" ) );    trap_Cvar_Set( "ui_serverinfo_sd",                   Info_ValueForKey( info, "g_suddenDeathTime" ) );    trap_Cvar_Set( "ui_serverinfo_hostname",                   Info_ValueForKey( info, "sv_hostname" ) );    trap_Cvar_Set( "ui_serverinfo_maxclients",                   Info_ValueForKey( info, "sv_maxclients" ) );    trap_Cvar_Set( "ui_serverinfo_version",                   Info_ValueForKey( info, "version" ) );    trap_Cvar_Set( "ui_serverinfo_unlagged",                   Info_ValueForKey( info, "g_unlagged" ) );    trap_Cvar_Set( "ui_serverinfo_ff",                   Info_ValueForKey( info, "ff" ) );  }}
开发者ID:AlienHoboken,项目名称:Tremulous-xserverx-tremded,代码行数:26,


示例5: UI_TurboliftMenu_LoadDecks

static void UI_TurboliftMenu_LoadDecks( void ){	char	buffer[MAX_TOKEN_CHARS];	int		i;	char	*temp;	s_turbolift.numDecks = 0;	//load the string	trap_GetConfigString( CS_TURBOLIFT_DATA, buffer, sizeof( buffer ) );	if ( !buffer[0] )		return;	memset( &s_turbolift.deckData, 0, sizeof( s_turbolift.deckData ) );	for ( i=0; i < MAX_DECKS; i++ )	{		temp = Info_ValueForKey( buffer, va( "d%i", i ) );		if ( !temp[0] )			break;		s_turbolift.deckData[ s_turbolift.numDecks ].deckNum = atoi( temp );		temp = Info_ValueForKey( buffer, va( "n%i", i ) );		Q_strncpyz( s_turbolift.deckData[ s_turbolift.numDecks ].deckDesc, temp, sizeof( s_turbolift.deckData[ s_turbolift.numDecks ].deckDesc ) );				s_turbolift.numDecks++;	}	//TiM - sort the decks into their sequential order	qsort( s_turbolift.deckData, s_turbolift.numDecks, sizeof( deckData_t ), SortDecks );}
开发者ID:gitter-badger,项目名称:rpgxEF,代码行数:35,


示例6: UI_ServerInfo

void UI_ServerInfo( void ){  char      info[ MAX_INFO_VALUE ];  char      hostname[MAX_HOSTNAME_LENGTH];  info[0] = '/0';  if( trap_GetConfigString( CS_SERVERINFO, info, sizeof( info ) ) )  {    trap_Cvar_Set( "ui_serverinfo_mapname",                   Info_ValueForKey( info, "mapname" ) );    trap_Cvar_Set( "ui_serverinfo_timelimit",                   Info_ValueForKey( info, "timelimit" ) );    trap_Cvar_Set( "ui_serverinfo_sd",                   Info_ValueForKey( info, "g_suddenDeathTime" ) );    UI_EscapeEmoticons( hostname, Info_ValueForKey( info, "sv_hostname" ),                        sizeof( hostname ) );    trap_Cvar_Set( "ui_serverinfo_hostname", hostname );    trap_Cvar_Set( "ui_serverinfo_maxclients",                   Info_ValueForKey( info, "sv_maxclients" ) );    trap_Cvar_Set( "ui_serverinfo_version",                   Info_ValueForKey( info, "version" ) );    trap_Cvar_Set( "ui_serverinfo_unlagged",                   Info_ValueForKey( info, "g_unlagged" ) );    trap_Cvar_Set( "ui_serverinfo_friendlyFire",                   Info_ValueForKey( info, "g_friendlyFire" ) );    trap_Cvar_Set( "ui_serverinfo_friendlyBuildableFire",                   Info_ValueForKey( info, "g_friendlyBuildableFire" ) );    trap_Cvar_Set( "ui_serverinfo_allowdl",                   Info_ValueForKey( info, "sv_allowdownload" ) );  }}
开发者ID:SolusChristus,项目名称:Tremulous_1.2_EDGEmod_rampEDGE,代码行数:32,


示例7: MenuDrawScoreLine

static voidMenuDrawScoreLine(int n, int y){	int	rank;	char	name[64], info[MAX_INFO_STRING];	if(n > (postgame.numClients + 1))		n -= (postgame.numClients + 2);	if(n >= postgame.numClients)		return;	rank = postgame.ranks[n];	if(rank & RANK_TIED_FLAG){		UI_DrawString(640 - 31 * SMALLCHAR_WIDTH, y, "(tie)", 			UI_LEFT | UI_SMALLFONT, color_white);		rank &= ~RANK_TIED_FLAG;	}	trap_GetConfigString(CS_PLAYERS + postgame.clientNums[n], info,		MAX_INFO_STRING);	Q_strncpyz(name, Info_ValueForKey(info, "n"), sizeof(name));	Q_cleanstr(name);	UI_DrawString(640 - 25 * SMALLCHAR_WIDTH, y,		va("#%i: %-16s %2i", rank + 1, name, postgame.scores[n]),		UI_LEFT | UI_SMALLFONT, color_white);}
开发者ID:icanhas,项目名称:yantar,代码行数:27,


示例8: TeamMain_MenuEvent

/*===============TeamMain_MenuEvent===============*/static void TeamMain_MenuEvent(void* ptr, int event){	char	info[MAX_INFO_STRING];	int	gametype;	trap_GetConfigString(CS_SERVERINFO, info, MAX_INFO_STRING);	gametype = atoi(Info_ValueForKey(info,"g_gametype"));	if (event != QM_ACTIVATED)	{		return;	}	switch (((menucommon_s*)ptr)->id)	{	case ID_JOINRED:		if (gametype == GT_INVASION)			trap_Cmd_ExecuteText(EXEC_APPEND, "cmd team red male/n");		else			trap_Cmd_ExecuteText(EXEC_APPEND, "cmd team red/n");		UI_ForceMenuOff();		break;	case ID_JOINREDFEMALE:		trap_Cmd_ExecuteText(EXEC_APPEND, "cmd team red female/n");		UI_ForceMenuOff();		break;	case ID_JOINBLUE:		if (gametype == GT_INVASION)			trap_Cmd_ExecuteText(EXEC_APPEND, "cmd team blue male/n");		else			trap_Cmd_ExecuteText(EXEC_APPEND, "cmd team blue/n");		UI_ForceMenuOff();		break;	case ID_JOINAUTO:		trap_Cmd_ExecuteText(EXEC_APPEND, "cmd team auto male/n");		UI_ForceMenuOff();		break;	case ID_JOINBLUEFEMALE:		trap_Cmd_ExecuteText(EXEC_APPEND, "cmd team blue female/n");		UI_ForceMenuOff();		break;	case ID_JOINGAME:		trap_Cmd_ExecuteText(EXEC_APPEND, "cmd team free/n");		UI_ForceMenuOff();		break;	case ID_SPECTATE:		trap_Cmd_ExecuteText(EXEC_APPEND, "cmd team spectator/n");		UI_ForceMenuOff();		break;	}}
开发者ID:ElderPlayerX,项目名称:Invasion,代码行数:62,


示例9: Cmd_ListLocations_f

/** Cmd_ListLocations_f*/static void Cmd_ListLocations_f( void ){	int i;	for( i = 0; i < MAX_LOCATIONS; i++ ) {		const char *cs = trap_GetConfigString(CS_LOCATIONS + i);		if( !cs[0] ) { 			break;		}		G_Printf( "%2d %s/n", i, cs );	}}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:15,


示例10: UI_HelpMenu_SetTopic

/*===============UI_HelpMenu_SetTopic===============*/static void UI_HelpMenu_SetTopic( void ) {	char	*arg;	char	info[MAX_INFO_STRING];	int		gametype;	if ( trap_Argc() > 1 ) {		arg = UI_Argv( 1 );		if ( Q_stricmp( arg, "gametype" ) == 0 ) {			helpList	= HELP_GAMETYPE;			trap_GetConfigString( CS_SERVERINFO, info, sizeof( info ) );			gametype = atoi( Info_ValueForKey( info, "g_gametype" ) );			if ( ( gametype < 0 ) || ( gametype > GT_MAX_GAME_TYPE ) ) {				gametype = GT_MAX_GAME_TYPE;			}						helpIndex	= GAMETYPE_REMAP[gametype];			helpMin		= helpIndex;			helpMax		= helpIndex;			helpMenuInfo.prev.generic.flags = QMF_HIDDEN;			helpMenuInfo.next.generic.flags = QMF_HIDDEN;			helpMenuInfo.width	= HMI_GAMETYPE_W;			helpMenuInfo.height	= HMI_GAMETYPE_H;			helpMenuInfo.x		= HMI_GAMETYPE_X;			helpMenuInfo.y		= HMI_GAMETYPE_Y;		}		else {			helpMin		= 0;			helpMax		= ( NUM_HELP_ITEM - 1 );			helpList	= HELP_ITEM;			helpIndex	= helpMin;			helpMenuInfo.width	= HMI_ITEM_W;			helpMenuInfo.height	= HMI_ITEM_H;			helpMenuInfo.x		= HMI_ITEM_X;			helpMenuInfo.y		= HMI_ITEM_Y;		}	}	else {		helpMin		= 0;		helpMax		= ( NUM_HELP_ITEM - 1 );		helpList	= HELP_ITEM;		helpIndex	= helpMax;		helpMenuInfo.width	= HMI_ITEM_W;		helpMenuInfo.height	= HMI_ITEM_H;		helpMenuInfo.x		= HMI_ITEM_X;		helpMenuInfo.y		= HMI_ITEM_Y;	}	UI_HelpMenu_AdjustButtons();}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:58,


示例11: UI_TeamOrdersMenu_f

/*===============UI_TeamOrdersMenu_f===============*/void UI_TeamOrdersMenu_f( void ) {	char	info[MAX_INFO_STRING];	int		team;	// make sure it's a team game	trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) );	teamOrdersMenuInfo.gametype = atoi( Info_ValueForKey( info, "g_gametype" ) );	if( teamOrdersMenuInfo.gametype < GT_TEAM ) {		return;	}	// not available to spectators	if ( cg.localPlayers[0].playerNum == -1 ) {		return;	}	trap_GetConfigString( CS_PLAYERS + cg.localPlayers[0].playerNum, info, MAX_INFO_STRING );	team = atoi( Info_ValueForKey( info, "t" ) );	if( team == TEAM_SPECTATOR ) {		return;	}	UI_TeamOrdersMenu();}
开发者ID:KuehnhammerTobias,项目名称:ioid3-game,代码行数:28,


示例12: UI_RQ3_WeaponMenuAccess

//Makro - returns qtrue if the player can access the weapon/item menusqboolean UI_RQ3_WeaponMenuAccess(){    char info[MAX_INFO_STRING];    int game, tdmMode;    trap_GetConfigString(CS_SERVERINFO, info, sizeof(info));    game = atoi(Info_ValueForKey(info, "g_gametype"));    tdmMode = atoi(Info_ValueForKey(info, "g_RQ3_tdmMode"));    if (game == GT_TEAMPLAY || game == GT_CTF || (game == GT_TEAM && !tdmMode))        return qtrue;    else        return qfalse;}
开发者ID:Zekom,项目名称:reaction,代码行数:15,


示例13: populatePlayerList

static void populatePlayerList( void ) {    int i;    char playerinfo[MAX_INFO_STRING];    s_votemenu_kick.numPlayers = 0;    for(i=0;i<MAX_CLIENTS;i++) {        trap_GetConfigString( CS_PLAYERS + i, playerinfo, MAX_INFO_STRING );        if(strlen(playerinfo) ) {            s_votemenu_kick.players_profiles[s_votemenu_kick.numPlayers].id = i;            Q_strncpyz( s_votemenu_kick.players_profiles[s_votemenu_kick.numPlayers].name, Info_ValueForKey( playerinfo, "n" ), SIZE_OF_NAME - 2);            s_votemenu_kick.numPlayers++;        }    }}
开发者ID:sago007,项目名称:oax,代码行数:14,


示例14: Prepname

static void Prepname( int index ) {    int		len;    char	name[64];    char	info[MAX_INFO_STRING];    trap_GetConfigString( CS_PLAYERS + postgameMenuInfo.clientNums[index], info, MAX_INFO_STRING );    Q_strncpyz( name, Info_ValueForKey( info, "n" ), sizeof(name) );    Q_CleanStr( name );    len = strlen( name );    while( len && UI_ProportionalStringWidth( name ) > 256 ) {        len--;        name[len] = 0;    }    Q_strncpyz( postgameMenuInfo.placeNames[index], name, sizeof(postgameMenuInfo.placeNames[index]) );}
开发者ID:GregMacPherson,项目名称:Quake-III-Arena,代码行数:17,


示例15: UI_NameForCampaign

const char* UI_NameForCampaign( void ) {    int i = 0, j = 0;    char* mapname;    char info[MAX_INFO_STRING];    trap_GetConfigString(CS_SERVERINFO, info, sizeof(info));    mapname = Info_ValueForKey( info, "mapname" );    for( ; i < uiInfo.campaignCount; i++ ) {        for( ; j < uiInfo.campaignList[i].mapCount; j++ ) {            if( !Q_stricmp( mapname, uiInfo.campaignList[i].mapInfos[j]->mapName ) ) {                return uiInfo.campaignList[i].campaignName;            }        }    }    return NULL;}
开发者ID:leakcim1324,项目名称:ETrun,代码行数:19,


示例16: G_InitGameShared

/** G_InitGameShared* give gameshared access to some utilities*/static void G_InitGameShared( void ){	memset( &gs, 0, sizeof( gs_state_t ) );	gs.module = GS_MODULE_GAME;	gs.maxclients = atoi( trap_GetConfigString( CS_MAXCLIENTS ) );	if( gs.maxclients < 1 || gs.maxclients > MAX_EDICTS )		G_Error( "Invalid maxclients value %i/n", gs.maxclients );	module_PredictedEvent = G_PredictedEvent;	module_Error = G_Error;	module_Printf = G_Printf;	module_Malloc = G_GS_Malloc;	module_Free = G_GS_Free;	module_Trace = G_GS_Trace;	module_GetEntityState = G_GetEntityStateForDeltaTime;	module_PointContents = G_PointContents4D;	module_RoundUpToHullSize = G_GS_RoundUpToHullSize;	module_PMoveTouchTriggers = G_PMoveTouchTriggers;	module_GetConfigString = trap_GetConfigString;}
开发者ID:DenMSC,项目名称:racemod_2.1,代码行数:25,


示例17: UI_VoteFraglimitMenu

/*=================UI_VoteFraglimitMenu *Called from outside=================*/void UI_VoteFraglimitMenu( void ) {        char serverinfo[MAX_INFO_STRING];        // zero set all our globals	memset( &s_votemenu_fraglmit, 0 ,sizeof(votemenu_t) );        trap_GetConfigString( CS_SERVERINFO, serverinfo, MAX_INFO_STRING );        s_votemenu_fraglmit.min = atoi(Info_ValueForKey(serverinfo,"g_voteMinFraglimit"));        s_votemenu_fraglmit.max = atoi(Info_ValueForKey(serverinfo,"g_voteMaxFraglimit"));        UI_VoteFraglimitMenuInternal();	Menu_AddItem( &s_votemenu_fraglmit.menu, (void*) &s_votemenu_fraglmit.banner );	Menu_AddItem( &s_votemenu_fraglmit.menu, (void*) &s_votemenu_fraglmit.back );        //Menu_AddItem( &s_votemenu_fraglmit.menu, (void*) &s_votemenu_fraglmit.go );        Menu_AddItem( &s_votemenu_fraglmit.menu, (void*) &s_votemenu_fraglmit.bLimit10 );        Menu_AddItem( &s_votemenu_fraglmit.menu, (void*) &s_votemenu_fraglmit.bLimit15 );        Menu_AddItem( &s_votemenu_fraglmit.menu, (void*) &s_votemenu_fraglmit.bLimit20 );        Menu_AddItem( &s_votemenu_fraglmit.menu, (void*) &s_votemenu_fraglmit.bLimit30 );        Menu_AddItem( &s_votemenu_fraglmit.menu, (void*) &s_votemenu_fraglmit.bLimit40 );        Menu_AddItem( &s_votemenu_fraglmit.menu, (void*) &s_votemenu_fraglmit.bLimit50 );        Menu_AddItem( &s_votemenu_fraglmit.menu, (void*) &s_votemenu_fraglmit.bLimitInf );	UI_PushMenu( &s_votemenu_fraglmit.menu );}
开发者ID:sago007,项目名称:oax,代码行数:28,


示例18: G_Match_Autorecord_Start

/** G_Match_Autorecord_Start*/void G_Match_Autorecord_Start( void ){	int team, i, playerCount;	G_Match_SetAutorecordState( "start" );	// do not start autorecording if all playing clients are bots	for( playerCount = 0, team = TEAM_PLAYERS; team < GS_MAX_TEAMS; team++ )	{		// add our team info to the string		for( i = 0; i < teamlist[team].numplayers; i++ )		{			if( game.edicts[ teamlist[team].playerIndices[i] ].r.svflags & SVF_FAKECLIENT )				continue;			playerCount++;			break; // we only need one for this check		}	}	if( playerCount && g_autorecord->integer )	{		char datetime[17], players[MAX_STRING_CHARS];		time_t long_time;		struct tm *newtime;		// date & time		time( &long_time );		newtime = localtime( &long_time );		Q_snprintfz( datetime, sizeof( datetime ), "%04d-%02d-%02d_%02d-%02d", newtime->tm_year + 1900,			newtime->tm_mon+1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min );		// list of players		Q_strncpyz( players, trap_GetConfigString( CS_MATCHNAME ), sizeof( players ) );		if( players[0] == '/0' )		{			if( GS_InvidualGameType() )			{				const char *netname;				int team;				edict_t *ent;				for( team = TEAM_ALPHA; team < GS_MAX_TEAMS; team++ )				{					if( !teamlist[team].numplayers )						continue;					ent = game.edicts + teamlist[team].playerIndices[0];					netname = ent->r.client->netname;					Q_strncatz( players, netname, sizeof( players ) );					if( team != GS_MAX_TEAMS - 1 )						Q_strncatz( players, " vs ", sizeof( players ) );				}			}		}		if( players[0] != '/0' )		{			char *t = strstr( players, " vs " );			if( t )				memcpy( t, "_vs_", strlen( "_vs_" ) );			Q_strncpyz( players, COM_RemoveJunkChars( COM_RemoveColorTokens( players ) ), sizeof( players ) );		}		// combine		Q_snprintfz( level.autorecord_name, sizeof( level.autorecord_name ), "%s_%s_%s%s%s_auto%04i", 			datetime, gs.gametypeName, level.mapname, players[0] == '/0' ? "" : "_", players, (int)brandom( 1, 9999 ) );		trap_Cmd_ExecuteText( EXEC_APPEND, va( "serverrecord %s/n", level.autorecord_name ) );	}}
开发者ID:MaryJaneInChain,项目名称:qfusion,代码行数:74,


示例19: UI_DrawConnectScreen

/*========================UI_DrawConnectScreenThis will also be overlaid on the cgame info screen during loadingto prevent it from blinking away too rapidly on local or lan games.========================*/void UI_DrawConnectScreen( qboolean overlay ) {	char			*s;	uiClientState_t	cstate;	char			info[MAX_INFO_VALUE];	Menu_Cache();	if ( !overlay ) {		// draw the dialog background		UI_SetColor( color_white );		UI_DrawHandlePic( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, uis.connecting );	}	// see what information we should display	trap_GetClientState( &cstate );	info[0] = '/0';	if( trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) ) ) {		UI_DrawProportionalString( 320, 16, va( "Loading %s", Info_ValueForKey( info, "mapname" ) ), UI_BIGFONT|UI_CENTER|UI_DROPSHADOW, 1.0, g_color_table[60] );	}	UI_DrawProportionalString( 320, 64, va("Connecting to %s", cstate.servername), UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, 0.75, g_color_table[60] );	//UI_DrawProportionalString( 320, 96, "Press Esc to abort", UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );	// display global MOTD at bottom	UI_DrawProportionalString( SCREEN_WIDTH/2, SCREEN_HEIGHT-32, 		Info_ValueForKey( cstate.updateInfoString, "motd" ), UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, 0.75, menu_text_color );		// print any server info (server full, bad version, etc)	if ( cstate.connState < CA_CONNECTED ) {		UI_DrawProportionalString_AutoWrapped( 320, 192, 630, 20, cstate.messageString, UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );		//Here is what prints the ban message!		//Com_Printf("DBG: %s/n", cstate.messageString);	}#if 0	// display password field	if ( passwordNeeded ) {		s_ingame_menu.x = SCREEN_WIDTH * 0.50 - 128;		s_ingame_menu.nitems = 0;		s_ingame_menu.wrapAround = qtrue;		passwordField.generic.type = MTYPE_FIELD;		passwordField.generic.name = "Password:";		passwordField.generic.callback = 0;		passwordField.generic.x		= 10;		passwordField.generic.y		= 180;		Field_Clear( &passwordField.field );		passwordField.width = 256;		passwordField.field.widthInChars = 16;		Q_strncpyz( passwordField.field.buffer, Cvar_VariableString("password"), 			sizeof(passwordField.field.buffer) );		Menu_AddItem( &s_ingame_menu, ( void * ) &s_customize_player_action );		MField_Draw( &passwordField );	}#endif	if ( lastConnState > cstate.connState ) {		lastLoadingText[0] = '/0';	}	lastConnState = cstate.connState;	switch ( cstate.connState ) {	case CA_CONNECTING:		s = va("Awaiting challenge...%i", cstate.connectPacketCount);		break;	case CA_CHALLENGING:		s = va("Awaiting connection...%i", cstate.connectPacketCount);		break;	case CA_CONNECTED: {		char downloadName[MAX_INFO_VALUE];			trap_Cvar_VariableStringBuffer( "cl_downloadName", downloadName, sizeof(downloadName) );			if (*downloadName) {				UI_DisplayDownloadInfo( downloadName );				return;			}		}		s = "Awaiting gamestate...";		break;	case CA_LOADING:		return;	case CA_PRIMED:		return;	default:		return;	}	UI_DrawProportionalString( 320, 128, s, UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, 0.75, g_color_table[60] );//.........这里部分代码省略.........
开发者ID:xzero450,项目名称:revolution,代码行数:101,


示例20: UI_SPPostgameMenu_MenuDraw

/*=================UI_SPPostgameMenu_MenuDraw=================*/static void UI_SPPostgameMenu_MenuDraw( void ) {    int		timer;    int		serverId;    int		n;    char	info[MAX_INFO_STRING];    trap_GetConfigString( CS_SYSTEMINFO, info, sizeof(info) );    serverId = atoi( Info_ValueForKey( info, "sv_serverid" ) );    if( serverId != postgameMenuInfo.serverId ) {        UI_PopMenu();        return;    }    // phase 1    if ( postgameMenuInfo.numClients > 2 ) {        UI_DrawProportionalString( 510, 480 - 64 - PROP_HEIGHT, postgameMenuInfo.placeNames[2], UI_CENTER, color_white );    }    UI_DrawProportionalString( 130, 480 - 64 - PROP_HEIGHT, postgameMenuInfo.placeNames[1], UI_CENTER, color_white );    UI_DrawProportionalString( 320, 480 - 64 - 2 * PROP_HEIGHT, postgameMenuInfo.placeNames[0], UI_CENTER, color_white );    if( postgameMenuInfo.phase == 1 ) {        timer = uis.realtime - postgameMenuInfo.starttime;        if( timer >= 1000 && postgameMenuInfo.winnerSound ) {            trap_S_StartLocalSound( postgameMenuInfo.winnerSound, CHAN_ANNOUNCER );            postgameMenuInfo.winnerSound = 0;        }        if( timer < 5000 ) {            return;        }        postgameMenuInfo.phase = 2;        postgameMenuInfo.starttime = uis.realtime;    }    // phase 2    if( postgameMenuInfo.phase == 2 ) {        timer = uis.realtime - postgameMenuInfo.starttime;        if( timer >= ( postgameMenuInfo.numAwards * AWARD_PRESENTATION_TIME ) ) {            if( timer < 5000 ) {                return;            }            postgameMenuInfo.phase = 3;            postgameMenuInfo.starttime = uis.realtime;        }        else {            UI_SPPostgameMenu_DrawAwardsPresentation( timer );        }    }    // phase 3    if( postgameMenuInfo.phase == 3 ) {        if( uis.demoversion ) {            if( postgameMenuInfo.won == 1 && UI_ShowTierVideo( 8 )) {                trap_Cvar_Set( "nextmap", "" );                trap_Cmd_ExecuteText( EXEC_APPEND, "disconnect; cinematic demoEnd.RoQ/n" );                return;            }        }        else if( postgameMenuInfo.won > -1 && UI_ShowTierVideo( postgameMenuInfo.won + 1 )) {            if( postgameMenuInfo.won == postgameMenuInfo.lastTier ) {                trap_Cvar_Set( "nextmap", "" );                trap_Cmd_ExecuteText( EXEC_APPEND, "disconnect; cinematic end.RoQ/n" );                return;            }            trap_Cvar_SetValue( "ui_spSelection", postgameMenuInfo.won * ARENAS_PER_TIER );            trap_Cvar_Set( "nextmap", "levelselect" );            trap_Cmd_ExecuteText( EXEC_APPEND, va( "disconnect; cinematic tier%i.RoQ/n", postgameMenuInfo.won + 1 ) );            return;        }        postgameMenuInfo.item_again.generic.flags &= ~QMF_INACTIVE;        postgameMenuInfo.item_next.generic.flags &= ~QMF_INACTIVE;        postgameMenuInfo.item_menu.generic.flags &= ~QMF_INACTIVE;        UI_SPPostgameMenu_DrawAwardsMedals( postgameMenuInfo.numAwards );        Menu_Draw( &postgameMenuInfo.menu );    }    // draw the scoreboard    if( !trap_Cvar_VariableValue( "ui_spScoreboard" ) ) {        return;    }    timer = uis.realtime - postgameMenuInfo.scoreboardtime;    if( postgameMenuInfo.numClients <= 3 ) {        n = 0;    }    else {        n = timer / 1500 % (postgameMenuInfo.numClients + 2);    }//.........这里部分代码省略.........
开发者ID:GregMacPherson,项目名称:Quake-III-Arena,代码行数:101,


示例21: UI_ManageDeckLoading

static void UI_ManageDeckLoading( void ){	char			fileRoute[MAX_QPATH];	char			mapRoute[MAX_QPATH];	char			info[MAX_TOKEN_CHARS];	fileHandle_t	f;	int				file_len;	char			*textPtr;	char			buffer[20000];	char			*token;	//get the map name	trap_GetConfigString( CS_SERVERINFO, info, sizeof( info ) );	Com_sprintf( mapRoute, sizeof( fileRoute ), "maps/%s", Info_ValueForKey( info, "mapname" ) );	//check for language	UI_LanguageFilename( mapRoute, "turbolift", fileRoute );	file_len = trap_FS_FOpenFile( fileRoute, &f, FS_READ );	if ( file_len <= 1 )	{		//Com_Printf( S_COLOR_YELLOW "WARNING: Attempted to load %s, but wasn't found./n", fileRoute );		UI_TurboliftMenu_LoadDecks();		return;	}	trap_FS_Read( buffer, file_len, f );	trap_FS_FCloseFile( f );	if ( !buffer[0] )	{		Com_Printf( S_COLOR_RED "ERROR: Attempted to load %s, but no data was read./n", fileRoute );		UI_TurboliftMenu_LoadDecks();		return;	}	s_turbolift.numDecks = 0;	memset( &s_turbolift.deckData, 0, sizeof( s_turbolift.deckData ) );	buffer[file_len] = '/0';	COM_BeginParseSession();	textPtr = buffer;	//Com_Printf( S_COLOR_RED "Beginning Parse/n" );	//expected format is 'decknum' <space> 'deck Desc'	while( 1 )	{		token = COM_Parse( &textPtr );		if ( !token[0] )			break;		//Com_Printf( S_COLOR_RED "First Token: %s/n", token );		//in case of Scooter's EF SP style DAT files, which require 'DECK' in front of the number		if ( !Q_strncmp( token, "DECK", 4 ) )			token += 4;		//grab the deck number		s_turbolift.deckData[s_turbolift.numDecks].deckNum = atoi( token );		token = COM_ParseExt( &textPtr, qfalse );		if (!token[0])			continue;		//Com_Printf( S_COLOR_RED "Second Token: %s/n", token );		Q_strncpyz( s_turbolift.deckData[s_turbolift.numDecks].deckDesc, 					token,					sizeof( s_turbolift.deckData[s_turbolift.numDecks].deckDesc ) );		s_turbolift.numDecks++;		//if this is an EF SP style script, there may be more data after these two. ignore them		if ( COM_ParseExt( &textPtr, qfalse ) == NULL )			SkipRestOfLine( &textPtr );	}	qsort( s_turbolift.deckData, s_turbolift.numDecks, sizeof( deckData_t ), SortDecks );}
开发者ID:gitter-badger,项目名称:rpgxEF,代码行数:81,


示例22: TeamMain_MenuInit

/*=======================================================================================================================================TeamMain_MenuInit=======================================================================================================================================*/void TeamMain_MenuInit(void) {	int y;	int gametype;	char info[MAX_INFO_STRING];	memset(&s_teammain, 0, sizeof(s_teammain));	TeamMain_Cache();	s_teammain.menu.wrapAround = qtrue;	s_teammain.menu.fullscreen = qfalse;	s_teammain.frame.generic.type = MTYPE_BITMAP;	s_teammain.frame.generic.flags = QMF_INACTIVE;	s_teammain.frame.generic.name = TEAMMAIN_FRAME;	s_teammain.frame.generic.x = 142;	s_teammain.frame.generic.y = 118;	s_teammain.frame.width = 359;	s_teammain.frame.height = 256;	y = 194;	s_teammain.joinred.generic.type = MTYPE_PTEXT;	s_teammain.joinred.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_teammain.joinred.generic.id = ID_JOINRED;	s_teammain.joinred.generic.callback = TeamMain_MenuEvent;	s_teammain.joinred.generic.x = 320;	s_teammain.joinred.generic.y = y;	s_teammain.joinred.string = "JOIN RED";	s_teammain.joinred.style = UI_CENTER|UI_SMALLFONT;	s_teammain.joinred.color = colorRed;	y += 20;	s_teammain.joinblue.generic.type = MTYPE_PTEXT;	s_teammain.joinblue.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_teammain.joinblue.generic.id = ID_JOINBLUE;	s_teammain.joinblue.generic.callback = TeamMain_MenuEvent;	s_teammain.joinblue.generic.x = 320;	s_teammain.joinblue.generic.y = y;	s_teammain.joinblue.string = "JOIN BLUE";	s_teammain.joinblue.style = UI_CENTER|UI_SMALLFONT;	s_teammain.joinblue.color = colorRed;	y += 20;	s_teammain.joingame.generic.type = MTYPE_PTEXT;	s_teammain.joingame.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_teammain.joingame.generic.id = ID_JOINGAME;	s_teammain.joingame.generic.callback = TeamMain_MenuEvent;	s_teammain.joingame.generic.x = 320;	s_teammain.joingame.generic.y = y;	s_teammain.joingame.string = "JOIN GAME";	s_teammain.joingame.style = UI_CENTER|UI_SMALLFONT;	s_teammain.joingame.color = colorRed;	y += 20;	s_teammain.spectate.generic.type = MTYPE_PTEXT;	s_teammain.spectate.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_teammain.spectate.generic.id = ID_SPECTATE;	s_teammain.spectate.generic.callback = TeamMain_MenuEvent;	s_teammain.spectate.generic.x = 320;	s_teammain.spectate.generic.y = y;	s_teammain.spectate.string = "SPECTATE";	s_teammain.spectate.style = UI_CENTER|UI_SMALLFONT;	s_teammain.spectate.color = colorRed;	trap_GetConfigString(CS_SERVERINFO, info, MAX_INFO_STRING);	gametype = atoi(Info_ValueForKey(info, "g_gametype"));	// set initial states	switch (gametype) {		case GT_SINGLE_PLAYER:		case GT_FFA:		case GT_TOURNAMENT:			s_teammain.joinred.generic.flags |= QMF_GRAYED;			s_teammain.joinblue.generic.flags |= QMF_GRAYED;			break;		default:		case GT_TEAM:		case GT_CTF:			s_teammain.joingame.generic.flags |= QMF_GRAYED;			break;	}	Menu_AddItem(&s_teammain.menu, (void *)&s_teammain.frame);	Menu_AddItem(&s_teammain.menu, (void *)&s_teammain.joinred);	Menu_AddItem(&s_teammain.menu, (void *)&s_teammain.joinblue);	Menu_AddItem(&s_teammain.menu, (void *)&s_teammain.joingame);	Menu_AddItem(&s_teammain.menu, (void *)&s_teammain.spectate);}
开发者ID:ioid3-games,项目名称:ioid3-q3,代码行数:92,


示例23: UI_CalcPostGameStats

/*=======================UI_CalcPostGameStats=======================*/static void UI_CalcPostGameStats( void ){    char map[MAX_QPATH];    char fileName[MAX_QPATH];    char info[MAX_INFO_STRING];    fileHandle_t f;    int size, game, time, adjustedTime;    postGameInfo_t oldInfo;    postGameInfo_t newInfo;    qboolean newHigh = qfalse;    trap_GetConfigString(CS_SERVERINFO, info, sizeof(info));    Q_strncpyz(map, Info_ValueForKey(info, "mapname"), sizeof(map));    game = atoi(Info_ValueForKey(info, "g_gametype"));    // compose file name    Com_sprintf(fileName, MAX_QPATH, "games/%s_%i.game", map, game);    // see if we have one already    memset(&oldInfo, 0, sizeof(postGameInfo_t));    if (trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) {        // if so load it        size = 0;        trap_FS_Read(&size, sizeof(int), f);        if (size == sizeof(postGameInfo_t)) {            trap_FS_Read(&oldInfo, sizeof(postGameInfo_t), f);        }        trap_FS_FCloseFile(f);    }    newInfo.accuracy = atoi(UI_Argv(3));    newInfo.impressives = atoi(UI_Argv(4));    newInfo.excellents = atoi(UI_Argv(5));    newInfo.defends = atoi(UI_Argv(6));    newInfo.assists = atoi(UI_Argv(7));    newInfo.gauntlets = atoi(UI_Argv(8));    newInfo.baseScore = atoi(UI_Argv(9));    newInfo.perfects = atoi(UI_Argv(10));    newInfo.redScore = atoi(UI_Argv(11));    newInfo.blueScore = atoi(UI_Argv(12));    time = atoi(UI_Argv(13));    newInfo.captures = atoi(UI_Argv(14));    newInfo.time = (time - trap_Cvar_VariableValue("ui_matchStartTime")) / 1000;    adjustedTime = uiInfo.mapList[ui_currentMap.integer].timeToBeat[game];    if (newInfo.time < adjustedTime) {        newInfo.timeBonus = (adjustedTime - newInfo.time) * 10;    } else {        newInfo.timeBonus = 0;    }    if (newInfo.redScore > newInfo.blueScore && newInfo.blueScore <= 0) {        newInfo.shutoutBonus = 100;    } else {        newInfo.shutoutBonus = 0;    }    newInfo.skillBonus = trap_Cvar_VariableValue("g_spSkill");    if (newInfo.skillBonus <= 0) {        newInfo.skillBonus = 1;    }    newInfo.score = newInfo.baseScore + newInfo.shutoutBonus + newInfo.timeBonus;    newInfo.score *= newInfo.skillBonus;    // see if the score is higher for this one    newHigh = (newInfo.redScore > newInfo.blueScore && newInfo.score > oldInfo.score);    if (newHigh) {        // if so write out the new one        uiInfo.newHighScoreTime = uiInfo.uiDC.realTime + 20000;        if (trap_FS_FOpenFile(fileName, &f, FS_WRITE) >= 0) {            size = sizeof(postGameInfo_t);            trap_FS_Write(&size, sizeof(int), f);            trap_FS_Write(&newInfo, sizeof(postGameInfo_t), f);            trap_FS_FCloseFile(f);        }    }    if (newInfo.time < oldInfo.time) {        uiInfo.newBestTime = uiInfo.uiDC.realTime + 20000;    }    // put back all the ui overrides    trap_Cvar_Set("capturelimit", UI_Cvar_VariableString("ui_saveCaptureLimit"));    trap_Cvar_Set("fraglimit", UI_Cvar_VariableString("ui_saveFragLimit"));    trap_Cvar_Set("cg_drawTimer", UI_Cvar_VariableString("ui_drawTimer"));    trap_Cvar_Set("g_doWarmup", UI_Cvar_VariableString("ui_doWarmup"));    trap_Cvar_Set("g_Warmup", UI_Cvar_VariableString("ui_Warmup"));    trap_Cvar_Set("sv_pure", UI_Cvar_VariableString("ui_pure"));    trap_Cvar_Set("g_friendlyFire", UI_Cvar_VariableString("ui_friendlyFire"));    UI_SetBestScores(&newInfo, qtrue);    UI_ShowPostGame(newHigh);}
开发者ID:Zekom,项目名称:reaction,代码行数:98,


示例24: UI_SPPostgameMenu_f

/*=================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;//.........这里部分代码省略.........
开发者ID:GregMacPherson,项目名称:Quake-III-Arena,代码行数:101,


示例25: InGame_MenuInit

/*=================InGame_MenuInit=================*/void InGame_MenuInit( void ) {	int		y;	uiClientState_t	cs;	char	info[MAX_INFO_STRING];	int		team;	memset( &s_ingame, 0 ,sizeof(ingamemenu_t) );	InGame_Cache();	s_ingame.menu.wrapAround = qtrue;	s_ingame.menu.fullscreen = qfalse;	s_ingame.frame.generic.type			= MTYPE_BITMAP;	s_ingame.frame.generic.flags		= QMF_INACTIVE;	s_ingame.frame.generic.name			= INGAME_FRAME;	s_ingame.frame.generic.x			= 320-233;	s_ingame.frame.generic.y			= 240-166-INGAME_MENU_VERTICAL_SPACING/2;	s_ingame.frame.width				= 466;	s_ingame.frame.height				= 332+INGAME_MENU_VERTICAL_SPACING/2;	y = (s_ingame.frame.height - INGAME_MENU_VERTICAL_SPACING * (INGAME_MENU_ITEMS-1) - SMALLCHAR_HEIGHT)/2		+ s_ingame.frame.generic.y;	s_ingame.slugrock.generic.type		= MTYPE_PTEXT;	s_ingame.slugrock.generic.flags		= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_ingame.slugrock.generic.x			= 320;	s_ingame.slugrock.generic.y			= y;	s_ingame.slugrock.generic.id		= ID_SLUGROCK;	s_ingame.slugrock.generic.callback	= InGame_Event; 	s_ingame.slugrock.string			= "SLUGROCK";	s_ingame.slugrock.color				= color_red;	s_ingame.slugrock.style				= UI_CENTER|UI_SMALLFONT;	y += INGAME_MENU_VERTICAL_SPACING;	s_ingame.team.generic.type			= MTYPE_PTEXT;	s_ingame.team.generic.flags			= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_ingame.team.generic.x				= 320;	s_ingame.team.generic.y				= y;	s_ingame.team.generic.id			= ID_TEAM;	s_ingame.team.generic.callback		= InGame_Event; 	s_ingame.team.string				= "START";	s_ingame.team.color					= color_red;	s_ingame.team.style					= UI_CENTER|UI_SMALLFONT;	y += INGAME_MENU_VERTICAL_SPACING;	s_ingame.addbots.generic.type		= MTYPE_PTEXT;	s_ingame.addbots.generic.flags		= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_ingame.addbots.generic.x			= 320;	s_ingame.addbots.generic.y			= y;	s_ingame.addbots.generic.id			= ID_ADDBOTS;	s_ingame.addbots.generic.callback	= InGame_Event; 	s_ingame.addbots.string				= "ADD BOTS";	s_ingame.addbots.color				= color_red;	s_ingame.addbots.style				= UI_CENTER|UI_SMALLFONT;	if( !trap_Cvar_VariableValue( "sv_running" ) || !trap_Cvar_VariableValue( "bot_enable" ) || (trap_Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER)) {		s_ingame.addbots.generic.flags |= QMF_GRAYED;	}	y += INGAME_MENU_VERTICAL_SPACING;	s_ingame.removebots.generic.type		= MTYPE_PTEXT;	s_ingame.removebots.generic.flags		= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_ingame.removebots.generic.x			= 320;	s_ingame.removebots.generic.y			= y;	s_ingame.removebots.generic.id			= ID_REMOVEBOTS;	s_ingame.removebots.generic.callback	= InGame_Event; 	s_ingame.removebots.string				= "REMOVE BOTS";	s_ingame.removebots.color				= color_red;	s_ingame.removebots.style				= UI_CENTER|UI_SMALLFONT;	if( !trap_Cvar_VariableValue( "sv_running" ) || !trap_Cvar_VariableValue( "bot_enable" ) || (trap_Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER)) {		s_ingame.removebots.generic.flags |= QMF_GRAYED;	}	y += INGAME_MENU_VERTICAL_SPACING;	s_ingame.teamorders.generic.type		= MTYPE_PTEXT;	s_ingame.teamorders.generic.flags		= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_ingame.teamorders.generic.x			= 320;	s_ingame.teamorders.generic.y			= y;	s_ingame.teamorders.generic.id			= ID_TEAMORDERS;	s_ingame.teamorders.generic.callback	= InGame_Event; 	s_ingame.teamorders.string				= "TEAM ORDERS";	s_ingame.teamorders.color				= color_red;	s_ingame.teamorders.style				= UI_CENTER|UI_SMALLFONT;	if( !(trap_Cvar_VariableValue( "g_gametype" ) >= GT_TEAM) ) {		s_ingame.teamorders.generic.flags |= QMF_GRAYED;	}	else {		trap_GetClientState( &cs );		trap_GetConfigString( CS_PLAYERS + cs.clientNum, info, MAX_INFO_STRING );		team = atoi( Info_ValueForKey( info, "t" ) );		if( team == TEAM_SPECTATOR ) {			s_ingame.teamorders.generic.flags |= QMF_GRAYED;		}	}	y += INGAME_MENU_VERTICAL_SPACING;//.........这里部分代码省略.........
开发者ID:Takkie,项目名称:SlugRock,代码行数:101,


示例26: UI_AddBotsMenu_Init

static void UI_AddBotsMenu_Init( void ) {	int		n;	int		y;	int		gametype;	int		count;	char	info[MAX_INFO_STRING];	trap_GetConfigString(CS_SERVERINFO, info, MAX_INFO_STRING);   	gametype = atoi( Info_ValueForKey( info,"g_gametype" ) );	memset( &addBotsMenuInfo, 0 ,sizeof(addBotsMenuInfo) );	addBotsMenuInfo.menu.draw = UI_AddBotsMenu_Draw;	addBotsMenuInfo.menu.fullscreen = qfalse;	addBotsMenuInfo.menu.wrapAround = qtrue;	addBotsMenuInfo.delay = 1000;	UI_AddBots_Cache();	addBotsMenuInfo.numBots = UI_GetNumBots();	count = addBotsMenuInfo.numBots < 7 ? addBotsMenuInfo.numBots : 7;	addBotsMenuInfo.arrows.generic.type  = MTYPE_BITMAP;	addBotsMenuInfo.arrows.generic.name  = ART_ARROWS;	addBotsMenuInfo.arrows.generic.flags = QMF_INACTIVE;	addBotsMenuInfo.arrows.generic.x	 = 200;	addBotsMenuInfo.arrows.generic.y	 = 128;	addBotsMenuInfo.arrows.width  	     = 64;	addBotsMenuInfo.arrows.height  	     = 128;	addBotsMenuInfo.up.generic.type	    = MTYPE_BITMAP;	addBotsMenuInfo.up.generic.flags    = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;	addBotsMenuInfo.up.generic.x		= 200;	addBotsMenuInfo.up.generic.y		= 128;	addBotsMenuInfo.up.generic.id	    = ID_UP;	addBotsMenuInfo.up.generic.callback = UI_AddBotsMenu_UpEvent;	addBotsMenuInfo.up.width  		    = 64;	addBotsMenuInfo.up.height  		    = 64;	addBotsMenuInfo.up.focuspic         = ART_ARROWUP;	addBotsMenuInfo.down.generic.type	  = MTYPE_BITMAP;	addBotsMenuInfo.down.generic.flags    = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;	addBotsMenuInfo.down.generic.x		  = 200;	addBotsMenuInfo.down.generic.y		  = 128+64;	addBotsMenuInfo.down.generic.id	      = ID_DOWN;	addBotsMenuInfo.down.generic.callback = UI_AddBotsMenu_DownEvent;	addBotsMenuInfo.down.width  		  = 64;	addBotsMenuInfo.down.height  		  = 64;	addBotsMenuInfo.down.focuspic         = ART_ARROWDOWN;	for( n = 0, y = 120; n < count; n++, y += 20 ) {		addBotsMenuInfo.bots[n].generic.type		= MTYPE_PTEXT;		addBotsMenuInfo.bots[n].generic.flags		= QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;		addBotsMenuInfo.bots[n].generic.id			= ID_BOTNAME0 + n;		addBotsMenuInfo.bots[n].generic.x			= 320 - 56;		addBotsMenuInfo.bots[n].generic.y			= y;		addBotsMenuInfo.bots[n].generic.callback	= UI_AddBotsMenu_BotEvent;		addBotsMenuInfo.bots[n].string				= addBotsMenuInfo.botnames[n];		addBotsMenuInfo.bots[n].color				= color_orange;		addBotsMenuInfo.bots[n].style				= UI_LEFT|UI_SMALLFONT;	}	y += 12;	addBotsMenuInfo.skill.generic.type		= MTYPE_SPINCONTROL;	addBotsMenuInfo.skill.generic.flags		= QMF_PULSEIFFOCUS|QMF_SMALLFONT;	addBotsMenuInfo.skill.generic.x			= 320;	addBotsMenuInfo.skill.generic.y			= y;	addBotsMenuInfo.skill.generic.name		= "Skill:";	addBotsMenuInfo.skill.generic.id		= ID_SKILL;	addBotsMenuInfo.skill.itemnames			= skillNames;	addBotsMenuInfo.skill.curvalue			= Com_Clamp( 0, 4, (int)trap_Cvar_VariableValue( "g_spSkill" ) - 1 );	y += SMALLCHAR_HEIGHT;	addBotsMenuInfo.team.generic.type		= MTYPE_SPINCONTROL;	addBotsMenuInfo.team.generic.flags		= QMF_PULSEIFFOCUS|QMF_SMALLFONT;	addBotsMenuInfo.team.generic.x			= 320;	addBotsMenuInfo.team.generic.y			= y;	addBotsMenuInfo.team.generic.name		= "Team: ";	addBotsMenuInfo.team.generic.id			= ID_TEAM;	if( gametype >= GT_TEAM ) {		addBotsMenuInfo.team.itemnames		= teamNames2;	}	else {		addBotsMenuInfo.team.itemnames		= teamNames1;		addBotsMenuInfo.team.generic.flags	= QMF_GRAYED;	}	addBotsMenuInfo.go.generic.type			= MTYPE_BITMAP;	addBotsMenuInfo.go.generic.name			= ART_FIGHT0;	addBotsMenuInfo.go.generic.flags		= QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;	addBotsMenuInfo.go.generic.id			= ID_GO;	addBotsMenuInfo.go.generic.callback		= UI_AddBotsMenu_FightEvent;	addBotsMenuInfo.go.generic.x			= 320+128-128;	addBotsMenuInfo.go.generic.y			= 256+128-64;	addBotsMenuInfo.go.width  				= 128;	addBotsMenuInfo.go.height  				= 64;	addBotsMenuInfo.go.focuspic				= ART_FIGHT1;	addBotsMenuInfo.back.generic.type		= MTYPE_BITMAP;	addBotsMenuInfo.back.generic.name		= ART_BACK0;	addBotsMenuInfo.back.generic.flags		= QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;//.........这里部分代码省略.........
开发者ID:Cpasjuste,项目名称:quake3_pandora_gles,代码行数:101,



注:本文中的trap_GetConfigString函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ trap_InPVS函数代码示例
C++ trap_GetClientState函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。