void Zoom3D::StartLeftButtonAction() { DisableSpinMode(); // If shift is pressed, pan, otherwise rubber band zoom. The pan // action matches the Navigate2D/3D modes. Save which one we did so // we can issue the proper "End.." statement when the button is // released. if (Interactor->GetShiftKey()) { StartBoundingBox(); StartPan(); shiftPressed = true; } // NOTE: the shift and ctrl go into the rubberband zoom and affect // whether one gets a rectangle (shift) or zooms out (ctrl). At // this point the shift is intercepted above to pan which matches // the Navigate2D/3D modes. else { int x, y; Interactor->GetEventPosition(x, y); StartZoom(); StartRubberBand(x, y); } }
void Zoom3D::StartMiddleButtonAction() { StartBoundingBox(); StartZoom(); }
void Zoom3D::StartLeftButtonAction() { DisableSpinMode(); // // If ctrl or shift is pushed, pan, otherwise zoom. Save which one we // did so we can issue the proper "End.." statement when the button is // released. // if (Interactor->GetControlKey() || Interactor->GetShiftKey()) { StartBoundingBox(); StartPan(); ctrlOrShiftPushed = true; } else { int x, y; Interactor->GetEventPosition(x, y); StartZoom(); StartRubberBand(x, y); ctrlOrShiftPushed = false; } }
//------------------------------------------------------------------------------ bool CWeapon::OnActionZoomXI(EntityId actorId, const ActionId& actionId, int activationMode, float value) { if (!AreAnyItemFlagsSet(eIF_Modifying)) { if (g_pGameCVars->hud_ctrlZoomMode) { if (activationMode == eAAM_OnPress) { if(m_fm && !m_fm->IsReloading()) { // The zoom code includes the aim assistance if (m_fm->AllowZoom()) { StartZoom(actorId,1); } else { m_fm->Cancel(); } } } else if (activationMode == eAAM_OnRelease) { if(m_fm && !m_fm->IsReloading()) { StopZoom(actorId); } } } else { if (activationMode == eAAM_OnPress && m_fm && !m_fm->IsReloading()) { if (m_fm->AllowZoom()) { StartZoom(actorId,1); } else { m_fm->Cancel(); } } } } return true; }
void NavigateCurve::OnMouseWheelBackward() { StartZoom(); ZoomCamera(MotionFactor * -0.2 * this->MouseWheelMotionFactor); EndZoom(); IssueViewCallback(true); }
void Navigate2D::OnMouseWheelForward() { StartZoom(); ZoomCamera2D(MotionFactor * 0.2 * this->MouseWheelMotionFactor); EndZoom(); IssueViewCallback(true); }
void Zoom3D::OnMouseWheelBackward() { StartZoom(); ZoomImage3D(MotionFactor * -0.2 * this->MouseWheelMotionFactor); EndZoom(); IssueViewCallback(true); }
void ZoomCurve::StartLeftButtonAction() { int x, y; Interactor->GetEventPosition(x, y); StartZoom(); StartRubberBand(x, y); }
void FlyThrough::StartMiddleButtonAction() { DisableSpinMode(); StartBoundingBox(); StartZoom(); }
void NavigateAxisArray::OnMouseWheelBackward() { StartZoom(); if (axisOrientation == Vertical) ZoomHorizontalFixed(0.25 * this->MouseWheelMotionFactor); else ZoomVerticalFixed(0.25 * this->MouseWheelMotionFactor); EndZoom(); }
//--------------------------------------------------------- bool CWeapon::OnActionZoomIn(EntityId actorId, const ActionId& actionId, int activationMode, float value) { if(m_zm && m_zm->IsZoomed()) { int numSteps = m_zm->GetMaxZoomSteps(); if((numSteps>1) && (m_zm->GetCurrentStep()<numSteps)) StartZoom(actorId,1); } return true; }
//---------------------------------------------------------- bool CWeapon::OnActionZoom(EntityId actorId, const ActionId& actionId, int activationMode, float value) { COffHand * offHandWeapon = NULL; bool isOffHandSelected = false; GetOffHandInfo(this,isOffHandSelected,&offHandWeapon); if (!m_modifying && (!isOffHandSelected || (offHandWeapon->GetOffHandState()&eOHS_TRANSITIONING))) { if (activationMode == eAAM_OnPress && m_useViewMode) { IncrementViewmode(); } else { bool isDualWield = false; CWeapon *dualWield = NULL; GetDualWieldInfo(this,isDualWield,&dualWield); if (!isDualWield) { if (m_fm && !m_fm->IsReloading()) { if (activationMode == eAAM_OnPress) { if(!m_fm->AllowZoom()) { if(!IsTargetOn()) //Allow zoom-in, when using aiming helper return false; } if(m_weaponRaised) { return false; } //Use mouse wheel for scopes with several steps/stages if (m_zm && m_zm->IsZoomed() && m_zm->GetMaxZoomSteps()>1) m_zm->StopZoom(); else StartZoom(actorId,1); } else if (activationMode == eAAM_OnRelease) { if(m_zm && !m_zm->IsToggle()) m_zm->StopZoom(); } } } } } return true; }
//------------------------------------------------------------------------ IMPLEMENT_RMI(CWeapon, SvRequestSetZoomState) { CHECK_OWNER_REQUEST(); if (params.zoomed) StartZoom(m_owner.GetId(), 1); else StopZoom(m_owner.GetId()); CHANGED_NETWORK_STATE(this, ASPECT_STREAM); return true; }
//------------------------------------------------------------------------------ bool CWeapon::OnActionZoomXI(EntityId actorId, const ActionId& actionId, int activationMode, float value) { COffHand * offHandWeapon = NULL; bool isOffHandSelected = false; GetOffHandInfo(this,isOffHandSelected,&offHandWeapon); if (!m_modifying && !isOffHandSelected && !IsWeaponRaised()) { bool isDualWield = false; CWeapon *dualWield = NULL; GetDualWieldInfo(this,isDualWield,&dualWield); if (m_useViewMode) { if (activationMode == eAAM_OnPress) IncrementViewmode(); } else if (g_pGameCVars->hud_ctrlZoomMode) { if (activationMode == eAAM_OnPress) { if (!isDualWield) { if(m_fm && !m_fm->IsReloading()) { // The zoom code includes the aim assistance if (m_fm->AllowZoom()) StartZoom(actorId,1); else m_fm->Cancel(); } } else { // If the view does not zoom, we need to force aim assistance AssistAiming(1, true); } } else if (activationMode == eAAM_OnRelease) { if (!isDualWield) { if(m_fm && !m_fm->IsReloading()) StopZoom(actorId); } } } else { if (activationMode == eAAM_OnPress && m_fm && !m_fm->IsReloading()) { if (!isDualWield) { if (m_fm->AllowZoom()) StartZoom(actorId,1); else m_fm->Cancel(); } else { // If the view does not zoom, we need to force aim assistance AssistAiming(1, true); } } } } return true; }
bool CWeapon::OnActionZoom(EntityId actorId, const ActionId& actionId, int activationMode, float value) { if (IsModifying()) { return false; } const bool zoomingIn = IsZoomingIn(); const bool zoomed = IsZoomed(); const bool toggleMode = (g_pGameCVars->cl_zoomToggle > 0); const bool toggleZoomOn = !(zoomingIn || zoomed); const bool buttonPressed = (activationMode == eAAM_OnPress); if (!toggleMode) { // Toggle mode is off, i.e. You have to hold to stay zoomed. if(buttonPressed || activationMode == eAAM_OnHold) { SetInputFlag(eWeaponAction_Zoom); } else { ClearInputFlag(eWeaponAction_Zoom); } } else { // Toggle mode is on. if(buttonPressed) { if (toggleZoomOn) { SetInputFlag(eWeaponAction_Zoom); } else { ClearInputFlag(eWeaponAction_Zoom); } } } //can ironsight while super jumping in MP const bool trumpZoom = !CanZoomInState(); if (!AreAnyItemFlagsSet(eIF_Modifying) && !trumpZoom) { if (!m_fm || !m_fm->IsReloading()) { if (buttonPressed && (!toggleMode || toggleZoomOn)) { if(m_fm && !m_fm->AllowZoom()) { if(IsTargetOn()) { m_fm->Cancel(); } else { return false; } } } else if ((!toggleMode && activationMode == eAAM_OnRelease) || // Not toggle mode and button is released (toggleMode && !toggleZoomOn && buttonPressed)) // Toggle mode, zoom is to be toggled off and button is pressed { StopZoom(actorId); } const bool shouldStartZoom = (!toggleMode && (buttonPressed || activationMode == eAAM_OnHold)) || (toggleMode && toggleZoomOn && buttonPressed); if (m_zm && shouldStartZoom) { const bool zoomingOut = m_zm->IsZoomingInOrOut() && !zoomingIn; if ((!zoomed && !zoomingIn) || zoomingOut) { StartZoom(actorId,1); } if (buttonPressed) { m_snapToTargetTimer = 0.5f; } } } else if( (!toggleMode && activationMode == eAAM_OnRelease) || (toggleMode && !toggleZoomOn && buttonPressed) ) { StopZoom(actorId); } } else if (trumpZoom) { StopZoom(actorId); } return true; }
void ZoomCurve::StartMiddleButtonAction() { StartZoom(); }