本文整理汇总了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 );
}
示例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();
}
示例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 );
}
}
示例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 );
}
示例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;
}
}
示例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;
}
示例7: CL_ShutdownUI
/*
====================
CL_ShutdownUI
====================
*/
void CL_ShutdownUI( void ) {
Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_UI );
if ( !cls.uiStarted )
return;
cls.uiStarted = qfalse;
CL_UnbindUI();
}
示例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;
}
示例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;
}
示例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 );
}
示例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;
}
示例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);
}
}
示例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 );
}
示例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
}
示例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;
}