void CInputEventsTranslator::deactivateRuleManager()
		{

			CMessageModule* messageModule = CMessageModule::getInstancePtr();
			Messages::Messenger* messageManager = messageModule->getMessageManager();

			try
			{
				messageManager->delListener ( ruleManager, ACTION_EVENT_TYPE );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage( "ruleManager removed for ACTION_EVENT_TYPE" );

				messageManager->delListener ( ruleManager, ACTION_EVENT_STATE_TYPE );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage( "ruleManager removed for ACTION_EVENT_STATE_TYPE" );
			}
			catch(...)
			{
				throw;
			}
		}
		void CInputEventsTranslator::deactivateMouseButtonTranslation()
		{

			Messages::MessageType mousePressed("MOUSE_PRESSED");
			Messages::MessageType mouseReleased("MOUSE_RELEASED");
			Messages::MessageType updateMouse("UPDATE_MOUSE");

			CMessageModule* messageModule = CMessageModule::getInstancePtr();
			Messages::Messenger* messageManager = messageModule->getMessageManager();

			try
			{
				/**
				 * Continuous mouse messages
				 */
				messageManager->delListener ( mouseButtonEventsTranslator, mousePressed );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage ( "mouseButtonEventsTranslator listener removed for MOUSE_PRESSED" );

				messageManager->delListener ( mouseButtonEventsTranslator, mouseReleased );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage ( "mouseButtonEventsTranslator listener removed for MOUSE_RELEASED" );

				messageManager->delListener ( mouseButtonEventsTrigger, updateMouse );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage ( "mouseButtonEventsTrigger listener removed" );

				/**
				 * State based mouse messages
				 */
				messageManager->delListener ( mouseButtonStateTranslator, mousePressed );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage ( "mouseButtonStateTranslator listener removed for MOUSE_PRESSED" );

				messageManager->delListener ( mouseButtonStateTranslator, mouseReleased );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage ( "mouseButtonStateTranslator listener removed for MOUSE_RELEASED" );
			}
			catch(...)
			{
				throw;
			}

			CTimeModule* timeModule = CTimeModule::getInstancePtr();
			shared_ptr<CMessage>  message (new CMessage(updateMouse, m_periodData ));
			timeModule->delPeriodicEvent(0, message, boost::any_cast<unsigned long int> (*m_periodData) );

		}
		void CInputEventsTranslator::deactivateKeyboardTranslation()
		{
			Messages::MessageType keyDown("KEYBOARD_KEYDOWN");
			Messages::MessageType keyUp("KEYBOARD_KEYUP");
			Messages::MessageType updateKeyboard("UPDATE_KEYBOARD");


			CMessageModule* messageModule = CMessageModule::getInstancePtr();
			Messages::Messenger* messageManager = messageModule->getMessageManager();

			try
			{
				/**
				 * Continuous keybord messages
				 */
				messageManager->delListener ( keyboardEventsTranslator, keyDown );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage( "KeyboardEventsTranslator listener removed" );

				messageManager->delListener ( keyboardEventsTranslator, keyUp );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage( "KeyboardEventsTranslator listener removed" );

				messageManager->delListener ( keyboardEventsTrigger, updateKeyboard );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage( "KeyboardEventsTrigger listener removed" );

				/**
				 * State based keyboard messages
				 */
				messageManager->delListener ( keyboardStateTranslator, keyDown );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage( "KeyboardStateTranslator listener removed" );

				messageManager->delListener ( keyboardStateTranslator, keyUp );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage( "KeyboardStateTranslator listener removed" );
			}
			catch(...)
			{
				throw;
			}


			CTimeModule* timeModule = CTimeModule::getInstancePtr();
			shared_ptr<CMessage>  message (new CMessage(updateKeyboard, m_periodData ));
			timeModule->delPeriodicEvent(0, message, boost::any_cast<unsigned long int> (*m_periodData) );
		}
		void CInputEventsTranslator::deactivateMouseMotionTranslation()
		{

			Messages::MessageType mouseMoved("MOUSE_MOVED");

			CMessageModule* messageModule = CMessageModule::getInstancePtr();
			Messages::Messenger* messageManager = messageModule->getMessageManager();

			try
			{
				messageManager->delListener ( mouseMotionEventsTranslator, mouseMoved );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage( "mouseMotionEventsTranslator listener removed" );

				messageManager->delListener ( mouseMotionStateTranslator, mouseMoved );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage( "mouseMotionStateTranslator listener removed" );
			}
			catch(...)
			{
				throw;
			}
		}
Example #5
0
		void CRotationComponent::exit()
		{
			/**
			 * Unregister the listener
			 */
			MessageModule*  messageModule  = MessageModule::getInstancePtr();
			Messages::Messenger* messageManager = messageModule->getMessageManager();

			messageManager->delListener ( rotationListener, "SET_ROTATION_" + parent->getInstance() );

			this->setAttribute(CRotationComponent::ATTRIBUTE_ROTATION(),
							   shared_ptr<Gnoll::DynamicObject::Vector3> (new Gnoll::DynamicObject::Vector3(rotation)));
		}