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


C++ IActionMapManager::GetActionMap方法代码示例

本文整理汇总了C++中IActionMapManager::GetActionMap方法的典型用法代码示例。如果您正苦于以下问题:C++ IActionMapManager::GetActionMap方法的具体用法?C++ IActionMapManager::GetActionMap怎么用?C++ IActionMapManager::GetActionMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IActionMapManager的用法示例。


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

示例1: EnableActionMaps

void CVehicleClient::EnableActionMaps(IVehicleSeat* pSeat, bool enable)
{
	assert(pSeat);

	// illegal to change action maps in demo playback - Lin
	if (!IsDemoPlayback() && pSeat)	
	{
		IActionMapManager* pActionMapMan = g_pGame->GetIGameFramework()->GetIActionMapManager();
		CRY_ASSERT(pActionMapMan);

		pActionMapMan->EnableActionMap("player", !enable);

		EntityId passengerID = pSeat->GetPassenger();
	
		// now the general vehicle controls
		if (IActionMap* pActionMap = pActionMapMan->GetActionMap("vehicle_general"))
		{
			pActionMap->SetActionListener(enable ? passengerID : 0);	
			pActionMapMan->EnableActionMap("vehicle_general", enable);
		}

		// todo: if necessary enable the vehicle-specific action map here

		// specific controls for this vehicle seat
		const char* actionMap = pSeat->GetActionMap();
		if (actionMap && actionMap[0])
		{
			if (IActionMap* pActionMap = pActionMapMan->GetActionMap(actionMap))
			{
				pActionMap->SetActionListener(enable ? passengerID : 0);
				pActionMapMan->EnableActionMap(actionMap, enable);
			}
		}
	}
}
开发者ID:nhnam,项目名称:Seasons,代码行数:35,代码来源:VehicleClient.cpp

示例2: OnStep

	EContextEstablishTaskResult OnStep(SContextEstablishState& state)
	{
    IActionMapManager *pActionMapMan = CCryAction::GetCryAction()->GetIActionMapManager();
    CRY_ASSERT(pActionMapMan);
    
    IActionMap* pDefaultActionMap = NULL;
		IActionMap* pDebugActionMap = NULL;
		IActionMap* pPlayerActionMap = NULL;
		IActionMap* pPlayerGamemodeActionMap = NULL;

		const char* disableGamemodeActionMapName = "player_mp";
		const char* gamemodeActionMapName = "player_sp";

		if(gEnv->bMultiplayer)
		{
			disableGamemodeActionMapName = "player_sp";
			gamemodeActionMapName = "player_mp";
		}

		if (true)
		{
			IPlayerProfileManager* pPPMgr = CCryAction::GetCryAction()->GetIPlayerProfileManager();
			if (pPPMgr)
			{
				int userCount = pPPMgr->GetUserCount();

				IPlayerProfile* pProfile = NULL;
				const char* userId = "UNKNOWN";
				if (userCount == 0)
				{
					if (gEnv->pSystem->IsDevMode())
					{
#ifndef _RELEASE
						//In devmode and not release get the default user if no users are signed in e.g. autotesting, map on the command line
						pProfile = pPPMgr->GetDefaultProfile();
						if (pProfile)
						{
							userId = pProfile->GetUserId();
						}
#endif // #ifndef _RELEASE
					}
					else
					{
						CryFatalError("[PlayerProfiles] CGameContext::StartGame: No users logged in");
						return eCETR_Failed;
					}
				}

				if (userCount > 0)
				{
					IPlayerProfileManager::SUserInfo info;
					pPPMgr->GetUserInfo(0, info);
					pProfile = pPPMgr->GetCurrentProfile(info.userId);
					userId = info.userId;
				}
				if (pProfile)
				{
					pDefaultActionMap = pProfile->GetActionMap("default");
					pDebugActionMap = pProfile->GetActionMap("debug");
					pPlayerActionMap = pProfile->GetActionMap("player");
		
					if (pDefaultActionMap == 0 && pPlayerActionMap == 0)
					{
						CryFatalError("[PlayerProfiles] CGameContext::StartGame: User '%s' has no actionmap 'default'!", userId);
						return eCETR_Failed;
					}
				}
				else
				{
					CryFatalError("[PlayerProfiles] CGameContext::StartGame: User '%s' has no active profile!", userId);
					return eCETR_Failed;
				}
			}
			else
			{
				CryFatalError("[PlayerProfiles] CGameContext::StartGame: No player profile manager!");				
				return eCETR_Failed;
			}
		}

		if (pDefaultActionMap == 0 )
		{
			// use action map without any profile stuff
			pActionMapMan->EnableActionMap( "default", true );
			pDefaultActionMap = pActionMapMan->GetActionMap("default");
			CRY_ASSERT_MESSAGE(pDefaultActionMap, "'default' action map not found!");	
		}

		if (pDebugActionMap == 0 )
		{
			// use action map without any profile stuff
			pActionMapMan->EnableActionMap( "debug", true );
			pDebugActionMap = pActionMapMan->GetActionMap("debug");
		}

		if (pPlayerActionMap == 0)
		{
			pActionMapMan->EnableActionMap( "player", true );
			pPlayerActionMap = pActionMapMan->GetActionMap("player");
		}
//.........这里部分代码省略.........
开发者ID:aronarts,项目名称:FireNET,代码行数:101,代码来源:CET_ActionMap.cpp

示例3: GetActionMap

//------------------------------------------------------------------------
// retrieve the action map 
IActionMap* CPlayerProfile::GetActionMap(const char* name)
{
	// for now, try to get the action map from the IActionMapManager
	IActionMapManager* pAM = CCryAction::GetCryAction()->GetIActionMapManager();
	return pAM->GetActionMap(name);
}
开发者ID:aronarts,项目名称:FireNET,代码行数:8,代码来源:PlayerProfile.cpp


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