void LLToolMgr::toggleBuildMode() { if (inBuildMode()) { if (gSavedSettings.getBOOL("EditCameraMovement")) { // just reset the view, will pull us out of edit mode handle_reset_view(); } else { // manually disable edit mode, but do not affect the camera gAgentCamera.resetView(false); LLFloaterReg::hideInstance("build"); gViewerWindow->showCursor(); } // avoid spurious avatar movements pulling out of edit mode LLViewerJoystick::getInstance()->setNeedsReset(); } else { ECameraMode camMode = gAgentCamera.getCameraMode(); if (CAMERA_MODE_MOUSELOOK == camMode || CAMERA_MODE_CUSTOMIZE_AVATAR == camMode) { // pull the user out of mouselook or appearance mode when entering build mode handle_reset_view(); } if (gSavedSettings.getBOOL("EditCameraMovement")) { // camera should be set if (LLViewerJoystick::getInstance()->getOverrideCamera()) { handle_toggle_flycam(); } if (gAgentCamera.getFocusOnAvatar()) { // zoom in if we're looking at the avatar gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); gAgentCamera.setFocusGlobal(gAgent.getPositionGlobal() + 2.0 * LLVector3d(gAgent.getAtAxis())); gAgentCamera.cameraZoomIn(0.666f); gAgentCamera.cameraOrbitOver( 30.f * DEG_TO_RAD ); } } setCurrentToolset(gBasicToolset); getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); // Could be first use //LLFirstUse::useBuild(); gAgentCamera.resetView(false); // avoid spurious avatar movements LLViewerJoystick::getInstance()->setNeedsReset(); } }
void LLToolMgr::toggleBuildMode() { if (inBuildMode()) { if (gSavedSettings.getBOOL("EditCameraMovement")) { // just reset the view, will pull us out of edit mode handle_reset_view(); } else { // manually disable edit mode, but do not affect the camera gAgentCamera.resetView(false); gFloaterTools->close(); gViewerWindow->showCursor(); } // avoid spurious avatar movements pulling out of edit mode LLViewerJoystick::getInstance()->setNeedsReset(); } else { ECameraMode camMode = gAgentCamera.getCameraMode(); if (CAMERA_MODE_MOUSELOOK == camMode || CAMERA_MODE_CUSTOMIZE_AVATAR == camMode) { // pull the user out of mouselook or appearance mode when entering build mode handle_reset_view(); } if (gSavedSettings.getBOOL("EditCameraMovement")) { // camera should be set if (LLViewerJoystick::getInstance()->getOverrideCamera()) { handle_toggle_flycam(); } if (gAgentCamera.getFocusOnAvatar()) { // zoom in if we're looking at the avatar gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); gAgentCamera.setFocusGlobal(gAgent.getPositionGlobal() + 2.0 * LLVector3d(gAgent.getAtAxis())); gAgentCamera.cameraZoomIn(0.666f); gAgentCamera.cameraOrbitOver( 30.f * DEG_TO_RAD ); } } // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) bool fRlvCanEdit = (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_EDITOBJ)); if (!fRlvCanEdit) { LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection(); RlvSelectIsEditable f; if ((hSel.notNull()) && ((hSel->getFirstRootNode(&f, TRUE)) != NULL)) LLSelectMgr::getInstance()->deselectAll(); } // [/RLVa:KB] setCurrentToolset(gBasicToolset); getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); // Could be first use LLFirstUse::useBuild(); gAgentCamera.resetView(false); // avoid spurious avatar movements LLViewerJoystick::getInstance()->setNeedsReset(); } }
void LLToolMgr::toggleBuildMode(const LLSD& sdname) { const std::string& param = sdname.asString(); // [RLVa:KB] - Checked: 2012-04-26 (RLVa-1.4.6) | Added: RLVa-1.4.6 | Ansa: Changed because of FIRE-5552 //if (param == "build" && !canEdit()) if (param == "build" && !RlvUIEnabler::isBuildEnabled()) // [/RLVa:KB] { return; } LLFloaterReg::toggleInstanceOrBringToFront("build"); bool build_visible = LLFloaterReg::instanceVisible("build"); if (build_visible) { ECameraMode camMode = gAgentCamera.getCameraMode(); if (CAMERA_MODE_MOUSELOOK == camMode || CAMERA_MODE_CUSTOMIZE_AVATAR == camMode) { // pull the user out of mouselook or appearance mode when entering build mode handle_reset_view(); } if (gSavedSettings.getBOOL("EditCameraMovement")) { // camera should be set if (LLViewerJoystick::getInstance()->getOverrideCamera()) { handle_toggle_flycam(); } if (gAgentCamera.getFocusOnAvatar()) { // zoom in if we're looking at the avatar gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); gAgentCamera.setFocusGlobal(gAgent.getPositionGlobal() + 2.0 * LLVector3d(gAgent.getAtAxis())); gAgentCamera.cameraZoomIn(0.666f); gAgentCamera.cameraOrbitOver( 30.f * DEG_TO_RAD ); } } setCurrentToolset(gBasicToolset); getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); // Could be first use //LLFirstUse::useBuild(); gAgentCamera.resetView(false); // avoid spurious avatar movements LLViewerJoystick::getInstance()->setNeedsReset(); } else { if (gSavedSettings.getBOOL("EditCameraMovement")) { // just reset the view, will pull us out of edit mode handle_reset_view(); } else { // manually disable edit mode, but do not affect the camera gAgentCamera.resetView(false); LLFloaterReg::hideInstance("build"); gViewerWindow->showCursor(); } // avoid spurious avatar movements pulling out of edit mode LLViewerJoystick::getInstance()->setNeedsReset(); } }