summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterregioninfo.cpp
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-05-26 15:11:01 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2011-05-26 15:11:01 +0300
commitc32b19f31d4d5d0b32fcf64cce1cebd7d79b9b05 (patch)
treefa4b051500577f346e80f647c454a900190c5ad7 /indra/newview/llfloaterregioninfo.cpp
parent72d1efb1529ad0863d35b219a461f353a4b19353 (diff)
STORM-1253 WIP Implemented switching between multiple day cycles (locally and region-wide).
Diffstat (limited to 'indra/newview/llfloaterregioninfo.cpp')
-rw-r--r--indra/newview/llfloaterregioninfo.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index ff34e21c2f..6a5b577396 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -52,6 +52,7 @@
#include "llbutton.h"
#include "llcheckboxctrl.h"
#include "llcombobox.h"
+#include "lldaycyclemanager.h"
#include "llenvmanager.h"
#include "llfilepicker.h"
#include "llfloaterdaycycle.h"
@@ -3350,14 +3351,18 @@ void LLPanelEnvironmentInfo::populateDayCyclesList()
llassert(region != NULL);
LLWLParamKey key(region->getName(), LLEnvKey::SCOPE_REGION);
- mDayCyclePresetCombo->add(region->getName(), key.toLLSD());
+ mDayCyclePresetCombo->add(region->getName(), key.toStringVal());
mDayCyclePresetCombo->addSeparator();
}
// Add local day cycles.
- // *TODO: multiple local day cycles support
- LLWLParamKey key("Default", LLEnvKey::SCOPE_LOCAL);
- mDayCyclePresetCombo->add("Default", key.toLLSD());
+ const LLDayCycleManager::dc_map_t& map = LLDayCycleManager::instance().getPresets();
+ for (LLDayCycleManager::dc_map_t::const_iterator it = map.begin(); it != map.end(); ++it)
+ {
+ std::string name = it->first;
+ LLWLParamKey key(name, LLEnvKey::SCOPE_LOCAL);
+ mDayCyclePresetCombo->add(name, key.toStringVal());
+ }
// Current day cycle is already selected.
}
@@ -3421,7 +3426,8 @@ void LLPanelEnvironmentInfo::onBtnSave()
}
else // use day cycle
{
- LLWLParamKey dc(mDayCyclePresetCombo->getValue());
+ std::string preset_key(mDayCyclePresetCombo->getValue().asString());
+ LLWLParamKey dc(preset_key);
LL_DEBUGS("Windlight") << "Use day cycle: " << dc.toLLSD() << LL_ENDL;
if (dc.scope == LLEnvKey::SCOPE_REGION) // current region day cycle
@@ -3431,8 +3437,11 @@ void LLPanelEnvironmentInfo::onBtnSave()
}
else // a local day cycle
{
- // *TODO: multiple local day cycles support
- day_cycle = LLEnvManagerNew::instance().getDayCycleByName("Default");
+ if (!LLDayCycleManager::instance().getPreset(dc.name, day_cycle))
+ {
+ llwarns << "Error getting day cycle " << dc.name << llendl;
+ return;
+ }
// Create sky map from the day cycle.
{