summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatercamera.cpp
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2019-11-26 17:36:14 +0200
committermaxim_productengine <mnikolenko@productengine.com>2019-11-26 17:36:14 +0200
commit8d94e2af12aaf3cdb170a0b36e9ae36e91a2365d (patch)
tree63886ba607239840fe32df1586c111c2708b9312 /indra/newview/llfloatercamera.cpp
parentf4d4fb2ad0927ebb8545bac1abd1b74918a006f5 (diff)
SL-12186 Update camera controls if preset was selected from the pulldown menu
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);
}
}