diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-06-10 21:21:04 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-06-10 21:21:04 +0300 |
commit | 23d8fb9750afc158d97fdf51633ed59b1b36f223 (patch) | |
tree | e30354ea174daea3eed32339a1bae48a3d9a5610 /indra/newview/llfloatereditwater.cpp | |
parent | 150c18169de8b7155658e676b86014716f62aeed (diff) |
STORM-1305 WIP User water presets now go first in all lists.
Besides, removed all cases of direct access to the water presets map in preparation for future lazy loading.
Diffstat (limited to 'indra/newview/llfloatereditwater.cpp')
-rw-r--r-- | indra/newview/llfloatereditwater.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/indra/newview/llfloatereditwater.cpp b/indra/newview/llfloatereditwater.cpp index e8c20f5932..64cfc4054f 100644 --- a/indra/newview/llfloatereditwater.cpp +++ b/indra/newview/llfloatereditwater.cpp @@ -507,11 +507,26 @@ void LLFloaterEditWater::refreshWaterPresetsList() } #endif - // Add local water presets. - const LLWaterParamManager::preset_map_t &water_params_map = LLWaterParamManager::instance().getPresets(); - for (LLWaterParamManager::preset_map_t::const_iterator it = water_params_map.begin(); it != water_params_map.end(); it++) + std::list<std::string> user_presets, system_presets; + LLWaterParamManager::instance().getPresetNames(user_presets, system_presets); + + // Add local user presets first. + for (std::list<std::string>::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) + { + const std::string& name = *it; + mWaterPresetCombo->add(name, LLSD().with(0, name).with(1, LLEnvKey::SCOPE_LOCAL)); // [<name>, <scope>] + } + + if (user_presets.size() > 0) + { + mWaterPresetCombo->addSeparator(); + } + + // Add local system presets. + for (std::list<std::string>::const_iterator it = system_presets.begin(); it != system_presets.end(); ++it) { - mWaterPresetCombo->add(it->first, LLSD().with(0, it->first).with(1, LLEnvKey::SCOPE_LOCAL)); + const std::string& name = *it; + mWaterPresetCombo->add(name, LLSD().with(0, name).with(1, LLEnvKey::SCOPE_LOCAL)); // [<name>, <scope>] } mWaterPresetCombo->setLabel(getString("combo_label")); |