當前位置: 首頁>>代碼示例>>C++>>正文


C++ CG_EventHandling函數代碼示例

本文整理匯總了C++中CG_EventHandling函數的典型用法代碼示例。如果您正苦於以下問題:C++ CG_EventHandling函數的具體用法?C++ CG_EventHandling怎麽用?C++ CG_EventHandling使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CG_EventHandling函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: CG_LimboMenu_f

void CG_LimboMenu_f( void ) {
	if( cg.showGameView ) {
		CG_EventHandling( CGAME_EVENT_NONE, qfalse );
	} else {
		CG_EventHandling( CGAME_EVENT_GAMEVIEW, qfalse );
	}
}
開發者ID:BackupTheBerlios,項目名稱:et-flf-svn,代碼行數:7,代碼來源:cg_consolecmds.c

示例2: CG_QuickFireteams_f

static void CG_QuickFireteams_f( void ) {
	if( cg.showFireteamMenu ) {
		if( cgs.ftMenuMode == 0 ) {
			CG_EventHandling( CGAME_EVENT_NONE, qfalse );
		} else {
			cgs.ftMenuMode = 0;
		}
	} else if( CG_IsOnFireteam( cg.clientNum ) ) {
		CG_EventHandling( CGAME_EVENT_FIRETEAMMSG, qfalse );
		cgs.ftMenuMode = 0;
	}
}
開發者ID:BackupTheBerlios,項目名稱:et-flf-svn,代碼行數:12,代碼來源:cg_consolecmds.c

示例3: CG_QuickFireteamAdmin_f

void CG_QuickFireteamAdmin_f( void ) {
	trap_UI_Popup( UIMENU_NONE );
	
	if( cg.showFireteamMenu ) {
		if( cgs.ftMenuMode == 1 ) {
			CG_EventHandling( CGAME_EVENT_NONE, qfalse );
		} else {
			cgs.ftMenuMode = 1;
		}
	} else if( cgs.clientinfo[ cg.clientNum ].team != TEAM_SPECTATOR ) {
		CG_EventHandling( CGAME_EVENT_FIRETEAMMSG, qfalse );
		cgs.ftMenuMode = 1;
	}
}
開發者ID:BackupTheBerlios,項目名稱:et-flf-svn,代碼行數:14,代碼來源:cg_consolecmds.c

示例4: vmMain

/*
================
vmMain

This is the only way control passes into the module.
This must be the very first function compiled into the .q3vm file
================
*/
Q_EXPORT intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11  ) {

	switch ( command ) {
	case CG_INIT:
		CG_Init( arg0, arg1, arg2 );
		return 0;
	case CG_SHUTDOWN:
		CG_Shutdown();
		return 0;
	case CG_CONSOLE_COMMAND:
		return CG_ConsoleCommand();
	case CG_DRAW_ACTIVE_FRAME:
		CG_DrawActiveFrame( arg0, arg1, arg2 );
		return 0;
	case CG_CROSSHAIR_PLAYER:
		return CG_CrosshairPlayer();
	case CG_LAST_ATTACKER:
		return CG_LastAttacker();
	case CG_KEY_EVENT:
		CG_KeyEvent(arg0, arg1);
		return 0;
	case CG_MOUSE_EVENT:
		CG_MouseEvent(arg0, arg1);
		return 0;
	case CG_EVENT_HANDLING:
		CG_EventHandling(arg0);
		return 0;
	default:
		CG_Error( "vmMain: unknown command %i", command );
		break;
	}
	return -1;
}
開發者ID:asl97,項目名稱:ZEQ2-Lite-1,代碼行數:41,代碼來源:cg_main.c

示例5: CG_LoadPanel_ContinueButtonKeyDown

qboolean CG_LoadPanel_ContinueButtonKeyDown( panel_button_t* button, int key ) {
	if( key == K_MOUSE1 ) {
		CG_EventHandling( CGAME_EVENT_GAMEVIEW, qfalse );
		return qtrue;
	}

	return qfalse;
}
開發者ID:GenaSG,項目名稱:ET,代碼行數:8,代碼來源:cg_loadpanel.c

示例6: CG_keyOff_f

void CG_keyOff_f(void)
{
	if (!cg.demoPlayback)
	{
		return;
	}
	CG_EventHandling(CGAME_EVENT_NONE, qfalse);
}
開發者ID:Classixz,項目名稱:etlegacy,代碼行數:8,代碼來源:cg_consolecmds.c

示例7: CG_mvToggleAll_f

// Toggle all views
void CG_mvToggleAll_f(void)
{
	if (!cg.demoPlayback)
	{
		trap_SendClientCommand((cg.mvTotalClients > 0) ? "mvnone\n" : "mvall\n");

		if (cg.mvTotalClients > 0)
		{
			CG_EventHandling(-CGAME_EVENT_MULTIVIEW, qfalse);
		}
	}
}
開發者ID:Ododo,項目名稱:etlegacy,代碼行數:13,代碼來源:cg_multiview.c

示例8: CG_KeyEvent

void CG_KeyEvent(int key, qboolean down) {
	switch(cgs.eventHandling) {
		// Demos get their own keys
		case CGAME_EVENT_DEMO:
			CG_DemoClick(key, down);
			return;

		case CGAME_EVENT_CAMPAIGNBREIFING:
			CG_LoadPanel_KeyHandling( key, down );
			break;

		case CGAME_EVENT_FIRETEAMMSG:
			CG_Fireteams_KeyHandling( key, down );
			break;

		case CGAME_EVENT_GAMEVIEW:
			CG_LimboPanel_KeyHandling( key, down );
			break;

		case CGAME_EVENT_SPEAKEREDITOR:
			CG_SpeakerEditor_KeyHandling( key, down );
			break;

		// forty - visual hud editor
		case CGAME_EVENT_HUDEDITOR:
			CG_HudEditor_KeyHandling( key, down );
			break;
	
		// forty - multiview key handler
		case CGAME_EVENT_MULTIVIEW:
			CG_mv_KeyHandling( key, down );
			break;

		default:
			if( cg.snap->ps.pm_type == PM_INTERMISSION ) {
				CG_Debriefing_KeyEvent( key, down );
				return;
			}

			// default handling
			if( !down ) {
				return;
			}

			if ( ( cg.predictedPlayerState.pm_type == PM_NORMAL ||
				(cg.predictedPlayerState.pm_type == PM_SPECTATOR && cg.showScores == qfalse))) {

				CG_EventHandling(CGAME_EVENT_NONE, qfalse);
				return;
			}
			break;
	}
}
開發者ID:BulldogDrummond,項目名稱:etpub,代碼行數:53,代碼來源:cg_newDraw.c

示例9: CG_keyOn_f

void CG_keyOn_f(void)
{
	if(!cg.demoPlayback) {
		CG_Printf("[cgnotify]^3*** NOT PLAYING A DEMO!!\n");
		return;
	}

	if(demo_infoWindow.integer > 0) {
		CG_ShowHelp_On(&cg.demohelpWindow);
	}

	CG_EventHandling(CGAME_EVENT_DEMO, qtrue);
}
開發者ID:BackupTheBerlios,項目名稱:et-flf-svn,代碼行數:13,代碼來源:cg_consolecmds.c

示例10: CG_QuickMessage_f

void CG_QuickMessage_f(void)
{
	CG_EventHandling(CGAME_EVENT_NONE, qfalse);

	if (cg_quickMessageAlt.integer)
	{
		trap_UI_Popup(UIMENU_WM_QUICKMESSAGEALT);
	}
	else
	{
		trap_UI_Popup(UIMENU_WM_QUICKMESSAGE);
	}
}
開發者ID:Classixz,項目名稱:etlegacy,代碼行數:13,代碼來源:cg_consolecmds.c

示例11: CG_QuickFireteamMessage_f

void CG_QuickFireteamMessage_f( void ) {
	if( cgs.clientinfo[ cg.clientNum ].team == TEAM_SPECTATOR ) {
		return;
	}

	CG_EventHandling( CGAME_EVENT_NONE, qfalse );

	if( cg_quickMessageAlt.integer ) {
		trap_UI_Popup( UIMENU_WM_FTQUICKMESSAGEALT );
	} else {
		trap_UI_Popup( UIMENU_WM_FTQUICKMESSAGE );
	}
}
開發者ID:BackupTheBerlios,項目名稱:et-flf-svn,代碼行數:13,代碼來源:cg_consolecmds.c

示例12: CG_QuickMessage_f

void CG_QuickMessage_f( void ) {
	if( cgs.clientinfo[ cg.clientNum ].team == TEAM_SPECTATOR &&
		cgs.etpub < ETPUB_VERSION(0,7,0) ) {
		return;
	}

	CG_EventHandling( CGAME_EVENT_NONE, qfalse );

	if( cg_quickMessageAlt.integer ) {
		trap_UI_Popup( UIMENU_WM_QUICKMESSAGEALT );
	} else {
		trap_UI_Popup( UIMENU_WM_QUICKMESSAGE );
	}
}
開發者ID:thewolfteam,項目名稱:Reloaded,代碼行數:14,代碼來源:cg_consolecmds.c

示例13: CG_LimboPanel_KeyHandling

void CG_LimboPanel_KeyHandling(int key, qboolean down) {
	int b1, b2;

	if (BG_PanelButtonsKeyEvent(key, down, limboPanelButtons)) {
		return;
	}

	if (down) {
		cgDC.getKeysForBinding("openlimbomenu", &b1, &b2);
		if ((b1 != -1 && b1 == key) || (b2 != -1 && b2 == key)) {
			CG_EventHandling(CGAME_EVENT_NONE, qfalse);
			return;
		}
	}
}
開發者ID:ETrun,項目名稱:ETrun,代碼行數:15,代碼來源:cg_limbopanel.c

示例14: vmMain

/*
================
vmMain

This is the only way control passes into the module.
This must be the very first function compiled into the .q3vm file
================
*/
intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11  ) {

	switch ( command ) {
	case CG_INIT:
		CG_Init( arg0, arg1, arg2, arg3 );
		return 0;
	case CG_SHUTDOWN:
		CG_Shutdown();
		return 0;
	case CG_CONSOLE_COMMAND:
		return CG_ConsoleCommand();
	case CG_DRAW_ACTIVE_FRAME:
		CG_DrawActiveFrame( arg0, arg1, arg2 );
		return 0;
	case CG_DRAW_2D:
		CG_Draw2D( arg0, arg1, arg2 );
		return 0;
	case CG_CROSSHAIR_PLAYER:
		return CG_CrosshairPlayer();
	case CG_LAST_ATTACKER:
		return CG_LastAttacker();
	case CG_KEY_EVENT:
		CG_KeyEvent(arg0, arg1);
		return 0;
	case CG_MOUSE_EVENT:
		CG_MouseEvent(arg0, arg1);
		return 0;
	case CG_EVENT_HANDLING:
		CG_EventHandling(arg0);
		return 0;
	case CG_CENTERPRINT:
		CG_CenterPrint( (const char*)arg0, 200, 10 );
		return 0;
	case CG_LOCATIONPRINT:
		CG_LocationPrint( (const char*)arg0, arg1, arg2, 10 );
		return 0;
	case CG_PARSEMSG:
		CG_ParseCGMessage();
		return 0;
	default:
		CG_Error( "vmMain: unknown command %i", command );
		break;
	}
	return -1;
}
開發者ID:kingtiger01,項目名稱:OpenMOHAA,代碼行數:53,代碼來源:cg_main.c

示例15: CG_KeyEvent

void CG_KeyEvent(int key, qboolean down) {

	if (!down) {
		return;
	}

	if ( CG_ChatboxActive() ) {
			 if ( key == K_ENTER ||
				 key == K_KP_ENTER )	CG_ChatboxOutgoing();
		else if ( key == K_TAB )		CG_ChatboxTabComplete();
		else if ( key == K_PGDN )		CG_ChatboxScroll( 0 );
		else if ( key == K_PGUP )		CG_ChatboxScroll( 1 );
		else if ( key == K_UPARROW )	CG_ChatboxHistoryUp();
		else if ( key == K_DOWNARROW )	CG_ChatboxHistoryDn();
		else if ( key == K_BACKSPACE )	CG_ChatboxClear();
		else if ( key == K_ESCAPE )		CG_ChatboxEscape();
		else if ( key & K_CHAR_FLAG )	CG_ChatboxChar( (char)(key & ~K_CHAR_FLAG) );
		return;
	}

	if ( cg.predictedPlayerState.pm_type == PM_NORMAL || (cg.predictedPlayerState.pm_type == PM_SPECTATOR && cg.showScores == qfalse)) {
		CG_EventHandling(CGAME_EVENT_NONE);
		trap->Key_SetCatcher(0);
		return;
	}

	//if (key == trap->Key_GetKey("teamMenu") || !Display_CaptureItem(cgs.cursorX, cgs.cursorY)) {
	// if we see this then we should always be visible
	//  CG_EventHandling(CGAME_EVENT_NONE);
	//  trap->Key_SetCatcher(0);
	//}



	Display_HandleKey(key, down, (int)cgs.cursorX, (int)cgs.cursorY);

	if (cgs.capturedItem) {
		cgs.capturedItem = NULL;
	}	else {
		if (key == K_MOUSE2 && down) {
			cgs.capturedItem = Display_CaptureItem((int)cgs.cursorX, (int)cgs.cursorY);
		}
	}
}
開發者ID:Razish,項目名稱:QtZ,代碼行數:44,代碼來源:cg_newdraw.c


注:本文中的CG_EventHandling函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。