summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatercamera.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-10-23 17:20:45 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-10-23 17:20:45 +0000
commitb43771cad585cb9820941eb1b24b67390eaa9435 (patch)
tree322e5f94a1fa473ad4e8c0b343974a72e824f66a /indra/newview/llfloatercamera.cpp
parent0220106ecdecd323854522a5bc3fd6455c60fdfc (diff)
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
Diffstat (limited to 'indra/newview/llfloatercamera.cpp')
-rw-r--r--indra/newview/llfloatercamera.cpp45
1 files changed, 13 insertions, 32 deletions
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<LLJoystickCameraRotate>(ORBIT);
- mZoom = getChild<LLJoystickCameraZoom>("zoom");
+ mZoom = getChild<LLJoystickCameraZoom>(ZOOM);
mTrack = getChild<LLJoystickCameraTrack>(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<LLButton>("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();
+ }
}