summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatercamerapresets.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-08-23 22:28:01 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-08-23 22:28:01 +0300
commitd08859f3f4ba8ed68d018fba033b652926d1bf6b (patch)
treefd62430b9a2987ca2eab8a8f08114f113de84120 /indra/newview/llfloatercamerapresets.cpp
parentf40b85c4f495b9079991c41a26b76d397a6168ae (diff)
parentd454512050e636a19e4b7545515dea4f4b1bbf0d (diff)
Merge branch 'main' into DRTVWR-587-maint-V
# Conflicts: # autobuild.xml
Diffstat (limited to 'indra/newview/llfloatercamerapresets.cpp')
-rw-r--r--indra/newview/llfloatercamerapresets.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/newview/llfloatercamerapresets.cpp b/indra/newview/llfloatercamerapresets.cpp
index 300c945a85..a1cbffd094 100644
--- a/indra/newview/llfloatercamerapresets.cpp
+++ b/indra/newview/llfloatercamerapresets.cpp
@@ -24,6 +24,7 @@
*/
#include "llviewerprecompiledheaders.h"
+#include "llfloatercamera.h"
#include "llfloatercamerapresets.h"
#include "llfloaterreg.h"
#include "llnotificationsutil.h"
@@ -40,7 +41,8 @@ LLFloaterCameraPresets::~LLFloaterCameraPresets()
BOOL LLFloaterCameraPresets::postBuild()
{
mPresetList = getChild<LLFlatListView>("preset_list");
-
+ mPresetList->setCommitCallback(boost::bind(&LLFloaterCameraPresets::onSelectionChange, this));
+ mPresetList->setCommitOnSelectionChange(true);
LLPresetsManager::getInstance()->setPresetListChangeCameraCallback(boost::bind(&LLFloaterCameraPresets::populateList, this));
return TRUE;
@@ -58,6 +60,7 @@ void LLFloaterCameraPresets::populateList()
std::list<std::string> preset_names;
presetsMgr->loadPresetNamesFromDir(PRESETS_CAMERA, preset_names, DEFAULT_BOTTOM);
+ std::string active_preset = gSavedSettings.getString("PresetCameraActive");
for (std::list<std::string>::const_iterator it = preset_names.begin(); it != preset_names.end(); ++it)
{
@@ -66,6 +69,19 @@ void LLFloaterCameraPresets::populateList()
LLCameraPresetFlatItem* item = new LLCameraPresetFlatItem(name, is_default);
item->postBuild();
mPresetList->addItem(item);
+ if(name == active_preset)
+ {
+ mPresetList->selectItem(item);
+ }
+ }
+}
+
+void LLFloaterCameraPresets::onSelectionChange()
+{
+ LLCameraPresetFlatItem* selected_preset = dynamic_cast<LLCameraPresetFlatItem*>(mPresetList->getSelectedItem());
+ if(selected_preset)
+ {
+ LLFloaterCamera::switchToPreset(selected_preset->getPresetName());
}
}