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

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

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

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

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

示例1: CG_MouseEvent

void CG_MouseEvent( int x, int y ){	int n;	if ( ( cg.predictedPlayerState.pm_type == PM_NORMAL ||	       cg.predictedPlayerState.pm_type == PM_SPECTATOR ) &&	     cg.showScores == qfalse )	{		trap_Key_SetCatcher( 0 );		return;	}	cgs.cursorX += x;	if ( cgs.cursorX < 0 )	{		cgs.cursorX = 0;	}	else if ( cgs.cursorX > 640 )	{		cgs.cursorX = 640;	}	cgs.cursorY += y;	if ( cgs.cursorY < 0 )	{		cgs.cursorY = 0;	}	else if ( cgs.cursorY > 480 )	{		cgs.cursorY = 480;	}}
开发者ID:rubybrawler,项目名称:Unvanquished,代码行数:34,


示例2: UI_MessageMode_f

static void UI_MessageMode_f( void ){  char *arg = UI_Argv( 0 );  trap_Cvar_Set( "ui_sayBuffer", "" );  switch( arg[ 11 ] )  {    default:    case '/0':      // Global      uiInfo.chatTeam             = qfalse;      break;    case '2':      // Team      uiInfo.chatTeam             = qtrue;      break;  }  trap_Key_SetCatcher( KEYCATCH_UI );  Menus_CloseByName( "say" );  Menus_CloseByName( "say_team" );  if( uiInfo.chatTeam )    Menus_ActivateByName( "say_team" );  else    Menus_ActivateByName( "say" );}
开发者ID:otty,项目名称:cake3,代码行数:29,


示例3: UI_SaveMenu_f

/*===============UI_SaveMenu_f===============*/static void UI_SaveMenu_f( void ) {	ui.PrecacheScreenshot();	trap_Key_SetCatcher( KEYCATCH_UI );	Menus_ActivateByName("ingamesaveMenu");}
开发者ID:blaenk,项目名称:jedioutcast,代码行数:12,


示例4: UI_Menu_f

static void UI_Menu_f( void ){    if( Menu_Count( ) > 0 )    {      trap_Key_SetCatcher( KEYCATCH_UI );      Menus_ActivateByName( UI_Argv( 1 ) );    }}
开发者ID:otty,项目名称:cake3,代码行数:8,


示例5: UI_ForceMenuOff

void UI_ForceMenuOff(void) {  uis.menusp = 0;  uis.activemenu = NULL;  trap_Key_SetCatcher(trap_Key_GetCatcher() & ~KEYCATCH_UI);  trap_Key_ClearStates();  trap_Cvar_Set("cl_paused", "0");}
开发者ID:zturtleman,项目名称:q3rain,代码行数:8,


示例6: UI_SaveMenu_f

/*===============UI_SaveMenu_f===============*/static void UI_SaveMenu_f( void ){#ifdef JK2_MODE	ui.PrecacheScreenshot();#endif	trap_Key_SetCatcher( KEYCATCH_UI );	Menus_ActivateByName("ingamesaveMenu");}
开发者ID:AlexXT,项目名称:OpenJK,代码行数:14,


示例7: CG_MouseEvent

void CG_MouseEvent(int x, int y) {	switch ((int)cgs.eventHandling) {	case CGAME_EVENT_SPEAKEREDITOR:	case CGAME_EVENT_GAMEVIEW:	case CGAME_EVENT_CAMPAIGNBREIFING:	case CGAME_EVENT_FIRETEAMMSG:		cgs.cursorX += x;		if (cgs.cursorX < 0) {			cgs.cursorX = 0;		} else if (cgs.cursorX > 640) {			cgs.cursorX = 640;		}		cgs.cursorY += y;		if (cgs.cursorY < 0) {			cgs.cursorY = 0;		} else if (cgs.cursorY > 480) {			cgs.cursorY = 480;		}		if ((int)cgs.eventHandling == CGAME_EVENT_SPEAKEREDITOR) {			CG_SpeakerEditorMouseMove_Handling(x, y);		}		break;	case CGAME_EVENT_DEMO:		cgs.cursorX += x;		if (cgs.cursorX < 0) {			cgs.cursorX = 0;		} else if (cgs.cursorX > 640) {			cgs.cursorX = 640;		}		cgs.cursorY += y;		if (cgs.cursorY < 0) {			cgs.cursorY = 0;		} else if (cgs.cursorY > 480) {			cgs.cursorY = 480;		}		if (x != 0 || y != 0) {			cgs.cursorUpdate = cg.time + 5000;		}		break;	default:		// default handling		if ((cg.predictedPlayerState.pm_type == PM_NORMAL ||		     cg.predictedPlayerState.pm_type == PM_SPECTATOR) &&		    cg.showScores == qfalse) {			trap_Key_SetCatcher(trap_Key_GetCatcher() & ~KEYCATCH_CGAME);			return;		}		break;	}}
开发者ID:Exosum,项目名称:ETrun,代码行数:57,


示例8: 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,


示例9: UI_CloseMenus_f

static void UI_CloseMenus_f( void ){    if( Menu_Count( ) > 0 )    {      trap_Key_SetCatcher( trap_Key_GetCatcher( ) & ~KEYCATCH_UI );      trap_Key_ClearStates( );      trap_Cvar_Set( "cl_paused", "0" );      Menus_CloseAll( );    }}
开发者ID:otty,项目名称:cake3,代码行数:10,


示例10: UI_PushMenu

/*=================UI_PushMenu=================*/void UI_PushMenu( menuframework_s *menu ){	int				i;	menucommon_s*	item;	// avoid stacking menus invoked by hotkeys	for (i=0 ; i<uis.menusp ; i++)	{		if (uis.stack[i] == menu)		{			uis.menusp = i;			break;		}	}	if (i == uis.menusp)	{		if (uis.menusp >= MAX_MENUDEPTH)			trap_Error("UI_PushMenu: menu stack overflow");		uis.stack[uis.menusp++] = menu;	}	uis.activemenu = menu;	// default cursor position	menu->cursor      = 0;	menu->cursor_prev = 0;	// pushmenu pushmenu has more priority than popmenu	soundTime = 0;	UI_StartSound( menu_in_sound );	soundTime = uis.realtime + 150;	trap_Key_SetCatcher( KEYCATCH_UI );	// force first available item to have focus	for (i=0; i<menu->nitems; i++)	{		item = (menucommon_s *)menu->items[i];		if (!(item->flags & (QMF_GRAYED|QMF_MOUSEONLY|QMF_INACTIVE)))		{			menu->cursor_prev = -1;			Menu_SetCursor( menu, i );			break;		}	}	uis.firstdraw = qtrue;}
开发者ID:linux26,项目名称:corkscrew,代码行数:55,


示例11: CG_KeyEvent

void CG_KeyEvent( int key, int chr, int flags ){	if ( !( flags & KEYEVSTATE_DOWN ) )	{		return;	}	if ( cg.predictedPlayerState.pm_type == PM_NORMAL ||	     ( cg.predictedPlayerState.pm_type == PM_SPECTATOR &&	       cg.showScores == qfalse ) )	{		trap_Key_SetCatcher( 0 );		return;	}}
开发者ID:rubybrawler,项目名称:Unvanquished,代码行数:15,


示例12: Con_ToggleConsole_f

/*================Con_ToggleConsole_f================*/void Con_ToggleConsole_f (void) {	uiClientState_t	cls;	trap_GetClientState( &cls );	// Can't toggle the console when it's the only thing available	if ( cls.connState == CA_DISCONNECTED && trap_Key_GetCatcher( ) == KEYCATCH_CONSOLE ) {		return;	}	if ( con_autoclear.integer ) {		MField_Clear( &g_consoleField );	}	g_consoleField.widthInChars = g_console_field_width;	trap_Key_SetCatcher( trap_Key_GetCatcher( ) ^ KEYCATCH_CONSOLE );}
开发者ID:mecwerks,项目名称:spearmint-ios,代码行数:23,


示例13: UI_ConsoleCommand

/*=================UI_ConsoleCommand=================*/qboolean UI_ConsoleCommand( int realTime ) {	char	*cmd;	uiInfo.uiDC.frameTime = realTime - uiInfo.uiDC.realTime;	uiInfo.uiDC.realTime = realTime;	cmd = UI_Argv( 0 );	// ensure minimum menu data is available	//Menu_Cache();	if ( Q_stricmp (cmd, "ui_test") == 0 ) {		UI_ShowPostGame(qtrue);	}	if ( Q_stricmp (cmd, "ui_report") == 0 ) {		UI_Report();		return qtrue;	}		if ( Q_stricmp (cmd, "ui_load") == 0 ) {		UI_Load();		return qtrue;	}	if ( Q_stricmp (cmd, "ui_opensiegemenu" ) == 0 ) 	{		if ( trap_Cvar_VariableValue ( "g_gametype" ) == GT_SIEGE )		{			Menus_CloseAll();			if (Menus_ActivateByName(UI_Argv(1)))			{				trap_Key_SetCatcher( KEYCATCH_UI );			}		}		return qtrue;	}	if ( Q_stricmp (cmd, "ui_openmenu" ) == 0 ) 	{		//if ( trap_Cvar_VariableValue ( "developer" ) )		{			Menus_CloseAll();			if (Menus_ActivateByName(UI_Argv(1)))			{				trap_Key_SetCatcher( KEYCATCH_UI );			}			return qtrue;		}	}	/*	if ( Q_stricmp (cmd, "remapShader") == 0 ) {		if (trap_Argc() == 4) {			char shader1[MAX_QPATH];			char shader2[MAX_QPATH];			Q_strncpyz(shader1, UI_Argv(1), sizeof(shader1));			Q_strncpyz(shader2, UI_Argv(2), sizeof(shader2));			trap_R_RemapShader(shader1, shader2, UI_Argv(3));			return qtrue;		}	}	*/	if ( Q_stricmp (cmd, "postgame") == 0 ) {		UI_CalcPostGameStats();		return qtrue;	}	if ( Q_stricmp (cmd, "ui_cache") == 0 ) {		UI_Cache_f();		return qtrue;	}	if ( Q_stricmp (cmd, "ui_teamOrders") == 0 ) {		//UI_TeamOrdersMenu_f();		return qtrue;	}	if ( Q_stricmp (cmd, "pause") == 0 ) {		return qtrue;	}	return qfalse;}
开发者ID:deathsythe47,项目名称:jaMME,代码行数:88,


示例14: UI_MainMenu

/*===============UI_MainMenuThe main menu only comes up when not in a game,so make sure that the attract loop server is downand that local cinematics are killed===============*/void UI_MainMenu( void ){	int		y;	qboolean teamArena = qfalse;	int		style = UI_CENTER | UI_DROPSHADOW;	trap_Cvar_Set( "sv_killserver", "1" );	trap_Cvar_SetValue( "handicap", 100 ); //Reset handicap during server change, it must be ser per game	memset( &s_main, 0 ,sizeof(mainmenu_t) );	memset( &s_errorMessage, 0 ,sizeof(errorMessage_t) );	// com_errorMessage would need that too	MainMenu_Cache();	trap_Cvar_VariableStringBuffer( "com_errorMessage", s_errorMessage.errorMessage, sizeof(s_errorMessage.errorMessage) );	if (strlen(s_errorMessage.errorMessage)) {		s_errorMessage.menu.draw = Main_MenuDraw;		s_errorMessage.menu.key = ErrorMessage_Key;		s_errorMessage.menu.fullscreen = qtrue;		s_errorMessage.menu.wrapAround = qtrue;		s_errorMessage.menu.showlogo = qtrue;		trap_Key_SetCatcher( KEYCATCH_UI );		uis.menusp = 0;		UI_PushMenu ( &s_errorMessage.menu );		return;	}	s_main.menu.draw = Main_MenuDraw;	s_main.menu.fullscreen = qtrue;	s_main.menu.wrapAround = qtrue;	s_main.menu.showlogo = qtrue;	y = 134;	s_main.singleplayer.generic.type		= MTYPE_PTEXT;	s_main.singleplayer.generic.flags		= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.singleplayer.generic.x			= 320;	s_main.singleplayer.generic.y			= y;	s_main.singleplayer.generic.id			= ID_SINGLEPLAYER;	s_main.singleplayer.generic.callback	= Main_MenuEvent;	s_main.singleplayer.string				= "SINGLE PLAYER";	s_main.singleplayer.color				= color_red;	s_main.singleplayer.style				= style;	y += MAIN_MENU_VERTICAL_SPACING;	s_main.multiplayer.generic.type			= MTYPE_PTEXT;	s_main.multiplayer.generic.flags		= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.multiplayer.generic.x			= 320;	s_main.multiplayer.generic.y			= y;	s_main.multiplayer.generic.id			= ID_MULTIPLAYER;	s_main.multiplayer.generic.callback		= Main_MenuEvent;	s_main.multiplayer.string				= "MULTIPLAYER";	s_main.multiplayer.color				= color_red;	s_main.multiplayer.style				= style;	y += MAIN_MENU_VERTICAL_SPACING;	s_main.setup.generic.type				= MTYPE_PTEXT;	s_main.setup.generic.flags				= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.setup.generic.x					= 320;	s_main.setup.generic.y					= y;	s_main.setup.generic.id					= ID_SETUP;	s_main.setup.generic.callback			= Main_MenuEvent;	s_main.setup.string						= "SETUP";	s_main.setup.color						= color_red;	s_main.setup.style						= style;	y += MAIN_MENU_VERTICAL_SPACING;	s_main.demos.generic.type				= MTYPE_PTEXT;	s_main.demos.generic.flags				= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.demos.generic.x					= 320;	s_main.demos.generic.y					= y;	s_main.demos.generic.id					= ID_DEMOS;	s_main.demos.generic.callback			= Main_MenuEvent;	s_main.demos.string						= "DEMOS";	s_main.demos.color						= color_red;	s_main.demos.style						= style;	/*y += MAIN_MENU_VERTICAL_SPACING;	s_main.cinematics.generic.type			= MTYPE_PTEXT;	s_main.cinematics.generic.flags			= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.cinematics.generic.x				= 320;	s_main.cinematics.generic.y				= y;	s_main.cinematics.generic.id			= ID_CINEMATICS;	s_main.cinematics.generic.callback		= Main_MenuEvent;	s_main.cinematics.string				= "CINEMATICS";	s_main.cinematics.color					= color_red;	s_main.cinematics.style					= style;*/	y += MAIN_MENU_VERTICAL_SPACING;//.........这里部分代码省略.........
开发者ID:OpenArena,项目名称:gamecode,代码行数:101,


示例15: UI_LoadMenu_f

/*===============UI_LoadMenu_f===============*/static void UI_LoadMenu_f( void ) {	trap_Key_SetCatcher( KEYCATCH_UI );	Menus_ActivateByName("ingameloadMenu");}
开发者ID:blaenk,项目名称:jedioutcast,代码行数:10,


示例16: UI_MainMenu

/*===============UI_MainMenuThe main menu only comes up when not in a game,so make sure that the attract loop server is downand that local cinematics are killed===============*/void UI_MainMenu( void ) {	int		y;	int		style = UI_CENTER | UI_DROPSHADOW;	trap_Cvar_Set( "sv_killserver", "1" );/* blud, commenting out the cdkey check since iourt doesn't need one	if( !uis.demoversion && !ui_cdkeychecked.integer ) {		char	key[17];		trap_GetCDKey( key, sizeof(key) );		if( trap_VerifyCDKey( key, NULL ) == qfalse ) {			UI_CDKeyMenu();			return;		}	}*/	memset( &s_main, 0 ,sizeof(mainmenu_t) );	memset( &s_errorMessage, 0 ,sizeof(errorMessage_t) );	// com_errorMessage would need that too	MainMenu_Cache();	trap_Cvar_VariableStringBuffer( "com_errorMessage", s_errorMessage.errorMessage, sizeof(s_errorMessage.errorMessage) );	if (strlen(s_errorMessage.errorMessage))	{		s_errorMessage.menu.draw = Main_MenuDraw;		s_errorMessage.menu.key = ErrorMessage_Key;		s_errorMessage.menu.fullscreen = qtrue;		s_errorMessage.menu.wrapAround = qtrue;		s_errorMessage.menu.showlogo = qtrue;		trap_Key_SetCatcher( KEYCATCH_UI );		uis.menusp = 0;		UI_PushMenu ( &s_errorMessage.menu );		return;	}	s_main.menu.draw = Main_MenuDraw;	s_main.menu.fullscreen = qtrue;	s_main.menu.wrapAround = qtrue;	s_main.menu.showlogo = qtrue;	y = 134;	s_main.singleplayer.generic.type		= MTYPE_PTEXT;	s_main.singleplayer.generic.flags		= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.singleplayer.generic.x			= 320;	s_main.singleplayer.generic.y			= y;	s_main.singleplayer.generic.id			= ID_SINGLEPLAYER;	s_main.singleplayer.generic.callback	= Main_MenuEvent;	s_main.singleplayer.string				= "SINGLE PLAYER";	s_main.singleplayer.color				= color_white;	s_main.singleplayer.style				= style;	y += MAIN_MENU_VERTICAL_SPACING;	s_main.multiplayer.generic.type			= MTYPE_PTEXT;	s_main.multiplayer.generic.flags		= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.multiplayer.generic.x			= 320;	s_main.multiplayer.generic.y			= y;	s_main.multiplayer.generic.id			= ID_MULTIPLAYER;	s_main.multiplayer.generic.callback		= Main_MenuEvent;	s_main.multiplayer.string				= "MULTIPLAYER";	s_main.multiplayer.color				= color_white;	s_main.multiplayer.style				= style;	y += MAIN_MENU_VERTICAL_SPACING;	s_main.setup.generic.type				= MTYPE_PTEXT;	s_main.setup.generic.flags				= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.setup.generic.x					= 320;	s_main.setup.generic.y					= y;	s_main.setup.generic.id					= ID_SETUP;	s_main.setup.generic.callback			= Main_MenuEvent;	s_main.setup.string						= "SETUP";	s_main.setup.color						= color_white;	s_main.setup.style						= style;// blud commenting out these menu items below!/*blud	y += MAIN_MENU_VERTICAL_SPACING;	s_main.demos.generic.type				= MTYPE_PTEXT;	s_main.demos.generic.flags				= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.demos.generic.x					= 320;	s_main.demos.generic.y					= y;	s_main.demos.generic.id					= ID_DEMOS;	s_main.demos.generic.callback			= Main_MenuEvent;	s_main.demos.string						= "DEMOS";	s_main.demos.color						= color_red;	s_main.demos.style						= style;//.........这里部分代码省略.........
开发者ID:bludshot,项目名称:alturt,代码行数:101,


示例17: UI_ConsoleCommand

/*=================UI_ConsoleCommand=================*/qboolean UI_ConsoleCommand( int realTime ) {	char	*cmd;	uiInfo.uiDC.frameTime = realTime - uiInfo.uiDC.realTime;	uiInfo.uiDC.realTime = realTime;	cmd = UI_Argv( 0 );	// ensure minimum menu data is available	//Menu_Cache();// JKG - Only allow these commands if we're using a debug compile// We don't want players fuckin around with these#ifdef _DEBUG	if ( Q_stricmp (cmd, "ui_report") == 0 ) {		UI_Report();		return qtrue;	}	/*if ( Q_stricmp (cmd, "ui_testmaster") == 0) {		JKG_GLUI_Task_Test(testMasterFinalFunc);		return qtrue;	}	if ( Q_stricmp (cmd, "ui_testterms") == 0) {		JKG_GLUI_Task_GetTermsOfUse(termsMasterFinalFunc);		return qtrue;	}	if ( Q_stricmp (cmd, "ui_testregister") == 0 ) {		char username[32];		char password[32];		char email[64];		trap_Argv(1, username, 32);		trap_Argv(2, password, 32);		trap_Argv(3, email, 32);		JKG_GLUI_Task_RegisterUser(username, password, email, registerFinalFunc);		return qtrue;	}	if ( Q_stricmp (cmd, "ui_testlogin") == 0 ) {		char username[32];		char password[32];		trap_Argv(1, username, 32);		trap_Argv(2, password, 32);		JKG_GLUI_Task_Login(username, password, loginFinalFunc);		return qtrue;	}*/			if ( Q_stricmp (cmd, "ui_report") == 0 ) {		UI_Report();		return qtrue;	}		if ( Q_stricmp (cmd, "ui_load") == 0 ) {		UI_Load();		return qtrue;	}	if ( Q_stricmp (cmd, "ui_openmenu" ) == 0 ) 	{		//if ( trap_Cvar_VariableValue ( "developer" ) )		{			Menus_CloseAll();			if (Menus_ActivateByName(UI_Argv(1)))			{				trap_Key_SetCatcher( KEYCATCH_UI );			}			return qtrue;		}	}	if ( Q_stricmp (cmd, "ui_cache") == 0 ) {		UI_Cache_f();		return qtrue;	}	if ( Q_stricmp (cmd, "ui_teamOrders") == 0 ) {		//UI_TeamOrdersMenu_f();		return qtrue;	}#endif // _DEBUG	return qfalse;}
开发者ID:Resuru,项目名称:JediKnightGalaxies,代码行数:99,


示例18: UI_SPPostgameMenu_f

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


示例19: CG_MouseEvent

//.........这里部分代码省略.........		{			cgs.cursorX = SCREEN_WIDTH_SAFE;		}		cgs.cursorY += y;		if (cgs.cursorY < 0)		{			cgs.cursorY = 0;		}		else if (cgs.cursorY > SCREEN_HEIGHT_SAFE)		{			cgs.cursorY = SCREEN_HEIGHT_SAFE;		}		if (cgs.eventHandling == CGAME_EVENT_SPEAKEREDITOR)		{			CG_SpeakerEditorMouseMove_Handling(x, y);		}#ifdef FEATURE_EDV	}	else	{		// mousemovement *should* feel the same as ingame		char buffer[64];		int  mx = 0, my = 0;		int  mouse_x_pos = 0, mouse_y_pos = 0;		float sensitivity, m_pitch, m_yaw;		int   m_filter = 0;		if (demo_lookat.integer != -1)		{			return;		}		mx += x;		my += y;		trap_Cvar_VariableStringBuffer("m_filter", buffer, sizeof(buffer));		m_filter = atoi(buffer);		trap_Cvar_VariableStringBuffer("sensitivity", buffer, sizeof(buffer));		sensitivity = atof(buffer);		trap_Cvar_VariableStringBuffer("m_pitch", buffer, sizeof(buffer));		m_pitch = atof(buffer);		trap_Cvar_VariableStringBuffer("m_yaw", buffer, sizeof(buffer));		m_yaw = atof(buffer);		if (m_filter)		{			mouse_x_pos = (mx + old_mouse_x_pos) / 2;			mouse_y_pos = (my + old_mouse_y_pos) / 2;		}		else		{			mouse_x_pos = mx;			mouse_y_pos = my;		}		old_mouse_x_pos = mx;		old_mouse_y_pos = my;		mouse_x_pos *= sensitivity;		mouse_y_pos *= sensitivity;		cg.refdefViewAngles[YAW]   -= m_yaw * mouse_x_pos;		cg.refdefViewAngles[PITCH] += m_pitch * mouse_y_pos;		if (cg.refdefViewAngles[PITCH] < -90)		{			cg.refdefViewAngles[PITCH] = -90;		}		if (cg.refdefViewAngles[PITCH] > 90)		{			cg.refdefViewAngles[PITCH] = 90;		}	}#endif		break;	default:		if (cg.snap->ps.pm_type == PM_INTERMISSION)		{			CG_Debriefing_MouseEvent(x, y);			return;		}		// default handling		if ((cg.predictedPlayerState.pm_type == PM_NORMAL ||		     cg.predictedPlayerState.pm_type == PM_SPECTATOR) &&		    cg.showScores == qfalse)		{			trap_Key_SetCatcher(trap_Key_GetCatcher() & ~KEYCATCH_CGAME);			return;		}		break;	}}
开发者ID:ioid3-games,项目名称:ioid3-wet,代码行数:101,


示例20: CG_CloseConsole

void CG_CloseConsole( void ) {	MField_Clear( &g_consoleField );	trap_Key_SetCatcher( trap_Key_GetCatcher( ) & ~KEYCATCH_CONSOLE );	con.finalFrac = 0;				// none visible	con.displayFrac = 0;}
开发者ID:mecwerks,项目名称:spearmint-ios,代码行数:6,


示例21: UI_MainMenu

/*===============UI_MainMenuThe main menu only comes up when not in a game,so make sure that the attract loop server is downand that local cinematics are killed===============*/void UI_MainMenu( void ) {	int		y;	qboolean teamArena = qfalse;	int		style = UI_CENTER | UI_DROPSHADOW;	trap_Cvar_Set( "sv_killserver", "1" );		memset( &s_main, 0 ,sizeof(mainmenu_t) );	memset( &s_errorMessage, 0 ,sizeof(errorMessage_t) );	// com_errorMessage would need that too	MainMenu_Cache();		trap_Cvar_VariableStringBuffer( "com_errorMessage", s_errorMessage.errorMessage, sizeof(s_errorMessage.errorMessage) );	if (strlen(s_errorMessage.errorMessage))	{			s_errorMessage.menu.draw = Main_MenuDraw;		s_errorMessage.menu.key = ErrorMessage_Key;		s_errorMessage.menu.fullscreen = qtrue;		s_errorMessage.menu.wrapAround = qtrue;		trap_Key_SetCatcher( KEYCATCH_UI );		uis.menusp = 0;		UI_PushMenu ( &s_errorMessage.menu );				return;	}	s_main.menu.draw = Main_MenuDraw;	s_main.menu.fullscreen = qtrue;	s_main.menu.wrapAround = qtrue;	y = 330;#define PLACE_X 530	s_main.demos.generic.type				= MTYPE_PTEXT;	s_main.demos.generic.flags				= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.demos.generic.x					= PLACE_X;	s_main.demos.generic.y					= y;	s_main.demos.generic.id					= ID_DEMOS;	s_main.demos.generic.callback			= Main_MenuEvent; 	s_main.demos.string						= "DEMOS";	s_main.demos.color						= color_red;	s_main.demos.style						= style;	y += MAIN_MENU_VERTICAL_SPACING;	s_main.setup.generic.type				= MTYPE_PTEXT;	s_main.setup.generic.flags				= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.setup.generic.x					= PLACE_X;	s_main.setup.generic.y					= y;	s_main.setup.generic.id					= ID_SETUP;	s_main.setup.generic.callback			= Main_MenuEvent; 	s_main.setup.string						= "SETUP";	s_main.setup.color						= color_red;	s_main.setup.style						= style;	y += MAIN_MENU_VERTICAL_SPACING;	s_main.credits.generic.type				= MTYPE_PTEXT;	s_main.credits.generic.flags			= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.credits.generic.x				= PLACE_X;	s_main.credits.generic.y				= y;	s_main.credits.generic.id				= ID_CREDITS;	s_main.credits.generic.callback			= Main_MenuEvent; 	s_main.credits.string					= "CREDITS";	s_main.credits.color					= color_red;	s_main.credits.style					= style;	y += MAIN_MENU_VERTICAL_SPACING;	s_main.exit.generic.type				= MTYPE_PTEXT;	s_main.exit.generic.flags				= QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.exit.generic.x					= PLACE_X;	s_main.exit.generic.y					= y;	s_main.exit.generic.id					= ID_EXIT;	s_main.exit.generic.callback			= Main_MenuEvent; 	s_main.exit.string						= "EXIT";	s_main.exit.color						= color_red;	s_main.exit.style						= style;	Menu_AddItem( &s_main.menu,	&s_main.demos );	Menu_AddItem( &s_main.menu,	&s_main.setup );	Menu_AddItem( &s_main.menu,	&s_main.credits );	Menu_AddItem( &s_main.menu,	&s_main.exit );             	trap_Key_SetCatcher( KEYCATCH_UI );	uis.menusp = 0;	UI_PushMenu ( &s_main.menu );		}
开发者ID:entdark,项目名称:q3mme,代码行数:97,


示例22: UI_ConsoleCommand

/*=================UI_ConsoleCommand=================*/qboolean UI_ConsoleCommand(int realTime){	char           *cmd;	char           *arg1;	uiInfo.uiDC.frameTime = realTime - uiInfo.uiDC.realTime;	uiInfo.uiDC.realTime = realTime;	cmd = UI_Argv(0);	// ensure minimum menu data is available	//Menu_Cache();	if(Q_stricmp(cmd, "ui_test") == 0)	{		UI_ShowPostGame(qtrue);	}	if(Q_stricmp(cmd, "ui_report") == 0)	{		UI_Report();		return qtrue;	}	if(Q_stricmp(cmd, "ui_load") == 0)	{		UI_Load();		return qtrue;	}	if(Q_stricmp(cmd, "remapShader") == 0)	{		if(trap_Argc() == 4)		{			char            shader1[MAX_QPATH];			char            shader2[MAX_QPATH];			Q_strncpyz(shader1, UI_Argv(1), sizeof(shader1));			Q_strncpyz(shader2, UI_Argv(2), sizeof(shader2));			trap_R_RemapShader(shader1, shader2, UI_Argv(3));			return qtrue;		}	}	if(Q_stricmp(cmd, "postgame") == 0)	{		UI_CalcPostGameStats();		return qtrue;	}	if(Q_stricmp(cmd, "ui_cache") == 0)	{		UI_Cache_f();		return qtrue;	}	if(Q_stricmp(cmd, "ui_teamOrders") == 0)	{		//UI_TeamOrdersMenu_f();		return qtrue;	}	if(Q_stricmp(cmd, "menu") == 0)	{		arg1 = UI_Argv(1);		if(Menu_Count() > 0)		{			trap_Key_SetCatcher(KEYCATCH_UI);			Menus_ActivateByName(arg1);			return qtrue;		}	}	if(Q_stricmp(cmd, "closemenus") == 0)	{		if(Menu_Count() > 0)		{			trap_Key_SetCatcher(trap_Key_GetCatcher() & ~KEYCATCH_UI);			trap_Key_ClearStates();			trap_Cvar_Set("cl_paused", "0");			Menus_CloseAll();			return qtrue;		}	}	return qfalse;}
开发者ID:redrumrobot,项目名称:dretchstorm,代码行数:93,


示例23: UI_MainMenu

//.........这里部分代码省略.........	s_main.menu.draw = Main_MenuDraw;	s_main.menu.fullscreen = qtrue;	s_main.menu.wrapAround = qtrue;	s_main.backleft.generic.type	= MTYPE_BITMAP;	s_main.backleft.generic.name	= MAIN_BACKGROUND_LEFT;	s_main.backleft.generic.flags	= QMF_INACTIVE;	s_main.backleft.generic.x		= 0;  	s_main.backleft.generic.y		= 120;	s_main.backleft.width			= 320;	s_main.backleft.height			= 360;	s_main.backright.generic.type	= MTYPE_BITMAP;	s_main.backright.generic.name	= MAIN_BACKGROUND_RIGHT;	s_main.backright.generic.flags	= QMF_INACTIVE;	s_main.backright.generic.x		= 320;  	s_main.backright.generic.y		= 120;	s_main.backright.width			= 320;	s_main.backright.height			= 360;	y = 160;	s_main.joingame.generic.type			= MTYPE_PTEXT;	s_main.joingame.generic.flags			= QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.joingame.generic.x				= 20;	s_main.joingame.generic.y				= y;	s_main.joingame.generic.id				= ID_JOINGAME;	s_main.joingame.generic.callback		= Main_MenuEvent; 	s_main.joingame.string					= "JOIN GAME";	s_main.joingame.color					= color_orange;	s_main.joingame.style					= style;	y += MAIN_MENU_VERTICAL_SPACING;	s_main.startserver.generic.type			= MTYPE_PTEXT;	s_main.startserver.generic.flags		= QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.startserver.generic.x			= 20;	s_main.startserver.generic.y			= y;	s_main.startserver.generic.id			= ID_STARTSERVER;	s_main.startserver.generic.callback		= Main_MenuEvent; 	s_main.startserver.string				= "START SERVER";	s_main.startserver.color				= color_orange;	s_main.startserver.style				= style;	y += MAIN_MENU_VERTICAL_SPACING;	s_main.setup.generic.type				= MTYPE_PTEXT;	s_main.setup.generic.flags				= QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.setup.generic.x					= 20;	s_main.setup.generic.y					= y;	s_main.setup.generic.id					= ID_SETUP;	s_main.setup.generic.callback			= Main_MenuEvent; 	s_main.setup.string						= "SETUP";	s_main.setup.color						= color_orange;	s_main.setup.style						= style;	y += MAIN_MENU_VERTICAL_SPACING;	s_main.demos.generic.type				= MTYPE_PTEXT;	s_main.demos.generic.flags				= QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.demos.generic.x					= 20;	s_main.demos.generic.y					= y;	s_main.demos.generic.id					= ID_DEMOS;	s_main.demos.generic.callback			= Main_MenuEvent; 	s_main.demos.string						= "DEMOS";	s_main.demos.color						= color_orange;	s_main.demos.style						= style;	y += MAIN_MENU_VERTICAL_SPACING;	s_main.mods.generic.type				= MTYPE_PTEXT;	s_main.mods.generic.flags				= QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.mods.generic.x					= 20;	s_main.mods.generic.y					= y;	s_main.mods.generic.id					= ID_MODS;	s_main.mods.generic.callback			= Main_MenuEvent; 	s_main.mods.string						= "MODS";	s_main.mods.color						= color_orange;	s_main.mods.style						= style;	y += MAIN_MENU_VERTICAL_SPACING;	s_main.exit.generic.type				= MTYPE_PTEXT;	s_main.exit.generic.flags				= QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;	s_main.exit.generic.x					= 20;	s_main.exit.generic.y					= y;	s_main.exit.generic.id					= ID_EXIT;	s_main.exit.generic.callback			= Main_MenuEvent; 	s_main.exit.string						= "EXIT";	s_main.exit.color						= color_orange;	s_main.exit.style						= style;	Menu_AddItem( &s_main.menu,	&s_main.backleft );	Menu_AddItem( &s_main.menu,	&s_main.backright );	Menu_AddItem( &s_main.menu,	&s_main.joingame );	Menu_AddItem( &s_main.menu,	&s_main.startserver );	Menu_AddItem( &s_main.menu,	&s_main.setup );	Menu_AddItem( &s_main.menu,	&s_main.demos );	Menu_AddItem( &s_main.menu,	&s_main.mods );	Menu_AddItem( &s_main.menu,	&s_main.exit );             	uis.addToFavorites = qfalse;	trap_Key_SetCatcher( KEYCATCH_UI );	uis.menusp = 0;	UI_PushMenu ( &s_main.menu );}
开发者ID:ElderPlayerX,项目名称:Afterwards,代码行数:101,


示例24: CG_BuyMenu

//set up the menuvoid CG_BuyMenu (void) {    if(cgs.gametype == GT_DUEL && cg.introend < cg.time)        return;    if(cg.snap->ps.persistant[PERS_TEAM] >= TEAM_SPECTATOR)        return;    if(cg.snap->ps.stats[STAT_HEALTH] <= 0)        return;    // if one is too far away from buy-point    if(!(cg.snap->ps.stats[STAT_FLAGS] & SF_CANBUY) && (cgs.gametype >= GT_RTP))        return;    /* as suggested by The Doctor, this test shouldn't be done in cgame, it is already done in game, it removes a bug    // if it's to late to buy    if(cg.time - cg.roundstarttime > BUY_TIME && cgs.gametype >= GT_RTP){    	CG_Printf("60 seconds have passed ... you can't buy anything/n");    	return;    }    */    // if we're throwing away the gatling and it's being used, abort    /*if(cg.snap->ps.weapon == WP_GATLING && cg.snap->ps.stats[STAT_GATLING_MODE])    	return;*/ // weapon change isn't activated anymore when buying and having a gatling    // show the menu    if(menuBuy == NULL) {        menuBuy = Menus_FindByName("buymenu");        save_menuBuy.x = menuBuy->window.rect.x;        save_menuBuy.y = menuBuy->window.rect.y;    }    if(menuItem == NULL) {        menuItem = Menus_FindByName("buymenu_items");        save_menuItem.x = menuItem->window.rect.x;        save_menuItem.y = menuItem->window.rect.y;    }    cgs.cursorX = cgs.cursorY = 0;    cg.menu = MENU_BUY;    cg.menustat = 1;    cg.menumove = qtrue;    cg.menuitem = 0;    cg.oldbutton = qfalse;    CG_ClearFocusses();    if(cgs.gametype == GT_DUEL) {        int i;        // set focus to 1st item        cg.menuitem = 1;        for(i=0; i< menuItem->itemCount; i++) {            if(menuItem->items[i]->window.ownerDraw == CG_BUTTON1) {                menuItem->items[i]->window.flags |= WINDOW_HASFOCUS;                break;            }        }    }    trap_Cvar_Set("cl_menu", "0");    trap_Key_SetCatcher(KEYCATCH_CGAME);    // Notify the server we open the buy menu.    // The "client" engine code will set BUTTON_BUYMENU to usercmd_t.buttons .    trap_SendConsoleCommand( "+button8" );}
开发者ID:smokin-guns,项目名称:SmokinGuns,代码行数:71,


示例25: CG_EventHandling

/*==================CG_EventHandling==================*/void CG_EventHandling( int type, qboolean fForced ){//	CG_Printf("EventHandling: %d/n", type);	if( cg.demoPlayback && type == CGAME_EVENT_NONE && !fForced ) {		type = CGAME_EVENT_DEMO;	}	if( type != CGAME_EVENT_NONE ) {		trap_Cvar_Set( "cl_bypassMouseInput", 0 );	}	switch( type ) {		// OSP - Demo support		case CGAME_EVENT_DEMO:			cgs.fResize = qfalse;			cgs.fSelect = qfalse;			cgs.cursorUpdate = cg.time + 10000;			cgs.timescaleUpdate = cg.time + 4000;			CG_ScoresUp_f();			break;		case CGAME_EVENT_SPEAKEREDITOR:		case CGAME_EVENT_GAMEVIEW:		case CGAME_EVENT_NONE:		case CGAME_EVENT_CAMPAIGNBREIFING:		case CGAME_EVENT_FIRETEAMMSG:		case CGAME_EVENT_MULTIVIEW:		default:			// default handling (cleanup mostly)			if( cgs.eventHandling == CGAME_EVENT_HUDEDITOR) {				// forty - visual hud editor				cg.hudEditor.showHudEditor = qfalse;			} else if(cgs.eventHandling == CGAME_EVENT_MULTIVIEW) {				if( type == -CGAME_EVENT_MULTIVIEW) {					type = CGAME_EVENT_NONE;				} else {					trap_Key_SetCatcher( KEYCATCH_CGAME );					return;				}			} else if( cgs.eventHandling == CGAME_EVENT_GAMEVIEW ) {				cg.showGameView = qfalse;				trap_S_FadeBackgroundTrack( 0.0f, 500, 0 );				trap_S_StopStreamingSound( -1 );				cg.limboEndCinematicTime = 0;				if( fForced ) {					if( cgs.limboLoadoutModified ) {						trap_SendClientCommand( "rs" );						cgs.limboLoadoutSelected = qfalse;					}				}			} else if( cgs.eventHandling == CGAME_EVENT_SPEAKEREDITOR ) {				if( type == -CGAME_EVENT_SPEAKEREDITOR ) {					type = CGAME_EVENT_NONE;				} else {					trap_Key_SetCatcher( KEYCATCH_CGAME );					return;				}			} else if( cgs.eventHandling == CGAME_EVENT_CAMPAIGNBREIFING ) {				type = CGAME_EVENT_GAMEVIEW;			} else if( cgs.eventHandling == CGAME_EVENT_FIRETEAMMSG ) {				cg.showFireteamMenu = qfalse;												trap_Cvar_Set( "cl_bypassmouseinput", "0" );			} else if( cg.snap && cg.snap->ps.pm_type == PM_INTERMISSION && fForced ) {				trap_UI_Popup( UIMENU_INGAME );			}			break;	}	cgs.eventHandling = type;	if(type == CGAME_EVENT_NONE) {		trap_Key_SetCatcher(trap_Key_GetCatcher() & ~KEYCATCH_CGAME);		ccInitial = qfalse;		if(cg.demoPlayback && cg.demohelpWindow != SHOW_OFF) {			CG_ShowHelp_Off(&cg.demohelpWindow);		}	} else if( type == CGAME_EVENT_HUDEDITOR ) {		// forty - visual hud editor		cg.hudEditor.showHudEditor = qtrue;		trap_Key_SetCatcher(KEYCATCH_CGAME);	} else if( type == CGAME_EVENT_MULTIVIEW ) {		trap_Key_SetCatcher(KEYCATCH_CGAME);	} else if( type == CGAME_EVENT_GAMEVIEW ) {		cg.showGameView = qtrue;		CG_LimboPanel_Setup();		trap_Key_SetCatcher(KEYCATCH_CGAME);	} else if( type == CGAME_EVENT_FIRETEAMMSG ) {		cgs.ftMenuPos = -1;//.........这里部分代码省略.........
开发者ID:BulldogDrummond,项目名称:etpub,代码行数:101,


示例26: CG_SetKeyCatcher

void CG_SetKeyCatcher( int catcher ){	rocketInfo.keyCatcher = catcher;	Rocket_SetActiveContext( catcher );	trap_Key_SetCatcher( catcher );}
开发者ID:Tomtom-mygit,项目名称:Unvanquished,代码行数:6,


示例27: UI_SPLevelMenu_f

/*=================UI_SPLevelMenu_f=================*/void UI_SPLevelMenu_f( void ) {	trap_Key_SetCatcher( KEYCATCH_UI );	uis.menusp = 0;	UI_SPLevelMenu();}
开发者ID:ElderPlayerX,项目名称:Rune,代码行数:10,


示例28: UI_MainMenu

/*===============UI_MainMenuThe main menu only comes up when not in a game,so make sure that the attract loop server is downand that local cinematics are killed=============== */void UI_MainMenu(void) {    int x, y;    int style = UI_LEFT | UI_DROPSHADOW | UI_SMALLFONT;    trap_Cvar_Set("sv_killserver", "1");    memset(&s_main, 0, sizeof (mainmenu_t));    memset(&s_errorMessage, 0, sizeof (errorMessage_t));    MainMenu_Cache();    trap_Cvar_VariableStringBuffer("com_errorMessage", s_errorMessage.errorMessage, sizeof (s_errorMessage.errorMessage));    if (strlen(s_errorMessage.errorMessage)) {        s_errorMessage.menu.draw = Main_MenuDraw;        s_errorMessage.menu.key = ErrorMessage_Key;        s_errorMessage.menu.fullscreen = qtrue;        s_errorMessage.menu.wrapAround = qtrue;        s_errorMessage.menu.showlogo = qtrue;        trap_Key_SetCatcher(KEYCATCH_UI);        uis.menusp = 0;        UI_PushMenu(&s_errorMessage.menu);        return;    }    trap_S_StartBackgroundTrack("music/mainmenu.ogg", "");    s_main.menu.draw = Main_MenuDraw;    s_main.menu.fullscreen = qtrue;    s_main.menu.wrapAround = qtrue;    s_main.menu.showlogo = qfalse;    s_main.fade = -100.0f;    s_main.up = qtrue;    x = 40;    s_main.multiplayer.generic.type = MTYPE_PTEXT;    s_main.multiplayer.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;    s_main.multiplayer.generic.x = x;    s_main.multiplayer.generic.y = 440;    s_main.multiplayer.generic.id = ID_MULTIPLAYER;    s_main.multiplayer.generic.callback = Main_MenuEvent;    s_main.multiplayer.string = "Multiplayer";    s_main.multiplayer.color = color_blue;    s_main.multiplayer.style = style;    x += MAIN_MENU_HORIZONTAL_SPACING;    s_main.singleplayer.generic.type = MTYPE_PTEXT;    s_main.singleplayer.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;    s_main.singleplayer.generic.x = x;    s_main.singleplayer.generic.y = 440;    s_main.singleplayer.generic.id = ID_SINGLEPLAYER;    s_main.singleplayer.generic.callback = Main_MenuEvent;    s_main.singleplayer.string = "Singleplayer";    s_main.singleplayer.color = color_blue;    s_main.singleplayer.style = style;    x += MAIN_MENU_HORIZONTAL_SPACING;    s_main.options.generic.type = MTYPE_PTEXT;    s_main.options.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;    s_main.options.generic.x = x;    s_main.options.generic.y = 440;    s_main.options.generic.id = ID_OPTIONS;    s_main.options.generic.callback = Main_MenuEvent;    s_main.options.string = "Options";    s_main.options.color = color_blue;    s_main.options.style = style;    x += MAIN_MENU_HORIZONTAL_SPACING;    s_main.demos.generic.type = MTYPE_PTEXT;    s_main.demos.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;    s_main.demos.generic.x = x;    s_main.demos.generic.y = 440;    s_main.demos.generic.id = ID_DEMOS;    s_main.demos.generic.callback = Main_MenuEvent;    s_main.demos.string = "Demos";    s_main.demos.color = color_blue;    s_main.demos.style = style;    x += MAIN_MENU_HORIZONTAL_SPACING;    s_main.exit.generic.type = MTYPE_PTEXT;    s_main.exit.generic.flags = QMF_LEFT_JUSTIFY | QMF_PULSEIFFOCUS;    s_main.exit.generic.x = x;    s_main.exit.generic.y = 440;    s_main.exit.generic.id = ID_EXIT;    s_main.exit.generic.callback = Main_MenuEvent;    s_main.exit.string = "Exit";    s_main.exit.color = color_blue;    s_main.exit.style = style;//.........这里部分代码省略.........
开发者ID:zturtleman,项目名称:q3rain,代码行数:101,



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


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