summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-05-30 22:34:56 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2011-05-30 22:34:56 +0300
commit48fe54012993c095e095ed73503922275574e595 (patch)
treed6f0c089f3b03f4fc5f94fee8dae0efdb6f5a238 /indra
parent657e434fd59139436e8b97e5ecd01ca686e82269 (diff)
STORM-1253 WIP Fixed loading user day cycle on start-up; improved error handling.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterenvironmentsettings.cpp1
-rw-r--r--indra/newview/llwaterparammanager.cpp8
-rw-r--r--indra/newview/llwldaycycle.cpp2
-rw-r--r--indra/newview/llwlparammanager.cpp18
4 files changed, 25 insertions, 4 deletions
diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp
index 2149103792..9fb44521a2 100644
--- a/indra/newview/llfloaterenvironmentsettings.cpp
+++ b/indra/newview/llfloaterenvironmentsettings.cpp
@@ -70,6 +70,7 @@ BOOL LLFloaterEnvironmentSettings::postBuild()
mDayCyclePresetCombo->setCommitCallback(boost::bind(&LLFloaterEnvironmentSettings::onSelectDayCyclePreset, this));
childSetCommitCallback("ok_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnOK, this), NULL);
+ getChild<LLUICtrl>("ok_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpUserPrefs, LLEnvManagerNew::getInstance()));
childSetCommitCallback("cancel_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnCancel, this), NULL);
setCloseCallback(boost::bind(&LLFloaterEnvironmentSettings::cancel, this));
diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp
index 81d2b92647..5df807f740 100644
--- a/indra/newview/llwaterparammanager.cpp
+++ b/indra/newview/llwaterparammanager.cpp
@@ -291,7 +291,13 @@ void LLWaterParamManager::applyUserPrefs(bool interpolate)
std::string water = LLEnvManagerNew::instance().getWaterPresetName();
LL_DEBUGS("Windlight") << "Applying water preset [" << water << "]" << LL_ENDL;
LLWaterParamSet params;
- getParamSet(water, params);
+ if (!getParamSet(water, params))
+ {
+ llwarns << "No wayer preset named " << water << ", falling back to defaults" << llendl;
+ getParamSet("Default", params);
+
+ // *TODO: Fix user preferences accordingly.
+ }
target_water_params = params.getAll();
}
diff --git a/indra/newview/llwldaycycle.cpp b/indra/newview/llwldaycycle.cpp
index 91d2173d6d..8dca9c5ecb 100644
--- a/indra/newview/llwldaycycle.cpp
+++ b/indra/newview/llwldaycycle.cpp
@@ -97,7 +97,7 @@ void LLWLDayCycle::loadDayCycleFromFile(const std::string & fileName)
/*static*/ LLSD LLWLDayCycle::loadCycleDataFromFile(const std::string & fileName)
{
- // now load the file
+ // *FIX: Cannot load user day cycles.
std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,
"windlight/days", fileName));
diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp
index db81c3ead7..eb49f2b018 100644
--- a/indra/newview/llwlparammanager.cpp
+++ b/indra/newview/llwlparammanager.cpp
@@ -776,11 +776,25 @@ void LLWLParamManager::initSingleton()
loadPresets(LLStringUtil::null);
// load the day
- mDay.loadDayCycleFromFile(LLEnvManagerNew::instance().getDayCycleName() + ".xml");
+ std::string preferred_day = LLEnvManagerNew::instance().getDayCycleName();
+ if (!LLDayCycleManager::instance().getPreset(preferred_day, mDay))
+ {
+ // Fall back to default.
+ llwarns << "No day cycle named " << preferred_day << ", falling back to defaults" << llendl;
+ mDay.loadDayCycleFromFile("Default.xml");
+
+ // *TODO: Fix user preferences accordingly.
+ }
// *HACK - sets cloud scrolling to what we want... fix this better in the future
std::string sky = LLEnvManagerNew::instance().getSkyPresetName();
- getParamSet(LLWLParamKey(sky, LLWLParamKey::SCOPE_LOCAL), mCurParams);
+ if (!getParamSet(LLWLParamKey(sky, LLWLParamKey::SCOPE_LOCAL), mCurParams))
+ {
+ llwarns << "No sky preset named " << sky << ", falling back to defaults" << llendl;
+ getParamSet(LLWLParamKey("Default", LLWLParamKey::SCOPE_LOCAL), mCurParams);
+
+ // *TODO: Fix user preferences accordingly.
+ }
// set it to noon
resetAnimator(0.5, LLEnvManagerNew::instance().getUseDayCycle());