From b43771cad585cb9820941eb1b24b67390eaa9435 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Fri, 23 Oct 2009 17:20:45 +0000 Subject: Merging revisions 2156-2183 of https://svn.aws.productengine.com/secondlife/pe/stable-2 into P:\svn\viewer-2.0.0-3, respecting ancestry * Bugs: EXT-1590 EXT-1694 EXT-1660 EXT-1646 EXT-1694 EXT-1316 EXT-1775 EXT-1798 EXT-1799 EXT-1117 EXT-1571 EXT-1572 * Dev: EXT-1757 EXT-991 EXT-1758 EXT-1770 EXT-1192 EXT-1613 EXT-1611 EXT-1256 EXT-1758 EXT-747 --- indra/newview/llfloatercamera.cpp | 45 +++++++++++---------------------------- 1 file changed, 13 insertions(+), 32 deletions(-) (limited to 'indra/newview/llfloatercamera.cpp') diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index fc661772a6..dca0773139 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -50,6 +50,8 @@ const F32 CAMERA_BUTTON_DELAY = 0.0f; #define ORBIT "cam_rotate_stick" #define PAN "cam_track_stick" +#define ZOOM "zoom" +#define PRESETS "camera_presets" #define CONTROLS "controls" @@ -145,7 +147,7 @@ BOOL LLFloaterCamera::postBuild() setIsChrome(TRUE); mRotate = getChild(ORBIT); - mZoom = getChild("zoom"); + mZoom = getChild(ZOOM); mTrack = getChild(PAN); assignButton2Mode(CAMERA_CTRL_MODE_ORBIT, "orbit_btn"); @@ -216,7 +218,6 @@ void LLFloaterCamera::switchMode(ECameraControlMode mode) break; case CAMERA_CTRL_MODE_AVATAR_VIEW: - gAgent.changeCameraToMouselook(); break; default: @@ -252,15 +253,13 @@ void LLFloaterCamera::updateState() iter->second->setToggleState(iter->first == mCurrMode); } - //updating controls - bool isOrbitMode = CAMERA_CTRL_MODE_ORBIT == mCurrMode; - bool isPanMode = CAMERA_CTRL_MODE_PAN == mCurrMode; - - childSetVisible(ORBIT, isOrbitMode); - childSetVisible(PAN, isPanMode); + childSetVisible(ORBIT, CAMERA_CTRL_MODE_ORBIT == mCurrMode); + childSetVisible(PAN, CAMERA_CTRL_MODE_PAN == mCurrMode); + childSetVisible(ZOOM, CAMERA_CTRL_MODE_AVATAR_VIEW != mCurrMode); + childSetVisible(PRESETS, CAMERA_CTRL_MODE_AVATAR_VIEW == mCurrMode); //hiding or showing the panel with controls by reshaping the floater - bool showControls = isOrbitMode || isPanMode; + bool showControls = CAMERA_CTRL_MODE_FREE_CAMERA != mCurrMode; if (showControls == childIsVisible(CONTROLS)) return; childSetVisible(CONTROLS, showControls); @@ -289,29 +288,7 @@ void LLFloaterCamera::updateState() } } -//-------------LLFloaterCameraPresets------------------------ - -LLFloaterCameraPresets::LLFloaterCameraPresets(const LLSD& key): -LLTransientDockableFloater(NULL, true, key) -{} - -BOOL LLFloaterCameraPresets::postBuild() -{ - setIsChrome(TRUE); - - //build dockTongue - LLDockableFloater::postBuild(); - - LLButton *anchor_btn = LLBottomTray::getInstance()->getChild("camera_presets_btn"); - - setDockControl(new LLDockControl( - anchor_btn, this, - getDockTongue(), LLDockControl::TOP)); - return TRUE; -} - -/*static*/ -void LLFloaterCameraPresets::onClickCameraPresets(LLUICtrl* ctrl, const LLSD& param) +void LLFloaterCamera::onClickCameraPresets(const LLSD& param) { std::string name = param.asString(); @@ -327,5 +304,9 @@ void LLFloaterCameraPresets::onClickCameraPresets(LLUICtrl* ctrl, const LLSD& pa { gAgent.switchCameraPreset(CAMERA_PRESET_FRONT_VIEW); } + else if ("mouselook_view" == name) + { + gAgent.changeCameraToMouselook(); + } } -- cgit v1.2.3