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


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

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


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

示例1: UpdateDebugState

void CProceduralWeaponAnimation::UpdateDebugState()
{
	if ((g_pGameCVars->g_debugWeaponOffset==2) != m_debugInput)
	{
		IActionMapManager* pAMMgr = gEnv->pGame->GetIGameFramework()->GetIActionMapManager();

		if (g_pGameCVars->g_debugWeaponOffset == 2)
		{
			if (pAMMgr)
				pAMMgr->AddAlwaysActionListener(m_weaponOffsetInput);
			m_weaponOffsetInput->SetRightDebugOffset(SWeaponOffset(m_rightOffset));
			m_weaponOffsetInput->SetLeftDebugOffset(SWeaponOffset(m_leftOffset));
		}
		else if (pAMMgr)
		{
			pAMMgr->RemoveAlwaysActionListener(m_weaponOffsetInput);
		}
		m_debugInput = (g_pGameCVars->g_debugWeaponOffset == 2);
	}

	if (g_pGameCVars->g_debugWeaponOffset)
	{
		DrawCrossHairGuideLines();
	}
	if (m_debugInput)
	{
		m_weaponOffsetInput->Update();
	}
}
开发者ID:Xydrel,项目名称:Infected,代码行数:29,代码来源:ProceduralWeaponAnimation.cpp

示例2: InitEventSystem

void CUIInput::InitEventSystem()
{
	if ( !gEnv->pFlashUI
		|| !g_pGame->GetIGameFramework() 
		|| !g_pGame->GetIGameFramework()->GetIActionMapManager() )
	{
#if !defined(EXCLUDE_SCALEFORM_SDK)
        assert(false);
#endif
		return;
	}

	// set up the handlers
	if (s_actionHandler.GetNumHandlers() == 0)
	{
		#define ADD_HANDLER(action, func) s_actionHandler.AddHandler(actions.action, &CUIInput::func)
		const CGameActions& actions = g_pGame->Actions();

		ADD_HANDLER(ui_toggle_pause, OnActionTogglePause);
		ADD_HANDLER(ui_start_pause, OnActionStartPause);

		ADD_HANDLER(ui_up, OnActionUp);
		ADD_HANDLER(ui_down, OnActionDown);
		ADD_HANDLER(ui_left, OnActionLeft);	
		ADD_HANDLER(ui_right, OnActionRight);

		ADD_HANDLER(ui_click, OnActionClick);	
		ADD_HANDLER(ui_back, OnActionBack);	

		ADD_HANDLER(ui_confirm, OnActionConfirm);	
		ADD_HANDLER(ui_reset, OnActionReset);	

		#undef ADD_HANDLER
	}

	IActionMapManager* pAMMgr = g_pGame->GetIGameFramework()->GetIActionMapManager();
	if (pAMMgr)
	{
		pAMMgr->AddAlwaysActionListener(shared_from_this());
	}

	// ui events (sent to ui)
	m_pUIFunctions = gEnv->pFlashUI->CreateEventSystem( "Input", IUIEventSystem::eEST_SYSTEM_TO_UI );
	m_eventSender.Init(m_pUIFunctions);
	{
		SUIEventDesc eventDesc("OnKeyboardDone", "triggered once keyboard is done");
		eventDesc.AddParam<SUIParameterDesc::eUIPT_String>("String", "String of keyboard input");
		m_eventSender.RegisterEvent<eUIE_OnVirtKeyboardDone>(eventDesc);
	}

	{
		SUIEventDesc eventDesc("OnKeyboardCancelled", "triggered once keyboard is cancelled");
		m_eventSender.RegisterEvent<eUIE_OnVirtKeyboardCancelled>(eventDesc);
	}
	
	{
		SUIEventDesc eventDesc("OnExclusiveControllerDisconnected", "triggered once the exclusive controller got disconnected");
		m_eventSender.RegisterEvent<eUIE_OnExclusiveControllerDisconnected>(eventDesc);
	}

	// ui events (called from ui)
	m_pUIEvents = gEnv->pFlashUI->CreateEventSystem( "Input", IUIEventSystem::eEST_UI_TO_SYSTEM );
	m_eventDispatcher.Init(m_pUIEvents, this, "UIInput");
	{
		SUIEventDesc eventDesc("ShowVirtualKeyboard", "Displays the virtual keyboard");
		eventDesc.AddParam<SUIParameterDesc::eUIPT_String>("Title", "Title for the virtual keyboard");
		eventDesc.AddParam<SUIParameterDesc::eUIPT_String>("Value", "Initial string of virtual keyboard");
		eventDesc.AddParam<SUIParameterDesc::eUIPT_Int>("MaxChars", "Maximum chars");
		m_eventDispatcher.RegisterEvent( eventDesc, &CUIInput::OnDisplayVirtualKeyboard );
	}
}
开发者ID:amrhead,项目名称:eaascode,代码行数:71,代码来源:UIInput.cpp


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