diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a0c0f15b88..b281066e7d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -21448,6 +21448,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSEnvironmentManualTransitionTime + + Comment + Timespan for blending between day/water/sky settings when manually changed. 0 is immediate. + Persist + 1 + Type + F32 + Value + 0.0 + FSDisableAvatarTrackerAtCloseIn Comment diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index a850d1bbda..d818c454ab 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -1283,12 +1283,33 @@ void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, S3 setEnvironment(env, assetId, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); } - -void LLEnvironment::setEnvironment(EnvSelection_t env, - const LLUUID &assetId, - LLSettingsDay::Seconds daylength, - LLSettingsDay::Seconds dayoffset, - S32 env_version) +// FIRE-29926 - allow manually selected environments to have a user defined transition time. +void LLEnvironment::setManualEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version) +{ + LLSettingsBase::Seconds transitionTime(static_cast(gSavedSettings.getF32("FSEnvironmentManualTransitionTime"))); + setEnvironmentWithTransition(env, assetId, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, transitionTime); +} +void LLEnvironment::setEnvironmentWithTransition( + EnvSelection_t env, + const LLUUID &assetId, + LLSettingsDay::Seconds daylength, + LLSettingsDay::Seconds dayoffset, + LLSettingsBase::Seconds transition, + S32 env_version) +{ + LLSettingsVOBase::getSettingsAsset(assetId, + [this, env, daylength, dayoffset, transition, env_version](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) + { + onSetEnvAssetLoaded(env, asset_id, settings, daylength, dayoffset, transition, status, env_version); + }); +} +// +void LLEnvironment::setEnvironment( + EnvSelection_t env, + const LLUUID &assetId, + LLSettingsDay::Seconds daylength, + LLSettingsDay::Seconds dayoffset, + S32 env_version) { LLSettingsVOBase::getSettingsAsset(assetId, [this, env, daylength, dayoffset, env_version](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index bbd0adaca8..a974e3893c 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -145,6 +145,10 @@ public: void setEnvironment(EnvSelection_t env, const LLSettingsWater::ptr_t & fixed, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(LLSettingsSky::ptr_t(), fixed), env_version); } void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixeds, const LLSettingsWater::ptr_t & fixedw, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(fixeds, fixedw), env_version); } void setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, S32 env_version = NO_VERSION); + // FIRE-29926 - Allow configurable transition times + void setEnvironmentWithTransition(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 env_version = NO_VERSION); + void setManualEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version = NO_VERSION); + // void setEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version = NO_VERSION); void setSharedEnvironment(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 74d5277ce9..f18e75d948 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -10800,28 +10800,40 @@ class LLWorldEnvSettings : public view_listener_t if (event_name == "sunrise") { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE); + // FIRE-29926 - allow manually selected environments to have a user defined transition time. + // LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE); + LLEnvironment::instance().setManualEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE); + // LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); LLEnvironment::instance().updateEnvironment(); defocusEnvFloaters(); } else if (event_name == "noon") { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDDAY); + // FIRE-29926 - allow manually selected environments to have a user defined transition time. + // LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDDAY); + LLEnvironment::instance().setManualEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDDAY); + // LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); LLEnvironment::instance().updateEnvironment(); defocusEnvFloaters(); } else if (event_name == "sunset") { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET); + // FIRE-29926 - allow manually selected environments to have a user defined transition time. + // LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET); + LLEnvironment::instance().setManualEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET); + // LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); LLEnvironment::instance().updateEnvironment(); defocusEnvFloaters(); } else if (event_name == "midnight") { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDNIGHT); + // FIRE-29926 - allow manually selected environments to have a user defined transition time. + // LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDNIGHT); + LLEnvironment::instance().setManualEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDNIGHT); + // LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); LLEnvironment::instance().updateEnvironment(); defocusEnvFloaters(); diff --git a/indra/newview/quickprefs.cpp b/indra/newview/quickprefs.cpp index 6334549f51..75c9b7e893 100644 --- a/indra/newview/quickprefs.cpp +++ b/indra/newview/quickprefs.cpp @@ -827,6 +827,8 @@ void FloaterQuickPrefs::selectSkyPreset(const LLSD& preset) // Need to preserve current sky manually in this case in contrast to asset-based settings LLSettingsWater::ptr_t current_water = LLEnvironment::instance().getCurrentWater(); LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, legacy_sky, current_water); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().updateEnvironment(static_cast(gSavedSettings.getF32("FSEnvironmentManualTransitionTime"))); } else { @@ -837,10 +839,10 @@ void FloaterQuickPrefs::selectSkyPreset(const LLSD& preset) else // note the else here bridges the endif #endif { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, preset.asUUID()); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().setManualEnvironment(LLEnvironment::ENV_LOCAL, preset.asUUID()); } - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); - LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); + // LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST); } void FloaterQuickPrefs::selectWaterPreset(const LLSD& preset) @@ -856,6 +858,8 @@ void FloaterQuickPrefs::selectWaterPreset(const LLSD& preset) // Need to preserve current sky manually in this case in contrast to asset-based settings LLSettingsSky::ptr_t current_sky = LLEnvironment::instance().getCurrentSky(); LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, current_sky, legacy_water); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().updateEnvironment(static_cast(gSavedSettings.getF32("FSEnvironmentManualTransitionTime"))); } else { @@ -866,10 +870,9 @@ void FloaterQuickPrefs::selectWaterPreset(const LLSD& preset) else // beware the trailing else here. #endif { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, preset.asUUID()); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().setManualEnvironment(LLEnvironment::ENV_LOCAL, preset.asUUID()); } - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); - LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); } void FloaterQuickPrefs::selectDayCyclePreset(const LLSD& preset) @@ -883,6 +886,8 @@ void FloaterQuickPrefs::selectDayCyclePreset(const LLSD& preset) if (legacyday) { LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, legacyday); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().updateEnvironment(static_cast(gSavedSettings.getF32("FSEnvironmentManualTransitionTime"))); } else { @@ -893,10 +898,9 @@ void FloaterQuickPrefs::selectDayCyclePreset(const LLSD& preset) else // beware trailing else that bridges the endif #endif { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, preset.asUUID()); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().setManualEnvironment(LLEnvironment::ENV_LOCAL, preset.asUUID()); } - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); - LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); } void FloaterQuickPrefs::onChangeWaterPreset() diff --git a/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml index 4cfb76e4c3..148ae17cd6 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml @@ -182,7 +182,22 @@ name="flight_extreme" value="15.0" /> - +