diff options
-rw-r--r-- | indra/newview/llfloatercamera.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llfloatercamera.h | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_camera.xml | 4 |
3 files changed, 22 insertions, 0 deletions
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index ecb6254f8a..abf60a29b4 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -354,6 +354,8 @@ void LLFloaterCamera::updateState() childSetVisible(ZOOM, CAMERA_CTRL_MODE_AVATAR_VIEW != mCurrMode); childSetVisible(PRESETS, CAMERA_CTRL_MODE_AVATAR_VIEW == mCurrMode); + updateCameraPresetButtons(); + //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 +386,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 +417,7 @@ void LLFloaterCamera::onClickCameraPresets(const LLSD& param) gAgent.changeCameraToMouselook(); } + LLFloaterCamera* camera_floater = LLFloaterCamera::findInstance(); + if (camera_floater) + camera_floater->updateCameraPresetButtons(); } diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index 45d5e9a845..f908ad08be 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -103,6 +103,9 @@ private: /* updates the state (UI) according to the current mode */ void updateState(); + /* update camera preset buttons toggle state according to the currently selected preset */ + void updateCameraPresetButtons(); + void onClickBtn(ECameraControlMode mode); void assignButton2Mode(ECameraControlMode mode, const std::string& button_name); diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml index 1b8bbe42d2..f69c763f78 100644 --- a/indra/newview/skins/default/xui/en/floater_camera.xml +++ b/indra/newview/skins/default/xui/en/floater_camera.xml @@ -132,6 +132,7 @@ height="40" image_selected="Cam_Preset_Back_On" image_unselected="Cam_Preset_Back_Off" + is_toggle="true" layout="topleft" left="0" name="rear_view" @@ -146,6 +147,7 @@ height="40" image_selected="Cam_Preset_Side_On" image_unselected="Cam_Preset_Side_Off" + is_toggle="true" layout="topleft" left_pad="5" name="group_view" @@ -160,6 +162,7 @@ height="40" image_selected="Cam_Preset_Front_On" image_unselected="Cam_Preset_Front_Off" + is_toggle="true" layout="topleft" left="0" name="front_view" @@ -174,6 +177,7 @@ height="40" image_selected="Cam_Preset_Eye_Off" image_unselected="Cam_Preset_Eye_Off" + is_toggle="true" layout="topleft" left_pad="5" name="mouselook_view" |