diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-06-10 23:44:13 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-06-10 23:44:13 +0300 |
commit | 4fd946fa3e5217b8f64e0fcd91d268c7eaf1bbf5 (patch) | |
tree | e5c810ecd44990bce20ff502bce4df08976b80f1 /indra/newview/llfloatereditdaycycle.cpp | |
parent | 23d8fb9750afc158d97fdf51633ed59b1b36f223 (diff) |
STORM-1305 WIP User sky presets now go first in all lists.
Diffstat (limited to 'indra/newview/llfloatereditdaycycle.cpp')
-rw-r--r-- | indra/newview/llfloatereditdaycycle.cpp | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/indra/newview/llfloatereditdaycycle.cpp b/indra/newview/llfloatereditdaycycle.cpp index 2cbe889322..4f4739384d 100644 --- a/indra/newview/llfloatereditdaycycle.cpp +++ b/indra/newview/llfloatereditdaycycle.cpp @@ -230,24 +230,41 @@ void LLFloaterEditDayCycle::refreshSkyPresetsList() mSkyPresetsCombo->removeall(); - LLWLParamManager& sky_mgr = LLWLParamManager::instance(); - for (std::map<LLWLParamKey, LLWLParamSet>::iterator it = sky_mgr.mParamList.begin(); - it != sky_mgr.mParamList.end(); ++it) - { - const LLWLParamKey& key = it->first; + LLWLParamManager::preset_name_list_t region_presets; + LLWLParamManager::preset_name_list_t user_presets, sys_presets; + LLWLParamManager::instance().getPresetNames(region_presets, user_presets, sys_presets); - std::string item_title = key.name; - if (key.scope == LLEnvKey::SCOPE_REGION) + if (include_region_skies) + { + // Add region presets. + for (LLWLParamManager::preset_name_list_t::const_iterator it = region_presets.begin(); it != region_presets.end(); ++it) { - if (!include_region_skies) - { - continue; - } + std::string preset_name = *it; + std::string item_title = preset_name + " (" + getRegionName() + ")"; + mSkyPresetsCombo->add(preset_name, LLWLParamKey(*it, LLEnvKey::SCOPE_REGION).toStringVal()); + } - item_title += " (" + getRegionName() + ")"; + if (!region_presets.empty()) + { + mSkyPresetsCombo->addSeparator(); } + } + + // Add user presets. + for (LLWLParamManager::preset_name_list_t::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) + { + mSkyPresetsCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal()); + } + + if (!user_presets.empty()) + { + mSkyPresetsCombo->addSeparator(); + } - mSkyPresetsCombo->add(item_title, LLSD(key.toStringVal())); + // Add system presets. + for (LLWLParamManager::preset_name_list_t::const_iterator it = sys_presets.begin(); it != sys_presets.end(); ++it) + { + mSkyPresetsCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal()); } // set defaults on combo boxes |