FIRE-29926 - Transition time for manual Env change

master
Beq 2020-08-16 14:59:58 +01:00
parent 46bd337096
commit f5cf69ee1d
6 changed files with 87 additions and 20 deletions

View File

@ -21448,6 +21448,17 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>0</integer>
</map>
<key>FSEnvironmentManualTransitionTime</key>
<map>
<key>Comment</key>
<string>Timespan for blending between day/water/sky settings when manually changed. 0 is immediate.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>0.0</real>
</map>
<key>FSDisableAvatarTrackerAtCloseIn</key>
<map>
<key>Comment</key>

View File

@ -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)
// <FS:Beq> 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<F64>(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);
});
}
// </FS:Beq>
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)

View File

@ -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);
// <FS:Beq> 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);
// </FS:Beq>
void setEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version = NO_VERSION);
void setSharedEnvironment();

View File

@ -10800,28 +10800,40 @@ class LLWorldEnvSettings : public view_listener_t
if (event_name == "sunrise")
{
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE);
// <FS:Beq> 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);
// </FS:Beq>
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);
// <FS:Beq> 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);
// </FS:Beq>
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);
// <FS:Beq> 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);
// </FS:Beq>
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);
// <FS:Beq> 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);
// </FS:Beq>
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
LLEnvironment::instance().updateEnvironment();
defocusEnvFloaters();

View File

@ -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<LLSettingsBase::Seconds>(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<LLSettingsBase::Seconds>(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<LLSettingsBase::Seconds>(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()

View File

@ -182,7 +182,22 @@
name="flight_extreme"
value="15.0" />
</combo_box>
<slider
name="manual_environment_change_transition_period"
control_name="FSEnvironmentManualTransitionTime"
label="Environment Transition Time:"
decimal_digits="1"
left="10"
top_pad="5"
follows="left|top"
layout="topleft"
height="18"
increment="0.5"
initial_value="0"
max_val="60"
min_val="0"
width="520"
tool_tip="Interval in seconds over which manual environment changes will blend. Zero is instant."/>
</panel>