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

C++ idWidgetAction类代码示例

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

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



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

示例1: StartWidgetActionRepeater

/*
========================
idMenuHandler::StartWidgetActionRepeater
========================
*/
void idMenuHandler::StartWidgetActionRepeater( idMenuWidget* widget, const idWidgetAction& action, const idWidgetEvent& event )
{
	if( actionRepeater.isActive && actionRepeater.action == action )
	{
		return;	// don't attempt to reactivate an already active repeater
	}
	
	actionRepeater.isActive = true;
	actionRepeater.action = action;
	actionRepeater.widget = widget;
	actionRepeater.event = event;
	actionRepeater.numRepetitions = 0;
	actionRepeater.nextRepeatTime = 0;
	actionRepeater.screenIndex = activeScreen;	// repeaters are cleared between screens
	
	if( action.GetParms().Num() == 2 )
	{
		actionRepeater.repeatDelay = action.GetParms()[ 1 ].ToInteger();
	}
	else
	{
		actionRepeater.repeatDelay = DEFAULT_REPEAT_TIME;
	}
	
	// do the first event immediately
	PumpWidgetActionRepeater();
}
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:32,代码来源:MenuHandler.cpp


示例2: HandleAction

/*
========================
idMenuScreen_Shell_ModeSelect::HandleAction h
========================
*/
bool idMenuScreen_Shell_ModeSelect::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {

	if ( menuData == NULL ) {
		return true;
	}

	if ( menuData->ActiveScreen() != SHELL_AREA_MODE_SELECT ) {
		return false;
	}

	widgetAction_t actionType = action.GetType();
	const idSWFParmList & parms = action.GetParms();

	switch ( actionType ) {
		case WIDGET_ACTION_GO_BACK: {
			menuData->SetNextScreen( SHELL_AREA_PARTY_LOBBY, MENU_TRANSITION_SIMPLE );
			return true;
		}
		case WIDGET_ACTION_PRESS_FOCUSED: {
			if ( options == NULL ) {
				return true;
			}
			int selectionIndex = options->GetViewIndex();
			if ( parms.Num() == 1 ) {
				selectionIndex = parms[0].ToInteger();
			}	

			if ( options->GetFocusIndex() != selectionIndex ) {
				options->SetFocusIndex( selectionIndex );
				options->SetViewIndex( options->GetViewOffset() + selectionIndex );
			}

			idMatchParameters matchParameters = idMatchParameters( session->GetPartyLobbyBase().GetMatchParms() );
			matchParameters.gameMap = GAME_MAP_RANDOM;
			matchParameters.gameMode = selectionIndex;

			// Always a public match.
			matchParameters.matchFlags &= ~MATCH_INVITE_ONLY;

			session->UpdatePartyParms( matchParameters );

			// Update flags for game lobby.
			matchParameters.matchFlags = DefaultPartyFlags | DefaultPublicGameFlags;
			
			cvarSystem->MoveCVarsToDict( CVAR_SERVERINFO, matchParameters.serverInfo );

			// Force a default value for the si_timelimit and si_fraglimit for quickmatch
			matchParameters.serverInfo.SetInt( "si_timelimit", 15 );
			matchParameters.serverInfo.SetInt( "si_fraglimit", 10 );

			session->FindOrCreateMatch( matchParameters );

			return true;
		}
	}

	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:63,代码来源:MenuScreen_Shell_ModeSelect.cpp


示例3: HandleAction

/*
========================
idMenuScreen_Shell_GameBrowser::HandleAction h
========================
*/
bool idMenuScreen_Shell_GameBrowser::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandle ) {
	idMenuHandler_Shell * const mgr = dynamic_cast< idMenuHandler_Shell * >( menuData );

	if ( mgr == NULL ) {
		return false;
	}

	if ( mgr->ActiveScreen() != SHELL_AREA_BROWSER ) {
		return false;
	}

	widgetAction_t actionType = action.GetType();
	const idSWFParmList & parms = action.GetParms();

	switch ( actionType ) {
		case WIDGET_ACTION_GO_BACK: {
			menuData->SetNextScreen( SHELL_AREA_PARTY_LOBBY, MENU_TRANSITION_SIMPLE );
			return true;
		}
		case WIDGET_ACTION_COMMAND: {
			switch ( parms[ 0 ].ToInteger() ) {
				case BROWSER_COMMAND_REFRESH_SERVERS: {
					UpdateServerList();
					break;
				}
				case BROWSER_COMMAND_SHOW_GAMERTAG: {
					int index = listWidget->GetServerIndex();
					if ( index != -1 ) {
						session->ShowServerGamerCardUI( index );
					}
					break;
				}
			}
			return true;
		}
		case WIDGET_ACTION_PRESS_FOCUSED: {
			int selectionIndex = listWidget->GetFocusIndex();
			if ( parms.Num() > 0 ) {
				selectionIndex = parms[0].ToInteger();
			}

			if ( selectionIndex != listWidget->GetFocusIndex() ) {
				listWidget->SetViewIndex( listWidget->GetViewOffset() + selectionIndex );
				listWidget->SetFocusIndex( selectionIndex );
				return true;
			}

			int index = listWidget->GetServerIndex();
			if ( index != -1 ) {
				session->ConnectToServer( index );
			}
			return true;
		}
	}

	return idMenuScreen::HandleAction( action, event, widget, forceHandle );
}
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:62,代码来源:MenuScreen_Shell_Browser.cpp


示例4: HandleAction

/*
========================
idMenuScreen_Shell_Playstation::HandleAction h
========================
*/
bool idMenuScreen_Shell_Playstation::HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled )
{

	if( menuData == NULL )
	{
		return true;
	}
	
	if( menuData->ActiveScreen() != SHELL_AREA_PLAYSTATION )
	{
		return false;
	}
	
	widgetAction_t actionType = action.GetType();
	const idSWFParmList& parms = action.GetParms();
	
	switch( actionType )
	{
		case WIDGET_ACTION_GO_BACK:
		{
			menuData->SetNextScreen( SHELL_AREA_ROOT, MENU_TRANSITION_SIMPLE );
			return true;
		}
		case WIDGET_ACTION_PRESS_FOCUSED:
		{
			if( options == NULL )
			{
				return true;
			}
			
			int selectionIndex = options->GetViewIndex();
			if( parms.Num() == 1 )
			{
				selectionIndex = parms[0].ToInteger();
			}
			
			if( options->GetFocusIndex() != selectionIndex )
			{
				options->SetFocusIndex( selectionIndex );
				options->SetViewIndex( options->GetViewOffset() + selectionIndex );
			}
			
			if( selectionIndex == 0 )
			{
			
			
			}
			else if( selectionIndex == 1 )
			{
			}
			
			return true;
		}
	}
	
	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:62,代码来源:MenuScreen_Shell_Playstation.cpp


示例5: switch

/*
================================================
idMenuHandler::Update
================================================
*/
bool idMenuHandler::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {

	widgetAction_t actionType = action.GetType();
	const idSWFParmList & parms = action.GetParms();

	switch ( actionType ) {
		case WIDGET_ACTION_ADJUST_FIELD: {
			if ( widget != NULL && widget->GetDataSource() != NULL ) {
				widget->GetDataSource()->AdjustField( widget->GetDataSourceFieldIndex(), parms[ 0 ].ToInteger() );
				widget->Update();
			}
			return true;
		}
		case WIDGET_ACTION_FUNCTION: {
			if ( verify( action.GetScriptFunction() != NULL ) ) {
				action.GetScriptFunction()->Call( event.thisObject, event.parms );
			}
			return true;
		}
		case WIDGET_ACTION_PRESS_FOCUSED: {
			idMenuScreen * const screen = menuScreens[ activeScreen ];
			if ( screen != NULL ) {
				idWidgetEvent pressEvent( WIDGET_EVENT_PRESS, 0, event.thisObject, idSWFParmList() );
				screen->ReceiveEvent( pressEvent );
			}
			return true;
		}
		case WIDGET_ACTION_START_REPEATER: {
			idWidgetAction repeatAction;
			widgetAction_t repeatActionType = static_cast< widgetAction_t >( parms[ 0 ].ToInteger() );
			assert( parms.Num() >= 2 );
			int repeatDelay = DEFAULT_REPEAT_TIME;
			if ( parms.Num() >= 3 ) {
				repeatDelay = parms[2].ToInteger();
			} 
			repeatAction.Set( repeatActionType, parms[ 1 ], repeatDelay );
			StartWidgetActionRepeater( widget, repeatAction, event );
			return true;
		}
		case WIDGET_ACTION_STOP_REPEATER: {
			ClearWidgetActionRepeater();
			return true;
		}
	}

	if ( !widget->GetHandlerIsParent() ) {
		for ( int index = 0; index < children.Num(); ++index ) {
			if ( children[index] != NULL ) {
				if ( children[index]->HandleAction( action, event, widget, forceHandled ) ) {
					return true;
				}
			}
		}
	}

	return false;
}
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:62,代码来源:MenuHandler.cpp


示例6: HandleAction

/*
========================
idMenuScreen_Shell_Settings::HandleAction h
========================
*/
bool idMenuScreen_Shell_Settings::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {

	if ( menuData == NULL ) {
		return true;
	}

	if ( menuData->ActiveScreen() != SHELL_AREA_SETTINGS ) {
		return false;
	}

	widgetAction_t actionType = action.GetType();
	const idSWFParmList & parms = action.GetParms();

	switch ( actionType ) {
		case WIDGET_ACTION_GO_BACK: {
			menuData->SetNextScreen( SHELL_AREA_ROOT, MENU_TRANSITION_SIMPLE );
			return true;
		}
		case WIDGET_ACTION_COMMAND: {
			switch ( parms[0].ToInteger() ) {
				case SETTING_CMD_CONTROLS: {
					menuData->SetNextScreen( SHELL_AREA_CONTROLS, MENU_TRANSITION_SIMPLE );
					break;	
				}
				case SETTING_CMD_GAMEPLAY: {
					menuData->SetNextScreen( SHELL_AREA_GAME_OPTIONS, MENU_TRANSITION_SIMPLE );
					break;
				}
				case SETTING_CMD_SYSTEM: {
					menuData->SetNextScreen( SHELL_AREA_SYSTEM_OPTIONS, MENU_TRANSITION_SIMPLE );
					break;
				}
				case SETTING_CMD_3D: {
					menuData->SetNextScreen( SHELL_AREA_STEREOSCOPICS, MENU_TRANSITION_SIMPLE );
					break;
				}
			}

			if ( options != NULL ) {
				int selectionIndex = options->GetViewIndex();
				if ( parms.Num() == 1 ) {
					selectionIndex = parms[0].ToInteger();
				}	

				if ( options->GetFocusIndex() != selectionIndex ) {
					options->SetFocusIndex( selectionIndex );
					options->SetViewIndex( options->GetViewOffset() + selectionIndex );
				}
			}

			return true;
		}
	}

	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
开发者ID:Deepfreeze32,项目名称:taken,代码行数:61,代码来源:MenuScreen_Shell_Settings.cpp


示例7: HandleAction

/*
========================
idMenuScreen_Shell_NewGame::HandleAction h
========================
*/
bool idMenuScreen_Shell_NewGame::HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled )
{

	if( menuData != NULL )
	{
		if( menuData->ActiveScreen() != SHELL_AREA_NEW_GAME )
		{
			return false;
		}
	}
	
	widgetAction_t actionType = action.GetType();
	const idSWFParmList& parms = action.GetParms();
	
	switch( actionType )
	{
		case WIDGET_ACTION_GO_BACK:
		{
			if( menuData != NULL )
			{
				menuData->SetNextScreen( SHELL_AREA_CAMPAIGN, MENU_TRANSITION_SIMPLE );
			}
			return true;
		}
		case WIDGET_ACTION_PRESS_FOCUSED:
		{
			if( options == NULL )
			{
				return true;
			}
			
			int selectionIndex = options->GetViewIndex();
			if( parms.Num() == 1 )
			{
				selectionIndex = parms[0].ToInteger();
			}
			
			if( selectionIndex != options->GetFocusIndex() )
			{
				options->SetViewIndex( selectionIndex );
				options->SetFocusIndex( selectionIndex );
			}
			
			idMenuHandler_Shell* shell = dynamic_cast< idMenuHandler_Shell* >( menuData );
			if( shell != NULL )
			{
				shell->SetNewGameType( selectionIndex );
				menuData->SetNextScreen( SHELL_AREA_DIFFICULTY, MENU_TRANSITION_SIMPLE );
			}
			
			return true;
		}
	}
	
	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:61,代码来源:MenuScreen_Shell_NewGame.cpp


示例8: HandleAction

/*
========================
idMenuScreen_Shell_Dev::HandleAction h
========================
*/
bool idMenuScreen_Shell_Dev::HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled )
{

	if( menuData == NULL )
	{
		return true;
	}
	
	if( menuData->ActiveScreen() != SHELL_AREA_DEV )
	{
		return false;
	}
	
	widgetAction_t actionType = action.GetType();
	const idSWFParmList& parms = action.GetParms();
	
	switch( actionType )
	{
		case WIDGET_ACTION_GO_BACK:
		{
			menuData->SetNextScreen( SHELL_AREA_ROOT, MENU_TRANSITION_SIMPLE );
			return true;
		}
		case WIDGET_ACTION_PRESS_FOCUSED:
		{
			if( options == NULL )
			{
				return true;
			}
			
			int selectionIndex = options->GetViewIndex();
			if( parms.Num() == 1 )
			{
				selectionIndex = parms[0].ToInteger();
			}
			
			if( options->GetFocusIndex() != selectionIndex - options->GetViewOffset() )
			{
				options->SetFocusIndex( selectionIndex );
				options->SetViewIndex( options->GetViewOffset() + selectionIndex );
			}
			
			int mapIndex = options->GetViewIndex();
			if( ( mapIndex < devOptions.Num() ) && ( devOptions[ mapIndex ].map != NULL ) )
			{
				cmdSystem->AppendCommandText( va( "devmap %s\n", devOptions[ mapIndex ].map ) );
			}
			
			return true;
		}
	}
	
	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:59,代码来源:MenuScreen_Shell_Dev.cpp


示例9: switch

/*
========================
idMenuScreen_PDA_VideoDisks::HandleAction
========================
*/
bool idMenuScreen_PDA_VideoDisks::HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled )
{

	if( menuData == NULL )
	{
		return true;
	}
	
	if( menuData->ActiveScreen() != PDA_AREA_VIDEO_DISKS )
	{
		return false;
	}
	
	widgetAction_t actionType = action.GetType();
	const idSWFParmList& parms = action.GetParms();
	
	switch( actionType )
	{
		case WIDGET_ACTION_GO_BACK:
		{
			menuData->SetNextScreen( PDA_AREA_INVALID, MENU_TRANSITION_ADVANCE );
			return true;
		}
		case WIDGET_ACTION_START_REPEATER:
		{
			idWidgetAction repeatAction;
			widgetAction_t repeatActionType = static_cast< widgetAction_t >( parms[ 0 ].ToInteger() );
			assert( parms.Num() == 2 );
			repeatAction.Set( repeatActionType, parms[ 1 ] );
			if( menuData != NULL )
			{
				menuData->StartWidgetActionRepeater( widget, repeatAction, event );
			}
			return true;
		}
		case WIDGET_ACTION_STOP_REPEATER:
		{
			if( menuData != NULL )
			{
				menuData->ClearWidgetActionRepeater();
			}
			return true;
		}
		case WIDGET_ACTION_PRESS_FOCUSED:
		{
			ToggleVideoDiskPlay();
			Update();
			return true;
		}
	}
	
	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:58,代码来源:MenuScreen_PDA_VideoDisks.cpp


示例10: HandleAction

/*
========================
idMenuWidget_InfoBox::ObserveEvent
========================
*/
bool idMenuWidget_InfoBox::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {

	const idSWFParmList & parms = action.GetParms();

	if ( action.GetType() == WIDGET_ACTION_SCROLL_VERTICAL ) {
		const scrollType_t scrollType = static_cast< scrollType_t >( event.arg );
		if ( scrollType == SCROLL_SINGLE ) {
			Scroll( parms[ 0 ].ToInteger() );
		}
		return true;
	}

	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:19,代码来源:MenuWidget_InfoBox.cpp


示例11: HandleAction

/*
========================
idMenuWidget_ScrollBar::HandleAction
========================
*/
bool idMenuWidget_ScrollBar::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {

	widgetAction_t actionType = action.GetType();

	switch ( actionType ) {
		case WIDGET_ACTION_SCROLL_DRAG: {

			if ( event.parms.Num() != 3 ) {
				return true;
			}

			dragging = true;

			float x = event.parms[0].ToFloat();
			float y = event.parms[1].ToFloat();
			bool initial = event.parms[2].ToBool();
			if ( initial ) {
				CalcTopAndBottom();
			}

			CalculatePosition( x, y );
			return true;
		}
		case WIDGET_ACTION_EVENT_DRAG_STOP: {
			dragging = false;
			return true;
		}
	}

	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:36,代码来源:MenuWidget_Scrollbar.cpp


示例12: HandleAction

/*
========================
idMenuScreen_Shell_Singleplayer::HandleAction
========================
*/
bool idMenuScreen_Shell_Singleplayer::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {

	if ( menuData == NULL ) {
		return true;
	}

	if ( menuData->ActiveScreen() != SHELL_AREA_CAMPAIGN ) {
		return false;
	}

	widgetAction_t actionType = action.GetType();
	const idSWFParmList & parms = action.GetParms();

	switch ( actionType ) {
		case WIDGET_ACTION_GO_BACK: {
			menuData->SetNextScreen( SHELL_AREA_ROOT, MENU_TRANSITION_SIMPLE );
			return true;
		}
		case WIDGET_ACTION_PRESS_FOCUSED: {
			if ( options == NULL ) {
				return true;
			}

			int selectionIndex = options->GetViewIndex();
			if ( parms.Num() == 1 ) {
				selectionIndex = parms[0].ToInteger();
			}			

			canContinue = false;
			const saveGameDetailsList_t & saveGameInfo = session->GetSaveGameManager().GetEnumeratedSavegames();
			canContinue = ( saveGameInfo.Num() > 0 );
			if ( canContinue ) {
				if ( selectionIndex == 0 ) {
					ContinueGame();

				} else if ( selectionIndex == 1 ) {
					class idSWFScriptFunction_NewGame : public idSWFScriptFunction_RefCounted {
					public:
						idSWFScriptFunction_NewGame( idMenuHandler * _menuData, bool _accept ) {
							menuData = _menuData;
							accept = _accept;
						}
						idSWFScriptVar Call( idSWFScriptObject * thisObject, const idSWFParmList & parms ) {
							common->Dialog().ClearDialog( GDM_DELETE_AUTOSAVE );
							if ( accept ) {
								menuData->SetNextScreen( SHELL_AREA_NEW_GAME, MENU_TRANSITION_SIMPLE );
							}
							return idSWFScriptVar();
						}
					private:
						idMenuHandler * menuData;
						bool accept;
					};
					common->Dialog().AddDialog( GDM_DELETE_AUTOSAVE, DIALOG_ACCEPT_CANCEL, new idSWFScriptFunction_NewGame( menuData, true ), new idSWFScriptFunction_NewGame( menuData, false ), true );
				} else if ( selectionIndex == 2 ) {
					menuData->SetNextScreen( SHELL_AREA_LOAD, MENU_TRANSITION_SIMPLE );
				}
			} else {
				if ( selectionIndex == 0 ) {
					menuData->SetNextScreen( SHELL_AREA_NEW_GAME, MENU_TRANSITION_SIMPLE );
				} else if ( selectionIndex == 1 ) {
					menuData->SetNextScreen( SHELL_AREA_LOAD, MENU_TRANSITION_SIMPLE );
				}	
			}
			
			return true;
		}
	}

	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
开发者ID:Deepfreeze32,项目名称:taken,代码行数:76,代码来源:MenuScreen_Shell_Singleplayer.cpp


示例13: HandleAction

/*
========================
idMenuScreen_Shell_Save::HandleAction
========================
*/
bool idMenuScreen_Shell_Save::HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled )
{

	if( menuData == NULL )
	{
		return true;
	}
	
	if( menuData->ActiveScreen() != SHELL_AREA_SAVE )
	{
		return false;
	}
	
	widgetAction_t actionType = action.GetType();
	const idSWFParmList& parms = action.GetParms();
	
	switch( actionType )
	{
		case WIDGET_ACTION_JOY4_ON_PRESS:
		{
			return true;
		}
		case WIDGET_ACTION_JOY3_ON_PRESS:
		{
		
			if( options == NULL )
			{
				return true;
			}
			
			DeleteGame( options->GetViewIndex() );
			return true;
		}
		case WIDGET_ACTION_GO_BACK:
		{
			menuData->SetNextScreen( SHELL_AREA_ROOT, MENU_TRANSITION_SIMPLE );
			return true;
		}
		case WIDGET_ACTION_PRESS_FOCUSED:
		{
			if( options == NULL )
			{
				return true;
			}
			
			if( session->GetSaveGameManager().IsWorking() )
			{
				return true;
			}
			
			if( parms.Num() == 1 )
			{
				int selectionIndex = parms[0].ToInteger();
				if( selectionIndex != options->GetFocusIndex() )
				{
					options->SetViewIndex( options->GetViewOffset() + selectionIndex );
					options->SetFocusIndex( selectionIndex );
					return true;
				}
			}
			
			SaveGame( options->GetViewIndex() );
			return true;
		}
		case WIDGET_ACTION_SCROLL_VERTICAL:
		{
			return true;
		}
	}
	
	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
开发者ID:Anthony-Gaudino,项目名称:OpenTechBFG,代码行数:77,代码来源:MenuScreen_Shell_Save.cpp


示例14: switch

/*
========================
idMenuScreen_PDA_Inventory::HandleAction
========================
*/
bool idMenuScreen_PDA_Inventory::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {

	if ( menuData == NULL ) {
		return true;
	}

	if ( menuData->ActiveScreen() != PDA_AREA_INVENTORY ) {
		return false;
	}

	widgetAction_t actionType = action.GetType();
	const idSWFParmList & parms = action.GetParms();

	switch ( actionType ) {
		case WIDGET_ACTION_JOY3_ON_PRESS: {
			EquipWeapon();
			return true;
		}
		case WIDGET_ACTION_GO_BACK: {
			menuData->SetNextScreen( PDA_AREA_INVALID, MENU_TRANSITION_ADVANCE );
			return true;
		}
		case WIDGET_ACTION_START_REPEATER: {
			idWidgetAction repeatAction;
			widgetAction_t repeatActionType = static_cast< widgetAction_t >( parms[ 0 ].ToInteger() );
			assert( parms.Num() == 2 );
			repeatAction.Set( repeatActionType, parms[ 1 ] );
			menuData->StartWidgetActionRepeater( widget, repeatAction, event );
			return true;
		}
		case WIDGET_ACTION_SELECT_PDA_ITEM: {

			if ( itemList.GetMoveDiff() > 0 ) {
				itemList.MoveToIndex( itemList.GetMoveToIndex(), true );
			}

			int index = parms[0].ToInteger();
			if ( index != 0 ) {
				itemList.MoveToIndex( index );
				Update();
			}

			return true;
		}
		case WIDGET_ACTION_STOP_REPEATER: {
			menuData->ClearWidgetActionRepeater();
			return true;
		}
		case WIDGET_ACTION_SCROLL_HORIZONTAL: {
			
			if ( itemList.GetTotalNumberOfOptions() <= 1 ) {
				return true;
			}

			if ( itemList.GetMoveDiff() > 0 ) {
				itemList.MoveToIndex( itemList.GetMoveToIndex(), true );
			}

			int direction = parms[0].ToInteger();
			if ( direction == 1 ) {					
				if ( itemList.GetViewIndex() == itemList.GetTotalNumberOfOptions() - 1 ) {
					return true;
				} else {
					itemList.MoveToIndex( 1 );
				}
			} else {
				if ( itemList.GetViewIndex() == 0 ) {
					return true;
				} else {
					itemList.MoveToIndex( ( itemList.GetNumVisibleOptions() / 2 ) + 1 );
				}
			}	
			Update();

			return true;
		}
	}

	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:85,代码来源:MenuScreen_PDA_Inventory.cpp


示例15: HandleAction

/*
========================
idMenuScreen_PDA_UserEmails::HandleAction
========================
*/
bool idMenuScreen_PDA_UserEmails::HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled )
{

	if( menuData == NULL )
	{
		return true;
	}
	
	if( menuData->ActiveScreen() != PDA_AREA_USER_EMAIL )
	{
		return false;
	}
	
	widgetAction_t actionType = action.GetType();
	const idSWFParmList& parms = action.GetParms();
	
	switch( actionType )
	{
		case WIDGET_ACTION_PDA_CLOSE:
		{
			menuData->SetNextScreen( PDA_AREA_INVALID, MENU_TRANSITION_ADVANCE );
			return true;
		}
		case WIDGET_ACTION_GO_BACK:
		{
			if( readingEmails )
			{
				ShowEmail( false );
			}
			else
			{
				menuData->SetNextScreen( PDA_AREA_INVALID, MENU_TRANSITION_ADVANCE );
			}
			return true;
		}
		case WIDGET_ACTION_REFRESH:
		{
			UpdateEmail();
			return true;
		}
		case WIDGET_ACTION_PDA_SELECT_EMAIL:
		{
		
			if( widget->GetParent() != NULL )
			{
				idMenuWidget_DynamicList* emailList = dynamic_cast< idMenuWidget_DynamicList* >( widget->GetParent() );
				int index = parms[0].ToInteger();
				if( emailList != NULL )
				{
					emailList->SetViewIndex( emailList->GetViewOffset() + index );
					emailList->SetFocusIndex( index );
				}
			}
			
			ShowEmail( true );
			
			return true;
		}
		case WIDGET_ACTION_EMAIL_HOVER:
		{
			scrollEmailInfo = parms[0].ToBool();
			return true;
		}
		case WIDGET_ACTION_SCROLL_VERTICAL:
		{
			if( ScrollCorrectList( action, event, widget ) )
			{
				return true;
			}
			UpdateEmail();
			break;
		}
	}
	
	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
开发者ID:Anthony-Gaudino,项目名称:OpenTechBFG,代码行数:81,代码来源:MenuScreen_PDA_UserEmails.cpp


示例16: HandleAction

/*
========================
idMenuScreen_Shell_Leaderboards::HandleAction
========================
*/
bool idMenuScreen_Shell_Leaderboards::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {

	if ( menuData == NULL ) {
		return true;
	}

	if ( menuData->ActiveScreen() != SHELL_AREA_LEADERBOARDS ) {
		return false;
	}

	widgetAction_t actionType = action.GetType();
	const idSWFParmList & parms = action.GetParms();

	switch ( actionType ) {
		case WIDGET_ACTION_GO_BACK: {
			menuData->SetNextScreen( SHELL_AREA_PARTY_LOBBY, MENU_TRANSITION_SIMPLE );
			return true;									
		}
		case WIDGET_ACTION_JOY3_ON_PRESS: {
			lbCache->CycleFilter();
			refreshLeaderboard = true;
			return true;
		}
		case WIDGET_ACTION_PRESS_FOCUSED: {

			if ( options == NULL ) {
				return true;
			}

			int index = options->GetFocusIndex();
			if ( parms.Num() != 0 ) {
				index = parms[0].ToInteger();
			}

			if ( lbCache->GetEntryIndex() != index ) {
				lbCache->SetEntryIndex( index );
				refreshLeaderboard = true;
				return true;
			}

			const idLeaderboardCallback::row_t * row = lbCache->GetLeaderboardRow( lbCache->GetRowOffset() + lbCache->GetEntryIndex() );
			if ( row != NULL ) {
				lbCache->DisplayGamerCardUI( row );
			}

			return true;
		}
		case WIDGET_ACTION_SCROLL_TAB: {
			int delta = parms[0].ToInteger();
			lbIndex += delta;
			SetLeaderboardIndex();
			return true;
		}
		case WIDGET_ACTION_SCROLL_VERTICAL_VARIABLE: {
			if ( parms.Num() == 0 ) {
				return true;
			}

			if ( options == NULL ) {		
				return true;
			}

			int dir = parms[ 0 ].ToInteger();
			if ( lbCache->Scroll( dir ) ) {
				// TODO_SPARTY: play scroll sound
				refreshLeaderboard = true;
			}

			return true;
		}
		case WIDGET_ACTION_SCROLL_PAGE: {
			if ( parms.Num() == 0 ) {
				return true;
			}

			if ( options == NULL ) {		
				return true;
			}

			int dir = parms[ 0 ].ToInteger();
			if ( lbCache->ScrollOffset( dir ) ) {
				refreshLeaderboard = true;
			}

			return true;
		}
	}

	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:95,代码来源:MenuScreen_Shell_Leaderboards.cpp


示例17: HandleAction

/*
========================
idMenuScreen_Shell_ControllerLayout::HandleAction h
========================
*/
bool idMenuScreen_Shell_ControllerLayout::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {

	if ( menuData == NULL ) {
		return true;
	}

	if ( menuData->ActiveScreen() != SHELL_AREA_CONTROLLER_LAYOUT ) {
		return false;
	}

	widgetAction_t actionType = action.GetType();
	const idSWFParmList & parms = action.GetParms();

	switch ( actionType ) {
		case WIDGET_ACTION_GO_BACK: {
			menuData->SetNextScreen( SHELL_AREA_GAMEPAD, MENU_TRANSITION_SIMPLE );
			return true;
		}
		case WIDGET_ACTION_PRESS_FOCUSED: {
			if ( parms.Num() != 1 ) {
				return true;
			}

			if ( options == NULL ) {
				return true;
			}

			int selectionIndex = parms[0].ToInteger();
			if ( selectionIndex != options->GetFocusIndex() ) {
				options->SetViewIndex( options->GetViewOffset() + selectionIndex );
				options->SetFocusIndex( selectionIndex );
			}						

			layoutData.AdjustField( selectionIndex, 1 );
			options->Update();
			UpdateBindingInfo();
			return true;
		}
		case WIDGET_ACTION_START_REPEATER: {

			if ( options == NULL ) {
				return true;
			}

			if ( parms.Num() == 4 ) {
				int selectionIndex = parms[3].ToInteger();
				if ( selectionIndex != options->GetFocusIndex() ) {
					options->SetViewIndex( options->GetViewOffset() + selectionIndex );
					options->SetFocusIndex( selectionIndex );
				}
			}
			break;
		}
		case WIDGET_ACTION_ADJUST_FIELD: {
			if ( widget != NULL && widget->GetDataSource() != NULL ) {
				widget->GetDataSource()->AdjustField( widget->GetDataSourceFieldIndex(), parms[ 0 ].ToInteger() );
				widget->Update();
			}
			UpdateBindingInfo();
			return true;
		}
	}

	return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
开发者ID:Deepfreeze32,项目名称:taken,代码行数:70,代码来源:MenuScreen_Shell_ControllerLayout.cpp


示例18: HandleAction

/*
========================
idMenuScreen_Shell_GameLobby::HandleAction h
========================
*/
bool idMenuScreen_Shell_GameLobby::HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled )
{

	if( menuData == NULL )
	{
		return true;
	}
	
	if( menuData->ActiveScreen() != SHELL_AREA_GAME_LOBBY )
	{
		return false;
	}
	
	widgetAction_t actionType = action.GetType();
	const idSWFParmList& parms = action.GetParms();
	
	switch( actionType )
	{
		case WIDGET_ACTION_JOY4_ON_PRESS:
		{
			idLobbyBase& activeLobby = session->GetActivePlatformLobbyBase();
			lobbyUserID_t luid;
			if( CanKickSelectedPlayer( luid ) )
			{
				activeLobby.KickLobbyUser( luid );
			}
			return true;
		}
		case WIDGET_ACTION_GO_BACK:
		{
			class idSWFScriptFunction_Accept : public idSWFScriptFunction_RefCounted
			{
			public:
				idSWFScriptFunction_Accept() { }
				idSWFScriptVar Call( idSWFScriptObject* thisObject, const idSWFParmList& parms )
				{
					common->Dialog().ClearDialog( GDM_LEAVE_LOBBY_RET_NEW_PARTY );
					session->Cancel();
					
					return idSWFScriptVar();
				}
			};
			class idSWFScriptFunction_Cancel : public idSWFScriptFunction_RefCounted
			{
			public:
				idSWFScriptFunction_Cancel() { }
				idSWFScriptVar Call( idSWFScriptObject* thisObject, const idSWFParmList& parms )
				{
					common->Dialog().ClearDialog( GDM_LEAVE_LOBBY_RET_NEW_PARTY );
					return idSWFScriptVar();
				}
			};
			
			idLobbyBase& activeLobby = session->GetActivePlatformLobbyBase();
			
			if( activeLobby.GetNumActiveLobbyUsers() > 1 )
			{
				common->Dialog().AddDialog( GDM_LEAVE_LOBBY_RET_NEW_PARTY, DIALOG_ACCEPT_CANCEL, new( TAG_SWF ) idSWFScriptFunction_Accept(), new( TAG_SWF ) idSWFScriptFunction_Cancel(), false );
			}
			else
			{
				session->Cancel();
			}
			
			return true;
		}
		case WIDGET_ACTION_MUTE_PLAYER:
		{
		
			if( parms.Num() != 1 )
			{
				return true;
			}
			
			int index = parms[0].ToInteger();
			
			idLobbyBase& activeLobby = session->GetActivePlatformLobbyBase();
			lobbyUserID_t luid = activeLobby.GetLobbyUserIdByOrdinal( index );
			if( luid.IsValid() )
			{
				session->ToggleLobbyUserVoiceMute( luid );
			}
			
			return true;
		}
		case WIDGET_ACTION_COMMAND:
		{
		
			if( options == NULL )
			{
				return true;
			}
			
			int selectionIndex = options->GetFocusIndex();
			if( parms.Num() > 1 )
//.........这里部分代码省略.........
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:101,代码来源:MenuScreen_Shell_GameLobby.cpp


示例19: HandleAction

/*
========================
idMenuScreen_Shell_Gamepad::HandleAction
========================
*/
bool idMenuScreen_Shell_Gamepad::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {

	if ( menuData == NULL ) {
		return true;
	}

	if ( menuData->ActiveScreen() != SHELL_AREA_GAMEPAD ) {
		return false;
	}

	widgetAction_t actionType = action.GetType();
	const idSWFParmList & parms = action.GetParms();

	switch ( actionType ) {
		case WIDGET_ACTION_GO_BACK: {
			menuData->SetNextScreen( SHELL_AREA_CONTROLS, MENU_TRANSITION_SIMPLE );
			return true;
		}
		case WIDGET_ACTION_COMMAND: {

			if ( options == NULL ) {
				return true;
			}

			int selectionIndex = options->GetFocusIndex();
			if ( parms.Num() > 0 ) {
				selectionIndex = parms[0].ToInteger();
			}

			if ( selectionIndex != options->GetFocusIndex() ) {
				options->SetViewIndex( options->GetViewOffset() + selectionIndex );
				options->SetFocusIndex( selectionIndex );
			}

			switch ( parms[0].ToInteger() ) {
#ifndef ID_PC
				case GAMEPAD_CMD_CONFIG: {
					menuData->SetNextScreen( SHELL_AREA_CONTROLLER_LAYOUT, MENU_TRANSITION_SIMPLE );
					break;
				}
#endif
				case GAMEPAD_CMD_INVERT: {
					gamepadData.AdjustField( idMenuDataSource_GamepadSettings::GAMEPAD_FIELD_INVERT, 1 );
					options->Update();
					break;
				}
				case GAMEPAD_CMD_LEFTY: {
					gamepadData.AdjustField( idMenuDataSource_GamepadSettings::GAMEPAD_FIELD_LEFTY, 1 );
					options->Update();
					break;
				}
				case GAMEPAD_CMD_VIBRATE: {
					gamepadData.AdjustField( idMenuDataSource_GamepadSettings::GAMEPAD_FIELD_VIBRATE, 1 );
					options->Update();
					break;
				}
				case GAMEPAD_CMD_HOR_SENS: {
					gamepadData.AdjustField( idMenuDataSource_GamepadSettings::GAMEPAD_FIELD_HOR_SENS, 1 );
					options->Update();
					break;
				}
				case GAMEPAD_CMD_VERT_SENS: {
					gamepadData.AdjustField( idMenuDataSource_GamepadSettings::GAMEPAD_FIELD_VERT_SENS, 1 );
					options->Update();
					break;
				}
				case GAMEPAD_CMD_ACCELERATION: {
					gamepadData.AdjustField( idMenuDataSource_GamepadSettings::GAMEPAD_FIELD_ACCELERATION, 1 );
					options->Update();
					break;
				}
				case GAMEPAD_CMD_THRESHOLD: {
					gamepadData.AdjustField( idMenuDataSource_GamepadSettings::GAMEPAD_FIELD_THRESHOLD, 1 );
					options->Update();
					break;
				}
			}

			return true;
		}
		case WIDGET_ACTION_START_REPEATER: {

			if ( options == NULL ) {
				return true;
			}

			if ( parms.Num() == 4 ) {
				int selectionIndex = parms[3].ToInteger();
				if ( selectionIndex != options->GetFocusIndex() ) {
					options->SetViewIndex( options->GetViewOffset() + selectionIndex );
					options->SetFocusIndex( selectionIndex );
				}
			}
			break;
		}
//.........这里部分代码省略.........
开发者ID:RobertBeckebans,项目名称:DOOM3-BFG-RIFT,代码行数:101,代码来源:MenuScreen_Shell_Gamepad.cpp


示例20: switch

/*
========================
idMenuScreen_Shell_PressStart::HandleAction
========================
*/
bool idMenuScreen_Shell_PressStart::HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled )
{

	if( menuData == NULL )
	{
		return true;
	}
	
	if( menuData->ActiveScreen() != SHELL_AREA_START )
	{
		return false;
	}
	
	widgetAction_t actionType = action.GetType();
	const idSWFParmList& parms = action.GetParms();
	
	switch( actionType )
	{
		case WIDGET_ACTION_PRESS_FOCUSED:
		{
			if( itemList == NULL )
			{
				return true;
			}
			
			if( event.parms.Num() != 1 )
			{
				return true;
			}
			
			if( itemList->GetMoveToIndex() != itemList->GetViewIndex() )
			{
				return true;
			}
			
			if( parms.Num() > 0 )
			{
				const int index = parms[0].ToInteger();
				if( index != 0 )
				{
					itemList->MoveToIndex( index );
					Update();
				}
			}
			
			// RB begin
#if defined(USE_DOOMCLASSIC)
			if( itemList->GetMoveToIndex() == 0 )
			{
				common->SwitchToGame( DOOM_CLASSIC );
			}
			else
#endif
				if( itemList->GetMoveToIndex() == 1 )
				{
					if( session->GetSignInManager().GetMasterLocalUser() == NULL )
					{
						const int device = event.parms[ 0 ].ToInteger();
						session->GetSignInManager().RegisterLocalUser( device );
					}
					else
					{
						menuData->SetNextScreen( SHELL_AREA_ROOT, MENU_TRANSITION_SIMPLE );
					}
				}
#if defined(USE_DOOMCLASSIC)
				else if( itemList->GetMoveToIndex() == 2 )
				{
					common->SwitchToGame( DOOM2_CLASSIC );
				}
#endif
			// RB end
			
			return true;
		}
		case WIDGET_ACTION_START_REPEATER:
		{
			idWidgetAction repeatAction;
			widgetAction_t repeatActionType = static_cast< widgetAction_t >( parms[ 0 ].ToInteger() );
			assert( parms.Num() == 2 );
			repeatAction.Set( repeatActionType, parms[ 1 ] );
			menuData->StartWidgetActionRepeater( widget, repeatAction, event );
			return true;
		}
		case WIDGET_ACTION_STOP_REPEATER:
		{
			menuData->ClearWidgetActionRepeater();
			return true;
		}
		case WIDGET_ACTION_SCROLL_HORIZONTAL:
		{
		
			if( itemList == NULL )
			{
				return true;
//.........这里部分代码省略.........
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:101,代码来源:MenuScreen_Shell_PressStart.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ idWinding类代码示例发布时间:2022-05-31
下一篇:
C++ idVec3类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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