• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ Key_SetCatcher函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: trap_Key_SetCatcher

void trap_Key_SetCatcher( int catcher ) 
{
	Key_SetCatcher( catcher );
}
开发者ID:Christian-Barrett,项目名称:OpenJK,代码行数:4,代码来源:ui_syscalls.cpp


示例17: CL_CgameSystemCalls


//.........这里部分代码省略.........
	case CG_R_LERPTAG:
		return re.LerpTag(VMA(1), VMA(2), VMA(3), args[4]);
	case CG_GETGLCONFIG:
		CL_GetGlconfig(VMA(1));
		return 0;
	case CG_GETGAMESTATE:
		CL_GetGameState(VMA(1));
		return 0;
	case CG_GETCURRENTSNAPSHOTNUMBER:
		CL_GetCurrentSnapshotNumber(VMA(1), VMA(2));
		return 0;
	case CG_GETSNAPSHOT:
		return CL_GetSnapshot(args[1], VMA(2));
	case CG_GETSERVERCOMMAND:
		return CL_GetServerCommand(args[1]);
	case CG_GETCURRENTCMDNUMBER:
		return CL_GetCurrentCmdNumber();
	case CG_GETUSERCMD:
		return CL_GetUserCmd(args[1], VMA(2));
	case CG_SETUSERCMDVALUE:
		CL_SetUserCmdValue(args[1], args[2], VMF(3), args[4]);
		return 0;
	case CG_SETCLIENTLERPORIGIN:
		CL_SetClientLerpOrigin(VMF(1), VMF(2), VMF(3));
		return 0;
	case CG_MEMORY_REMAINING:
		return Hunk_MemoryRemaining();
	case CG_KEY_ISDOWN:
		return Key_IsDown(args[1]);
	case CG_KEY_GETCATCHER:
		return Key_GetCatcher();
	case CG_KEY_SETCATCHER:
		// Don't allow the cgame module to close the console
		Key_SetCatcher(args[1] | (Key_GetCatcher() & KEYCATCH_CONSOLE));
		return 0;
	case CG_KEY_GETKEY:
		return Key_GetKey(VMA(1));

	case CG_KEY_GETOVERSTRIKEMODE:
		return Key_GetOverstrikeMode();
	case CG_KEY_SETOVERSTRIKEMODE:
		Key_SetOverstrikeMode(args[1]);
		return 0;

	case CG_MEMSET:
		return (intptr_t)memset(VMA(1), args[2], args[3]);
	case CG_MEMCPY:
		return (intptr_t)memcpy(VMA(1), VMA(2), args[3]);
	case CG_STRNCPY:
		return (intptr_t)strncpy(VMA(1), VMA(2), args[3]);
	case CG_SIN:
		return FloatAsInt(sin(VMF(1)));
	case CG_COS:
		return FloatAsInt(cos(VMF(1)));
	case CG_ATAN2:
		return FloatAsInt(atan2(VMF(1), VMF(2)));
	case CG_SQRT:
		return FloatAsInt(sqrt(VMF(1)));
	case CG_FLOOR:
		return FloatAsInt(floor(VMF(1)));
	case CG_CEIL:
		return FloatAsInt(ceil(VMF(1)));
	case CG_ACOS:
		return FloatAsInt(Q_acos(VMF(1)));

	case CG_PC_ADD_GLOBAL_DEFINE:
开发者ID:Mailaender,项目名称:etlegacy,代码行数:67,代码来源:cl_cgame.c


示例18: CL_UISystemCalls


//.........这里部分代码省略.........
		S_StartLocalSound( args[1], args[2] );
		return 0;

	case UI_KEY_KEYNUMTOSTRINGBUF:
		Key_KeynumToStringBuf( args[1], VMA(2), args[3] );
		return 0;

	case UI_KEY_GETBINDINGBUF:
		Key_GetBindingBuf( args[1], VMA(2), args[3] );
		return 0;

	case UI_KEY_SETBINDING:
		Key_SetBinding( args[1], VMA(2) );
		return 0;

	case UI_KEY_ISDOWN:
		return Key_IsDown( args[1] );

	case UI_KEY_GETOVERSTRIKEMODE:
		return Key_GetOverstrikeMode();

	case UI_KEY_SETOVERSTRIKEMODE:
		Key_SetOverstrikeMode( args[1] );
		return 0;

	case UI_KEY_CLEARSTATES:
		Key_ClearStates();
		return 0;

	case UI_KEY_GETCATCHER:
		return Key_GetCatcher();

	case UI_KEY_SETCATCHER:
		Key_SetCatcher( args[1] );
		return 0;

	case UI_GETCLIPBOARDDATA:
		GetClipboardData( VMA(1), args[2] );
		return 0;

	case UI_GETCLIENTSTATE:
		GetClientState( VMA(1) );
		return 0;		

	case UI_GETGLCONFIG:
		CL_GetGlconfig( VMA(1) );
		return 0;

	case UI_GETCONFIGSTRING:
		return GetConfigString( args[1], VMA(2), args[3] );

	case UI_LAN_LOADCACHEDSERVERS:
		LAN_LoadCachedServers();
		return 0;

	case UI_LAN_SAVECACHEDSERVERS:
		LAN_SaveServersToCache();
		return 0;

	case UI_LAN_ADDSERVER:
		return LAN_AddServer(args[1], VMA(2), VMA(3));

	case UI_LAN_REMOVESERVER:
		LAN_RemoveServer(args[1], VMA(2));
		return 0;
开发者ID:he110world,项目名称:quake3-ios,代码行数:66,代码来源:cl_ui.c


示例19: UI_SPPostgameMenu_f


//.........这里部分代码省略.........
    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;

    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 = S_RegisterSound( va( "sound/player/announce/%s_wins.wav", postgameMenuInfo.placeNames[0] ), qfalse );
        Cbuf_ExecuteText( EXEC_APPEND, "music music/loss\n" );
    }
    else
    {
        postgameMenuInfo.winnerSound = S_RegisterSound( "sound/player/announce/youwin.wav", qfalse );
        Cbuf_ExecuteText( EXEC_APPEND, "music music/win\n" );
    }

    postgameMenuInfo.phase = 1;

    postgameMenuInfo.lastTier = UI_GetNumSPTiers();
    if ( UI_GetSpecialArenaInfo( "final" ) )
    {
        postgameMenuInfo.lastTier++;
    }
}
开发者ID:zturtleman,项目名称:recoil,代码行数:101,代码来源:ui_sppostgame.c


示例20: CL_KeyDownEvent

/*
===================
CL_KeyDownEvent

Called by CL_KeyEvent to handle a keypress
===================
*/
void CL_KeyDownEvent( int key, unsigned time )
{
	keys[key].down = qtrue;
		keys[key].repeats++;
	if( keys[key].repeats == 1 )
			anykeydown++;

#ifndef _WIN32
	if( keys[K_ALT].down && key == K_ENTER )
			{
				Cvar_SetValue( "r_fullscreen",
						!Cvar_VariableIntegerValue( "r_fullscreen" ) );
		Cbuf_ExecuteText( EXEC_APPEND, "vid_restart\n" );
				return;
			}
#endif

	// console key is hardcoded, so the user can never unbind it
	if( key == K_CONSOLE || ( keys[K_SHIFT].down && key == K_ESCAPE ) )
	{
		Con_ToggleConsole_f ();
		Key_ClearStates ();
		return;
	}


	// keys can still be used for bound actions
	if ( ( key < 128 || key == K_MOUSE1 ) 
		&& cls.state == CA_CINEMATIC && Key_GetCatcher( ) == 0 ) {

		if ( Cvar_VariableIntegerValue( "com_cameraMode" ) == 0 ) {
			Cvar_Set ("nextdemo","");
			key = K_ESCAPE;
		}
	}

	// escape is always handled special
	if ( key == K_ESCAPE ) {
		if ( Key_GetCatcher( ) & KEYCATCH_MESSAGE ) {
			// clear message mode
			Message_Key( key );
			return;
		}

		// escape always gets out of CGAME stuff
		if (Key_GetCatcher( ) & KEYCATCH_CGAME) {
			Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_CGAME );
			VM_Call (cgvm, CG_EVENT_HANDLING, CGAME_EVENT_NONE);
			return;
		}

		if ( !( Key_GetCatcher( ) & KEYCATCH_UI ) ) {
			if ( cls.state == CA_ACTIVE && !clc.demoplaying ) {
				VM_Call( uivm, UI_SET_ACTIVE_MENU, UIMENU_INGAME );
			}
			else if ( cls.state != CA_DISCONNECTED ) {
				CL_Disconnect_f();
				S_StopAllSounds();
				VM_Call( uivm, UI_SET_ACTIVE_MENU, UIMENU_MAIN );
			}
			return;
		}

		VM_Call( uivm, UI_KEY_EVENT, key, qtrue );
		return;
	}


	// distribute the key down event to the apropriate handler
	if ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) {
		Console_Key( key );
	} else if ( Key_GetCatcher( ) & KEYCATCH_UI ) {
		if ( uivm ) {
			VM_Call( uivm, UI_KEY_EVENT, key, qtrue );
		} 
	} else if ( Key_GetCatcher( ) & KEYCATCH_CGAME ) {
		if ( cgvm ) {
			VM_Call( cgvm, CG_KEY_EVENT, key, qtrue );
		} 
	} else if ( Key_GetCatcher( ) & KEYCATCH_MESSAGE ) {
		Message_Key( key );
	} else if ( cls.state == CA_DISCONNECTED ) {
		Console_Key( key );
	} else {
		// send the bound action
		Key_ParseBinding( key, qtrue, time );
	}
	return;
}
开发者ID:BigJohnJD,项目名称:Quake-III-132,代码行数:96,代码来源:cl_keys.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ KiBitmap函数代码示例发布时间:2022-05-30
下一篇:
C++ Key_SetBinding函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap