当前位置: 首页>>代码示例>>C++>>正文


C++ Key_SetCatcher函数代码示例

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


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

示例1: Message_Key

/*
================
Message_Key

In game talk message
================
*/
void Message_Key( int key ) {

	char	buffer[MAX_STRING_CHARS];


	if (key == K_ESCAPE) {
		Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_MESSAGE );
		Field_Clear( &chatField );
		return;
	}

	if ( key == K_ENTER || key == K_KP_ENTER )
	{
		if ( chatField.buffer[0] && cls.state == CA_ACTIVE ) {
			if (chat_playerNum != -1 )

				Com_sprintf( buffer, sizeof( buffer ), "tell %i \"%s\"\n", chat_playerNum, chatField.buffer );

			else if (chat_team)

				Com_sprintf( buffer, sizeof( buffer ), "say_team \"%s\"\n", chatField.buffer );
			else
				Com_sprintf( buffer, sizeof( buffer ), "say \"%s\"\n", chatField.buffer );



			CL_AddReliableCommand( buffer, qfalse );
		}
		Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_MESSAGE );
		Field_Clear( &chatField );
		return;
	}

	Field_KeyDownEvent( &chatField, key );
}
开发者ID:BigJohnJD,项目名称:Quake-III-132,代码行数:42,代码来源:cl_keys.c

示例2: CL_MapLoading

/*
=====================
CL_MapLoading

A local server is starting to load a map, so update the
screen to let the user know about it, then dump all client
memory on the hunk from cgame, ui, and renderer
=====================
*/
void CL_MapLoading( void ) {
	if ( !com_cl_running->integer ) {
		return;
	}

	Con_Close();
	Key_SetCatcher( 0 );

	// if we are already connected to the local host, stay connected
	if ( cls.state >= CA_CONNECTED && !Q_stricmp( cls.servername, "localhost" ) )  {
		cls.state = CA_CONNECTED;		// so the connect screen is drawn
		memset( cls.updateInfoString, 0, sizeof( cls.updateInfoString ) );
//		memset( clc.serverMessage, 0, sizeof( clc.serverMessage ) );
		memset( &cl.gameState, 0, sizeof( cl.gameState ) );
		clc.lastPacketSentTime = -9999;
		SCR_UpdateScreen();
	} else {
		// clear nextmap so the cinematic shutdown doesn't execute it
		Cvar_Set( "nextmap", "" );
		CL_Disconnect();
		Q_strncpyz( cls.servername, "localhost", sizeof(cls.servername) );
		cls.state = CA_CHALLENGING;		// so the connect screen is drawn
		Key_SetCatcher( 0 );
		SCR_UpdateScreen();
		clc.connectTime = -RETRANSMIT_TIMEOUT;
		NET_StringToAdr( cls.servername, &clc.serverAddress);
		// we don't need a challenge on the localhost

		CL_CheckForResend();
	}

	CL_FlushMemory();
}
开发者ID:eezstreet,项目名称:OpenJK,代码行数:42,代码来源:cl_main.cpp

示例3: Rocket_RocketDebug_f

void Rocket_RocketDebug_f()
{
	static bool init = false;

	if ( !init )
	{
		Rocket::Debugger::Initialise(menuContext);
		init = true;
	}

	Rocket::Debugger::SetVisible( !Rocket::Debugger::IsVisible() );

	if ( Rocket::Debugger::IsVisible() )
	{
		if ( !Q_stricmp( Cmd_Argv( 1 ), "hud" ) )
		{
			Rocket::Debugger::SetContext( hudContext );
		}
		else
		{
			Rocket::Debugger::SetContext( menuContext );
		}
		Key_SetCatcher( Key_GetCatcher() | KEYCATCH_UI );
	}
	else
	{
		Key_SetCatcher( Key_GetCatcher() & ~KEYCATCH_UI );
	}
}
开发者ID:JacksonTech,项目名称:Unvanquished,代码行数:29,代码来源:rocket.cpp

示例4: CG_MessageMode_f

/*
================
CG_MessageMode_f
================
*/
void CG_MessageMode_f( void ) {
	Q_strncpyz( cg.messageCommand, "say", sizeof (cg.messageCommand) );
	Q_strncpyz( cg.messagePrompt, "Say:", sizeof (cg.messagePrompt) );
	MField_Clear( &cg.messageField );
	cg.messageField.widthInChars = 30;
	Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_MESSAGE );
}
开发者ID:LavenderMoon,项目名称:mint-arena,代码行数:12,代码来源:cg_consolecmds.c

示例5: ME_KeyEvent

void ME_KeyEvent(int key, bool down)
{
	if( key == K_MOUSE1 && !down ) {
		Key_SetCatcher( Key_GetCatcher() & ~KEYCATCH_CGAME );
		cgs.IGME.dragmode = false;
	}
}
开发者ID:MilitaryForces,项目名称:MilitaryForces,代码行数:7,代码来源:cg_missioneditor.c

示例6: CL_ShutdownCGame

/*
====================
CL_ShutdonwCGame

====================
*/
void CL_ShutdownCGame( void ) {
	Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_CGAME );
	cls.cgameStarted = false;
	if ( !cls.cgame ) {
		return;
	}
	cls.cgame->Call( CG_SHUTDOWN );
	delete cls.cgame;
	cls.cgame = nullptr;
}
开发者ID:wtfbbqhax,项目名称:tremulous,代码行数:16,代码来源:cl_cgame.cpp

示例7: CL_ShutdownUI

/*
====================
CL_ShutdownUI
====================
*/
void CL_ShutdownUI( void ) {
	Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_UI );

	if ( !cls.uiStarted )
		return;

	cls.uiStarted = qfalse;

	CL_UnbindUI();
}
开发者ID:AlexXT,项目名称:OpenJK,代码行数:15,代码来源:cl_ui.cpp

示例8: CL_ShutdownUI

/*
====================
CL_ShutdownUI
====================
*/
void CL_ShutdownUI( void ) {
	Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_UI );
	cls.uiStarted = qfalse;
	if ( !uivm ) {
		return;
	}
	VM_Call( uivm, UI_SHUTDOWN );
	VM_Free( uivm );
	uivm = NULL;
}
开发者ID:BruceJohnJennerLawso,项目名称:quake3,代码行数:15,代码来源:cl_ui.c

示例9: CL_ShutdownCGame

/*
====================
CL_ShutdonwCGame

====================
*/
void CL_ShutdownCGame( void ) {
	Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_CGAME );
	cls.cgameStarted = qfalse;
	if ( !cgvm ) {
		return;
	}
	VM_Call( cgvm, CG_SHUTDOWN );
	VM_Free( cgvm );
	cgvm = NULL;
}
开发者ID:BruceJohnJennerLawso,项目名称:quake3,代码行数:16,代码来源:cl_cgame.c

示例10: CG_MessageMode4_f

/*
================
CG_MessageMode4_f
================
*/
void CG_MessageMode4_f( void ) {
	int playerNum = CG_LastAttacker( 0 );
	if ( playerNum < 0 || playerNum >= MAX_CLIENTS ) {
		return;
	}
	Com_sprintf( cg.messageCommand, sizeof (cg.messageCommand), "tell %d", playerNum );
	Com_sprintf( cg.messagePrompt, sizeof (cg.messagePrompt), "Tell %s:", cgs.playerinfo[ playerNum ].name );
	MField_Clear( &cg.messageField );
	cg.messageField.widthInChars = 30;
	Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_MESSAGE );
}
开发者ID:LavenderMoon,项目名称:mint-arena,代码行数:16,代码来源:cg_consolecmds.c

示例11: XBL_MM_ConnectViaSessionID

// Connnect to a game we have the session ID for
bool XBL_MM_ConnectViaSessionID( const XNKID *sessionID, bool invited )
{
	// Do the query...
	runSessionIDQuery( sessionID );

	// No results? (Should only be one)
	if ( !queryByID.Results.Size() )
	{
		return false;
	}

	CJoinSessionByIDResult &server(queryByID.Results[0]);
	if (server.PrivateOpen < 1 && server.PublicOpen < 1)
	{
		// No slots available
		return false;
	}

	// OK. If we're currently hosting a dedicated server, we need to clean things up:
	if( com_dedicated->integer )
	{
		// Marks us as no longer joinable or playing:
		XBL_F_OnClientLeaveSession();

		// Code copied from "Leave" in ui_main.c
		Cvar_SetValue( "cl_paused", 0 );
		Key_SetCatcher( KEYCATCH_UI );
		Cvar_SetValue( "cl_running", 1 );
		SV_Shutdown( "Server quit\n" );

		CL_ShutdownUI();
		extern void RE_Shutdown( qboolean destroyWindow );
		RE_Shutdown( qfalse );
		CL_Disconnect( qtrue );

		Cvar_SetValue( "dedicated", 0 );
		Cvar_SetValue( "ui_dedicated", 0 );
		CL_FlushMemory();

		ui::Menus_CloseAll();
	}
	else if( cls.state == CA_ACTIVE )
	{
		// If we were already playing, we need to disconnect earlier than normal,
		// to clean up XBL stuff. Don't delete textures, we need to draw the connect screen:
		CL_Disconnect( qtrue, qfalse );
		Net_XboxDisconnect();
	}

	Net_XboxConnect(&server.SessionID, &server.KeyExchangeKey, &server.HostAddress);

 	return true;
}
开发者ID:3ddy,项目名称:Jedi-Academy,代码行数:54,代码来源:XBLive_MM.cpp

示例12: CG_Draw_IGME

void CG_Draw_IGME()
{
	int				i;
	usercmd_t		cmd;
	int				cmdNum;
	IGME_vehicle_t* veh;

	// check for selections
	cmdNum = CL_GetCurrentCmdNumber();
	CL_GetUserCmd( cmdNum, &cmd );
	if( Key_IsDown(K_MOUSE1) && !Key_GetCatcher() ) {
		if( (cgs.IGME.waypointmode && cgs.IGME.numWptSelections) ||
			(!cgs.IGME.waypointmode && cgs.IGME.numSelections) ) {
			Key_SetCatcher( KEYCATCH_CGAME );
			cgs.IGME.dragmode = true;
		}
	} else if( (Key_IsDown(K_MOUSE3) || Key_IsDown(K_SPACE)) &&
				cg.time >= cgs.IGME.selectionTime ) {
		ME_CheckForSelection();
		cgs.IGME.selectionTime = cg.time + 250;
	} else if( Key_IsDown(K_BACKSPACE) && !Key_GetCatcher() && cg.time >= cgs.IGME.selectionTime ) {
		ME_DeleteSelection();
		cgs.IGME.selectionTime = cg.time + 250;
	} else if( (cmd.buttons & BUTTON_GEAR) && cg.time >= cgs.IGME.selectionTime ) {
		ME_ToggleWaypointMode();
		cgs.IGME.selectionTime = cg.time + 250;
	} else if( (cmd.buttons & BUTTON_INCREASE) && cgs.IGME.waypointmode && 
				cg.time >= cgs.IGME.selectionTime ) {
		ME_SpawnWaypoint();
		cgs.IGME.selectionTime = cg.time + 250;
	} else if( (cmd.buttons & BUTTON_DECREASE) && cgs.IGME.waypointmode && 
				cg.time >= cgs.IGME.selectionTime ) {
		ME_ToggleWaypointDisplay();
		cgs.IGME.selectionTime = cg.time + 250;
	} else if( !cgs.IGME.dragmode && Key_IsDown(K_CTRL) && Key_IsDown('c') && 
				cg.time >= cgs.IGME.selectionTime ) {
		ME_CopySelection();
		cgs.IGME.selectionTime = cg.time + 500;
	} else if( !cgs.IGME.dragmode && Key_IsDown(K_CTRL) && Key_IsDown('v') &&
				cg.time >= cgs.IGME.selectionTime ) {
		ME_PasteSelection();
		cgs.IGME.selectionTime = cg.time + 500;
	}

	// draw vehicles
	for( i = 0; i < IGME_MAX_VEHICLES; ++i ) {
		veh = &cgs.IGME.vehicles[i]; 
		if( !veh->active ) continue;
		ME_DrawVehicle(veh);
	}
}
开发者ID:MilitaryForces,项目名称:MilitaryForces,代码行数:51,代码来源:cg_missioneditor.c

示例13: Con_ToggleConsole_f

/*
================
Con_ToggleConsole_f
================
*/
void Con_ToggleConsole_f (void) {
	// closing a full screen console restarts the demo loop
	if ( cls.state == CA_DISCONNECTED && Key_GetCatcher( ) == KEYCATCH_CONSOLE ) {
		CL_StartDemoLoop();
		return;
	}

	if( con_autoclear->integer )
		Field_Clear( &g_consoleField );
	g_consoleField.widthInChars = g_console_field_width;

	Con_ClearNotify ();
	Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_CONSOLE );
}
开发者ID:DarthFutuza,项目名称:JediKnightGalaxies,代码行数:19,代码来源:cl_console.cpp

示例14: CL_ShutdownUI

/*
====================
CL_ShutdownUI
====================
*/
void CL_ShutdownUI( void ) {
	Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_UI );
	cls.uiStarted = qfalse;
	if ( !uivm ) {
		return;
	}
	VM_Call( uivm, UI_SHUTDOWN );
	VM_Free( uivm );
	uivm = NULL;

#if EMSCRIPTEN
	cls.uiGlConfig = NULL;
	cls.numUiPatches = 0;
#endif
}
开发者ID:CarterTsai,项目名称:ioq3,代码行数:20,代码来源:cl_ui.c

示例15: CL_ShutdownUI

/*
====================
CL_ShutdownUI
====================
*/
void CL_ShutdownUI( qboolean delayFreeVM ) {
	Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_UI );
	cls.uiStarted = qfalse;
	if ( !uivm ) {
		return;
	}
	VM_Call( uivm, UI_SHUTDOWN );
	VM_Call( uivm, UI_MENU_RESET );
	if ( delayFreeVM )
	{
		VM_DelayedFree (uivm);
	}
	else
	{
		VM_Free( uivm );
	}
	uivm = NULL;
}
开发者ID:Pande,项目名称:OpenJK,代码行数:23,代码来源:cl_ui.cpp


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