summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatercamera.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloatercamera.cpp')
-rw-r--r--indra/newview/llfloatercamera.cpp45
1 files changed, 26 insertions, 19 deletions
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp
index c7eb60e186..d3c1ba764b 100644
--- a/indra/newview/llfloatercamera.cpp
+++ b/indra/newview/llfloatercamera.cpp
@@ -524,7 +524,11 @@ void LLFloaterCamera::onClickCameraItem(const LLSD& param)
{
LLFloaterCamera* camera_floater = LLFloaterCamera::findInstance();
if (camera_floater)
- camera_floater->switchMode(CAMERA_CTRL_MODE_FREE_CAMERA);
+ {
+ camera_floater->switchMode(CAMERA_CTRL_MODE_FREE_CAMERA);
+ camera_floater->updateItemsSelection();
+ camera_floater->fromFreeToPresets();
+ }
}
else
{
@@ -533,13 +537,6 @@ void LLFloaterCamera::onClickCameraItem(const LLSD& param)
camera_floater->switchMode(CAMERA_CTRL_MODE_PAN);
switchToPreset(name);
}
-
- LLFloaterCamera* camera_floater = LLFloaterCamera::findInstance();
- if (camera_floater)
- {
- camera_floater->updateItemsSelection();
- camera_floater->fromFreeToPresets();
- }
}
/*static*/
@@ -547,20 +544,33 @@ void LLFloaterCamera::switchToPreset(const std::string& name)
{
sFreeCamera = false;
clear_camera_tool();
- if ("rear_view" == name)
+ if (PRESETS_REAR_VIEW == name)
{
gAgentCamera.switchCameraPreset(CAMERA_PRESET_REAR_VIEW);
- LLPresetsManager::getInstance()->loadPreset(PRESETS_CAMERA, PRESETS_REAR_VIEW);
}
- else if ("group_view" == name)
+ else if (PRESETS_SIDE_VIEW == name)
{
gAgentCamera.switchCameraPreset(CAMERA_PRESET_GROUP_VIEW);
- LLPresetsManager::getInstance()->loadPreset(PRESETS_CAMERA, PRESETS_SIDE_VIEW);
}
- else if ("front_view" == name)
+ else if (PRESETS_FRONT_VIEW == name)
{
gAgentCamera.switchCameraPreset(CAMERA_PRESET_FRONT_VIEW);
- LLPresetsManager::getInstance()->loadPreset(PRESETS_CAMERA, PRESETS_FRONT_VIEW);
+ }
+ else
+ {
+ gAgentCamera.switchCameraPreset(CAMERA_PRESET_CUSTOM);
+ }
+
+ if (gSavedSettings.getString("PresetCameraActive") != name)
+ {
+ LLPresetsManager::getInstance()->loadPreset(PRESETS_CAMERA, name);
+ }
+
+ LLFloaterCamera* camera_floater = LLFloaterCamera::findInstance();
+ if (camera_floater)
+ {
+ camera_floater->updateItemsSelection();
+ camera_floater->fromFreeToPresets();
}
}
@@ -609,11 +619,8 @@ void LLFloaterCamera::onSavePreset()
void LLFloaterCamera::onCustomPresetSelected()
{
std::string selected_preset = mPresetCombo->getSelectedItemLabel();
- if (gSavedSettings.getString("PresetCameraActive") != selected_preset && getString("inactive_combo_text") != selected_preset)
+ if (getString("inactive_combo_text") != selected_preset)
{
- gAgentCamera.switchCameraPreset(CAMERA_PRESET_CUSTOM);
- updateItemsSelection();
- fromFreeToPresets();
- LLPresetsManager::getInstance()->loadPreset(PRESETS_CAMERA, selected_preset);
+ switchToPreset(selected_preset);
}
}