diff options
Diffstat (limited to 'indra/newview/llenvmanager.cpp')
-rw-r--r-- | indra/newview/llenvmanager.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp index dfec6c4b9d..bc1e0f8b14 100644 --- a/indra/newview/llenvmanager.cpp +++ b/indra/newview/llenvmanager.cpp @@ -82,6 +82,7 @@ void LLEnvManager::changedRegion(bool interp) mInterpNextChangeMessage = interp; mPendingOutgoingMessage = false; + LLFloaterReg::hideInstance("old_env_settings"); LLFloaterReg::hideInstance("env_settings"); resetInternalsToDefault(LLEnvKey::SCOPE_REGION); @@ -733,6 +734,25 @@ void LLEnvManagerNew::saveUserPrefs() gSavedSettings.setBOOL("UseDayCycle", getUseDayCycle()); } +void LLEnvManagerNew::setUserPrefs( + const std::string& water_preset, + const std::string& sky_preset, + const std::string& day_cycle_preset, + bool use_fixed_sky, + bool use_region_settings) +{ + // operate on members directly to avoid side effects + mUserPrefs.mWaterPresetName = water_preset; + mUserPrefs.mSkyPresetName = sky_preset; + mUserPrefs.mDayCycleName = day_cycle_preset; + + mUserPrefs.mUseDefaults = use_region_settings; + mUserPrefs.mUseDayCycle = !use_fixed_sky; + + saveUserPrefs(); + updateManagersFromPrefs(false); +} + void LLEnvManagerNew::dumpUserPrefs() { LL_DEBUGS("Windlight") << "WaterPresetName: " << gSavedSettings.getString("WaterPresetName") << LL_ENDL; |