summaryrefslogtreecommitdiff
path: root/indra/newview
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
parentf4d4fb2ad0927ebb8545bac1abd1b74918a006f5 (diff)
SL-12186 Update camera controls if preset was selected from the pulldown menu
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloatercamera.cpp45
-rw-r--r--indra/newview/llpanelpresetscamerapulldown.cpp3
-rw-r--r--indra/newview/skins/default/xui/en/floater_camera.xml6
3 files changed, 31 insertions, 23 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);
}
}
diff --git a/indra/newview/llpanelpresetscamerapulldown.cpp b/indra/newview/llpanelpresetscamerapulldown.cpp
index 1ac105e1c8..ae3d182f09 100644
--- a/indra/newview/llpanelpresetscamerapulldown.cpp
+++ b/indra/newview/llpanelpresetscamerapulldown.cpp
@@ -33,6 +33,7 @@
#include "llbutton.h"
#include "lltabcontainer.h"
+#include "llfloatercamera.h"
#include "llfloaterreg.h"
#include "llfloaterpreference.h"
#include "llpresetsmanager.h"
@@ -185,7 +186,7 @@ void LLPanelPresetsCameraPulldown::onRowClick(const LLSD& user_data)
std::string name = item->getColumn(1)->getValue().asString();
LL_DEBUGS() << "selected '" << name << "'" << LL_ENDL;
- LLPresetsManager::getInstance()->loadPreset(PRESETS_CAMERA, name);
+ LLFloaterCamera::switchToPreset(name);
setVisible(FALSE);
}
diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml
index 9408e68c2d..60461c5743 100644
--- a/indra/newview/skins/default/xui/en/floater_camera.xml
+++ b/indra/newview/skins/default/xui/en/floater_camera.xml
@@ -151,7 +151,7 @@
width="30">
<panel_camera_item.mousedown_callback
function="CameraPresets.ChangeView"
- parameter="front_view" />
+ parameter="Front View" />
<panel_camera_item.picture
image_name="Cam_Preset_Front_Off" />
<panel_camera_item.selected_picture
@@ -164,7 +164,7 @@
left_pad="4">
<panel_camera_item.mousedown_callback
function="CameraPresets.ChangeView"
- parameter="group_view" />
+ parameter="Side View" />
<panel_camera_item.picture
image_name="Cam_Preset_Side_Off" />
<panel_camera_item.selected_picture
@@ -178,7 +178,7 @@
<panel_camera_item.mousedown_callback
function="CameraPresets.ChangeView"
tool_tip="Rear View"
- parameter="rear_view" />
+ parameter="Rear View" />
<panel_camera_item.picture
image_name="Cam_Preset_Back_Off" />
<panel_camera_item.selected_picture