diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-02-26 13:13:26 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-02-26 13:13:26 -0500 |
commit | 3b52ab6cf17ceae4a2d45a8477b8643a9e3c6162 (patch) | |
tree | 58491dbe94278921244e05927d0d58b580304646 /indra/newview/llfloatercamera.cpp | |
parent | 27c83bf399f2ca91f0444aa97a98af00a2483c30 (diff) | |
parent | 470c05b70808f0a51090c0f50847fe614bf041e9 (diff) |
merge
Diffstat (limited to 'indra/newview/llfloatercamera.cpp')
-rw-r--r-- | indra/newview/llfloatercamera.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index ecb6254f8a..d0188352c7 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -241,6 +241,7 @@ LLFloaterCamera::LLFloaterCamera(const LLSD& val) BOOL LLFloaterCamera::postBuild() { setIsChrome(TRUE); + setTitleVisible(TRUE); // restore title visibility after chrome applying mRotate = getChild<LLJoystickCameraRotate>(ORBIT); mZoom = getChild<LLPanelCameraZoom>(ZOOM); @@ -295,6 +296,31 @@ void LLFloaterCamera::setMode(ECameraControlMode mode) updateState(); } +void LLFloaterCamera::setModeTitle(const ECameraControlMode mode) +{ + std::string title; + switch(mode) + { + case CAMERA_CTRL_MODE_ORBIT: + title = getString("orbit_mode_title"); + break; + case CAMERA_CTRL_MODE_PAN: + title = getString("pan_mode_title"); + break; + case CAMERA_CTRL_MODE_AVATAR_VIEW: + title = getString("avatar_view_mode_title"); + break; + case CAMERA_CTRL_MODE_FREE_CAMERA: + title = getString("free_mode_title"); + break; + default: + // title should be provided for all modes + llassert(false); + break; + } + setTitle(title); +} + void LLFloaterCamera::switchMode(ECameraControlMode mode) { setMode(mode); @@ -354,6 +380,10 @@ void LLFloaterCamera::updateState() childSetVisible(ZOOM, CAMERA_CTRL_MODE_AVATAR_VIEW != mCurrMode); childSetVisible(PRESETS, CAMERA_CTRL_MODE_AVATAR_VIEW == mCurrMode); + updateCameraPresetButtons(); + setModeTitle(mCurrMode); + + //hiding or showing the panel with controls by reshaping the floater bool showControls = CAMERA_CTRL_MODE_FREE_CAMERA != mCurrMode; if (showControls == childIsVisible(CONTROLS)) return; @@ -384,6 +414,16 @@ void LLFloaterCamera::updateState() } } +void LLFloaterCamera::updateCameraPresetButtons() +{ + ECameraPreset preset = (ECameraPreset) gSavedSettings.getU32("CameraPreset"); + + childSetValue("rear_view", preset == CAMERA_PRESET_REAR_VIEW); + childSetValue("group_view", preset == CAMERA_PRESET_GROUP_VIEW); + childSetValue("front_view", preset == CAMERA_PRESET_FRONT_VIEW); + childSetValue("mouselook_view", gAgent.cameraMouselook()); +} + void LLFloaterCamera::onClickCameraPresets(const LLSD& param) { std::string name = param.asString(); @@ -405,4 +445,7 @@ void LLFloaterCamera::onClickCameraPresets(const LLSD& param) gAgent.changeCameraToMouselook(); } + LLFloaterCamera* camera_floater = LLFloaterCamera::findInstance(); + if (camera_floater) + camera_floater->updateCameraPresetButtons(); } |