FIRE-29785 - Attempt to provide a sane WL fallback

Uses existing W/L presets to provide "fixed" settings.
Also minor change to QP, append [WL] to legacy settings
master
Beq 2020-07-16 19:10:35 +01:00
parent 605cf0077f
commit c578f8007b
2 changed files with 45 additions and 1 deletions

View File

@ -10787,6 +10787,38 @@ class LLWorldEnvSettings : public view_listener_t
// [/RLVa:KB]
std::string event_name = userdata.asString();
// <FS:Beq> FIRE-29785 fix daytime shortcuts for non-EEP
#ifdef OPENSIM
static std::map<std::string, std::string> sky_presets = {
{"sunrise", "Sunrise"},
{"noon", "Midday"},
{"sunset", "Sunset"},
{"midnight", "Midnight"}
};
auto it = sky_presets.find(event_name);
if( LLGridManager::getInstance()->isInOpenSim() &&
!LLEnvironment::instance().isExtendedEnvironmentEnabled() &&
it != sky_presets.end()
)
{
LLSettingsSky::ptr_t legacysky = nullptr;
LLSD messages;
legacysky = LLEnvironment::createSkyFromLegacyPreset(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", "skies", it->second + ".xml"), messages);
if (legacysky)
{
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, legacysky);
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true);
defocusEnvFloaters();
}
else
{
LL_WARNS() << "Legacy windlight conversion failed for " << it->second << " existing env unchanged." << LL_ENDL;
}
return true;
}
#endif
// </FS:Beq>
if (event_name == "sunrise")
{

View File

@ -345,7 +345,8 @@ void FloaterQuickPrefs::loadSkyPresets(const std::multimap<std::string, LLUUID>&
{
// we add by name and only build the envp on demand
LL_DEBUGS("WindlightCaps") << "Adding legacy sky " << preset_name << LL_ENDL;
mWLPresetsCombo->add(preset_name, LLSD(preset_name));
// append "WL" to denote legacy. Have to create a new string not update the reference.
mWLPresetsCombo->add(preset_name+ "[WL]", LLSD(preset_name));
}
LL_DEBUGS("WindlightCaps") << "Done: Adding legacy sky presets to QP" << LL_ENDL;
}
@ -1163,6 +1164,17 @@ void FloaterQuickPrefs::updateRlvRestrictions(ERlvBehaviour behavior, ERlvParamT
}
}
// void FloaterQuickPrefs::onSunMoved()
// {
// F32 val = mWLSunPos->getCurSliderValue();
// auto env = LLEnvironment::instance().getSelectedEnvironment() == LLEnvironment::ENV_LOCAL)
// auto day = LLEnvironment::instance().getEnvironmentDay(env);
// }
void FloaterQuickPrefs::enableWindlightButtons(bool enable)
{
childSetEnabled("WLPresetsCombo", enable);