bool CPlayerInput::OnActionMoveForward(EntityId entityId, const ActionId& actionId, int activationMode, float value) { if (CanMove()) { // (jh) release button if(activationMode == 2) { if(!(m_moveButtonState&eMBM_Back)) { // for camera m_moveStickUD = 0; m_deltaMovement.y = 0; if (!(m_moveButtonState&eMBM_Left) && !(m_moveButtonState&eMBM_Right)) m_actions &= ~ACTION_MOVE; } } else { // (jh) this holds the state information m_actions |= ACTION_MOVE; } // (jh) button pressed if(CheckMoveButtonStateChanged(eMBM_Forward, activationMode)) { /* Vec3 v(0.0, 0.0, 0.0); IAIActor* pAIActor = CastToIAIActorSafe(m_pPlayer->GetEntity()->GetAI()); pAIActor->SetSpeed(AISPEED_SPRINT); IAISignalExtraData* exd = gEnv->pAISystem->CreateSignalExtraData(); exd->point = v; pAIActor->SetSignal(AISIGNAL_DEFAULT, "ACT_GOTO", m_pPlayer->GetEntity(), exd); // pAIActor->GoTo() */ if(activationMode != 2) { ApplyMovement(Vec3(0,value * 2.0f - 1.0f,0)); // for camera m_moveStickUD = value * 2.0f - 1.0f; m_deltaMovement.y = value; } m_checkZoom = true; AdjustMoveButtonState(eMBM_Forward, activationMode); } } return false; }
bool CPlayerInput::OnActionMoveBack(EntityId entityId, const ActionId& actionId, int activationMode, float value) { if (CanMove()) { if(activationMode == 2) { if(!(m_moveButtonState&eMBM_Forward)) { // for camera m_moveStickUD = 0; m_deltaMovement.y = 0; if (!(m_moveButtonState&eMBM_Left) && !(m_moveButtonState&eMBM_Right)) m_actions &= ~ACTION_MOVE; } } else m_actions |= ACTION_MOVE; if(CheckMoveButtonStateChanged(eMBM_Back, activationMode)) { if(activationMode != 2) { ApplyMovement(Vec3(0,-(value*2.0f - 1.0f),0)); // for camera m_moveStickUD = -(value * 2.0f - 1.0f); m_deltaMovement.y = -value; } if(m_pPlayer->GetActorStats()->inZeroG) { if(activationMode == 2) m_actions &= ~ACTION_ZEROGBACK; else m_actions |= ACTION_ZEROGBACK; } m_checkZoom = true; AdjustMoveButtonState(eMBM_Back, activationMode); } } return false; }
bool CPlayerInput::OnActionMoveRight(EntityId entityId, const ActionId& actionId, int activationMode, float value) { if (CanMove()) { if(activationMode == 2) { if(!(m_moveButtonState&eMBM_Left)) { // for camera m_deltaMovement.x = 0; m_moveStickLR = 0; if (!(m_moveButtonState&eMBM_Back) && !(m_moveButtonState&eMBM_Forward)) m_actions &= ~ACTION_MOVE; } } else m_actions |= ACTION_MOVE; if(CheckMoveButtonStateChanged(eMBM_Right, activationMode)) { if(activationMode != 2) { ApplyMovement(Vec3(value*2.0f - 1.0f,0,0)); // for camera m_deltaMovement.x = value; m_moveStickLR = value; } m_checkZoom = true; AdjustMoveButtonState(eMBM_Right, activationMode); if(m_pPlayer->m_stats.isOnLadder) m_pPlayer->m_stats.ladderAction = CPlayer::eLAT_StrafeRight; } } return false; }
bool CPlayerInput::OnActionMoveForward(EntityId entityId, const ActionId& actionId, int activationMode, float value) { if (CanMove()) { if(activationMode == 2) { if(!(m_moveButtonState&eMBM_Back)) { // for camera m_moveStickUD = 0; m_deltaMovement.y = 0; if (!(m_moveButtonState&eMBM_Left) && !(m_moveButtonState&eMBM_Right)) m_actions &= ~ACTION_MOVE; } } else { m_actions |= ACTION_MOVE; } if(CheckMoveButtonStateChanged(eMBM_Forward, activationMode)) { if(activationMode != 2) { ApplyMovement(Vec3(0,value * 2.0f - 1.0f,0)); // for camera m_moveStickUD = value * 2.0f - 1.0f; m_deltaMovement.y = value; } m_checkZoom = true; AdjustMoveButtonState(eMBM_Forward, activationMode); } } return false; }