From 23d8fb9750afc158d97fdf51633ed59b1b36f223 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 10 Jun 2011 21:21:04 +0300 Subject: 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. --- indra/newview/llfloatereditwater.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloatereditwater.cpp') 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 user_presets, system_presets; + LLWaterParamManager::instance().getPresetNames(user_presets, system_presets); + + // Add local user presets first. + for (std::list::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)); // [, ] + } + + if (user_presets.size() > 0) + { + mWaterPresetCombo->addSeparator(); + } + + // Add local system presets. + for (std::list::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)); // [, ] } mWaterPresetCombo->setLabel(getString("combo_label")); -- cgit v1.2.3