aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llwindlightremotectrl.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-09-13 20:26:02 -0700
committerMcCabe Maxsted2009-09-13 20:26:02 -0700
commit162ac8865cb927c561283da696570dcd68490c67 (patch)
tree46fc91ae7a03fadbb03afa5d87f15f6986f044b9 /linden/indra/newview/llwindlightremotectrl.cpp
parentFixed windlight toolbar presets not applying when region default (diff)
downloadmeta-impy-162ac8865cb927c561283da696570dcd68490c67.zip
meta-impy-162ac8865cb927c561283da696570dcd68490c67.tar.gz
meta-impy-162ac8865cb927c561283da696570dcd68490c67.tar.bz2
meta-impy-162ac8865cb927c561283da696570dcd68490c67.tar.xz
Added prev/next buttons for windlight presets, cleaned up some stuff
Diffstat (limited to 'linden/indra/newview/llwindlightremotectrl.cpp')
-rw-r--r--linden/indra/newview/llwindlightremotectrl.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/linden/indra/newview/llwindlightremotectrl.cpp b/linden/indra/newview/llwindlightremotectrl.cpp
index ca411c5..591b413 100644
--- a/linden/indra/newview/llwindlightremotectrl.cpp
+++ b/linden/indra/newview/llwindlightremotectrl.cpp
@@ -92,11 +92,11 @@ void LLWindlightRemoteCtrl::build()
92{ 92{
93 if (gSavedSettings.getBOOL("ShowWindlightSettingsPopup")) 93 if (gSavedSettings.getBOOL("ShowWindlightSettingsPopup"))
94 { 94 {
95 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_windlight_remote_expanded.xml"/*, &getFactoryMap()*/); 95 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_windlight_remote_expanded.xml");
96 } 96 }
97 else 97 else
98 { 98 {
99 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_windlight_remote.xml"/*, &getFactoryMap()*/); 99 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_windlight_remote.xml");
100 } 100 }
101} 101}
102 102
@@ -128,14 +128,15 @@ void LLWindlightRemoteCtrl::refreshPresets()
128 if (mPresetsCombo) 128 if (mPresetsCombo)
129 { 129 {
130 // snag current preset 130 // snag current preset
131 std::string cur_preset = LLWLParamManager::instance()->mCurPresetName;//mPresetsCombo->getValue().asString(); 131 LLWLParamManager * param_mgr = LLWLParamManager::instance();
132 LLWLParamSet& currentParams = param_mgr->mCurParams;
132 133
133 // clear in case presets names have changed 134 // clear in case presets names have changed
134 mPresetsCombo->clearRows(); 135 mPresetsCombo->clearRows();
135 136
136 std::map<std::string, LLWLParamSet>::iterator mIt = 137 std::map<std::string, LLWLParamSet>::iterator mIt =
137 LLWLParamManager::instance()->mParamList.begin(); 138 param_mgr->mParamList.begin();
138 for(; mIt != LLWLParamManager::instance()->mParamList.end(); mIt++) 139 for(; mIt != param_mgr->mParamList.end(); mIt++)
139 { 140 {
140 mPresetsCombo->add(mIt->first); 141 mPresetsCombo->add(mIt->first);
141 } 142 }
@@ -148,9 +149,10 @@ void LLWindlightRemoteCtrl::refreshPresets()
148 mPresetsCombo->addSimpleElement(getString("midnight"), ADD_BOTTOM); 149 mPresetsCombo->addSimpleElement(getString("midnight"), ADD_BOTTOM);
149 mPresetsCombo->addSimpleElement(getString("revert_region"), ADD_BOTTOM); 150 mPresetsCombo->addSimpleElement(getString("revert_region"), ADD_BOTTOM);
150 151
151 if (!cur_preset.empty()) 152 if (mPresetsCombo->getSelectedItemLabel() != currentParams.mName &&
153 !currentParams.mName.empty())
152 { 154 {
153 mPresetsCombo->selectByValue(LLSD(cur_preset)); 155 mPresetsCombo->selectByValue(LLSD(currentParams.mName));
154 } 156 }
155 else 157 else
156 { 158 {