// Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a void RlvUIEnabler::removeGenericFloaterFilter(const std::string& strFloaterName) { std::multiset<std::string>::iterator itFloater = m_FilteredFloaters.find(strFloaterName); RLV_ASSERT_DBG(itFloater != m_FilteredFloaters.end()); m_FilteredFloaters.erase(itFloater); RLV_ASSERT_DBG(m_ConnFloaterGeneric.connected()); if (m_FilteredFloaters.empty()) m_ConnFloaterGeneric.disconnect(); }
// Checked: 2010-09-25 (RLVa-1.2.1c) | Added: RLVa-1.2.1c RlvForceWear::EWearAction RlvWearableItemCollector::getWearActionNormal(const LLInventoryCategory* pFolder) { RLV_ASSERT_DBG(!RlvInventory::isFoldedFolder(pFolder, false)); if ( (RlvForceWear::ACTION_WEAR_REPLACE == m_eWearAction) && (!m_strWearAddPrefix.empty()) && (boost::algorithm::starts_with(pFolder->getName(), m_strWearAddPrefix))) { return RlvForceWear::ACTION_WEAR_ADD; } else if ( (RlvForceWear::ACTION_WEAR_ADD == m_eWearAction) && (!m_strWearReplacePrefix.empty()) && (boost::algorithm::starts_with(pFolder->getName(), m_strWearReplacePrefix)) ) { return RlvForceWear::ACTION_WEAR_REPLACE; } return (pFolder->getUUID() != m_idFolder) ? getWearAction(pFolder->getParentUUID()) : m_eWearAction; }
// Checked: 2011-08-29 (RLVa-1.4.1a) | Added: RLVa-1.4.1a bool RlvWindLight::setValue(const std::string& strRlvName, const std::string& strValue) { F32 nValue = 0.0f; // Sanity check - make sure strValue specifies a number for all settings except "preset" and "daycycle" if ( (RlvSettings::getNoSetEnv()) || ( (!LLStringUtil::convertToF32(strValue, nValue)) && (("preset" != strRlvName) && ("daycycle" != strRlvName)) ) ) { return false; } LLWLParamManager* pWLParams = LLWLParamManager::getInstance(); LLEnvManagerNew* pEnvMgr = LLEnvManagerNew::getInstance(); if ("daytime" == strRlvName) { if (0.0f <= nValue) { pWLParams->mAnimator.deactivate(); pWLParams->mAnimator.setDayTime(nValue); pWLParams->mAnimator.update(pWLParams->mCurParams); } else { pEnvMgr->useRegionSettings(); } return true; } else if ("preset" == strRlvName) { std::string strPresetName = pWLParams->findPreset(strValue, LLEnvKey::SCOPE_LOCAL); if (!strPresetName.empty()) pEnvMgr->useSkyPreset(strPresetName); return !strPresetName.empty(); } else if ("daycycle" == strRlvName) { std::string strPresetName = LLDayCycleManager::instance().findPreset(strValue); if (!strPresetName.empty()) pEnvMgr->useDayCycle(strValue, LLEnvKey::SCOPE_LOCAL); return !strPresetName.empty(); } bool fError = false; pWLParams->mAnimator.deactivate(); if (("sunglowfocus" == strRlvName) || ("sunglowsize" == strRlvName)) { pWLParams->mGlow = pWLParams->mCurParams.getVector(pWLParams->mGlow.mName, fError); RLV_ASSERT_DBG(!fError); if ("sunglowfocus" == strRlvName) pWLParams->mGlow.b = -nValue * 5; else pWLParams->mGlow.r = (2 - nValue) * 20; pWLParams->mGlow.update(pWLParams->mCurParams); pWLParams->propagateParameters(); return true; } else if ("starbrightness" == strRlvName) { pWLParams->mCurParams.setStarBrightness(nValue); return true; } else if (("eastangle" == strRlvName) || ("sunmoonposition" == strRlvName)) { if ("eastangle" == strRlvName) pWLParams->mCurParams.setEastAngle(F_TWO_PI * nValue); else pWLParams->mCurParams.setSunAngle(F_TWO_PI * nValue); // Set the sun vector pWLParams->mLightnorm.r = -sin(pWLParams->mCurParams.getEastAngle()) * cos(pWLParams->mCurParams.getSunAngle()); pWLParams->mLightnorm.g = sin(pWLParams->mCurParams.getSunAngle()); pWLParams->mLightnorm.b = cos(pWLParams->mCurParams.getEastAngle()) * cos(pWLParams->mCurParams.getSunAngle()); pWLParams->mLightnorm.i = 1.f; pWLParams->propagateParameters(); return true; } else if ("cloudscrollx" == strRlvName) { pWLParams->mCurParams.setCloudScrollX(nValue + 10.0f); return true; } else if ("cloudscrolly" == strRlvName) { pWLParams->mCurParams.setCloudScrollY(nValue + 10.0f); return true; } std::map<std::string, RlvWindLightControl>::iterator itControl = m_ControlLookupMap.find(strRlvName); if (m_ControlLookupMap.end() != itControl) { switch (itControl->second.getControlType()) { case RlvWindLightControl::TYPE_FLOAT: return itControl->second.setFloat(nValue); case RlvWindLightControl::TYPE_COLOR_R: return itControl->second.setColorComponent(RlvWindLightControl::COMPONENT_R, nValue); default: RLV_ASSERT(false); } } else { // Couldn't find the exact name, check for a color control name RlvWindLightControl::EColorComponent eComponent = RlvWindLightControl::getComponentFromCharacter(strRlvName[strRlvName.length() - 1]); if (RlvWindLightControl::COMPONENT_NONE != eComponent) itControl = m_ControlLookupMap.find(strRlvName.substr(0, strRlvName.length() - 1)); if ( (m_ControlLookupMap.end() != itControl) && (itControl->second.isColorType()) ) return itControl->second.setColorComponent(eComponent, nValue); } return false; }
// Checked: 2011-08-29 (RLVa-1.4.1a) | Added: RLVa-1.4.1a std::string RlvWindLight::getValue(const std::string& strSetting, bool& fError) { LLWLParamManager* pWLParams = LLWLParamManager::getInstance(); LLEnvManagerNew* pEnvMgr = LLEnvManagerNew::getInstance(); fError = false; // Assume we won't fail if ("preset" == strSetting) return (pEnvMgr->getUseFixedSky()) ? pEnvMgr->getSkyPresetName() : std::string(); else if ("daycycle" == strSetting) return (pEnvMgr->getUseDayCycle()) ? pEnvMgr->getDayCycleName() : std::string(); F32 nValue = 0.0f; if ("daytime" == strSetting) { nValue = (pEnvMgr->getUseFixedSky()) ? pWLParams->mCurParams.getFloat("sun_angle", fError) / F_TWO_PI : -1.0f; } else if (("sunglowfocus" == strSetting) || ("sunglowsize" == strSetting)) { pWLParams->mGlow = pWLParams->mCurParams.getVector(pWLParams->mGlow.mName, fError); RLV_ASSERT_DBG(!fError); if ("sunglowfocus" == strSetting) nValue = -pWLParams->mGlow.b / 5.0f; else nValue = 2 - pWLParams->mGlow.r / 20.0f; } else if ("starbrightness" == strSetting) nValue = pWLParams->mCurParams.getStarBrightness(); else if ("eastangle" == strSetting) nValue = pWLParams->mCurParams.getEastAngle() / F_TWO_PI; else if ("sunmoonposition" == strSetting) nValue = pWLParams->mCurParams.getSunAngle() / F_TWO_PI; else if ("cloudscrollx" == strSetting) nValue = pWLParams->mCurParams.getCloudScrollX() - 10.0f; else if ("cloudscrolly" == strSetting) nValue = pWLParams->mCurParams.getCloudScrollY() - 10.0f; else { std::map<std::string, RlvWindLightControl>::const_iterator itControl = m_ControlLookupMap.find(strSetting); if (m_ControlLookupMap.end() != itControl) { switch (itControl->second.getControlType()) { case RlvWindLightControl::TYPE_FLOAT: nValue = itControl->second.getFloat(fError); break; case RlvWindLightControl::TYPE_COLOR_R: nValue = itControl->second.getColorComponent(RlvWindLightControl::COMPONENT_R, fError); break; default: fError = true; break; } } else { // Couldn't find the exact name, check for a color control name RlvWindLightControl::EColorComponent eComponent = RlvWindLightControl::getComponentFromCharacter(strSetting[strSetting.length() - 1]); if (RlvWindLightControl::COMPONENT_NONE != eComponent) itControl = m_ControlLookupMap.find(strSetting.substr(0, strSetting.length() - 1)); if ( (m_ControlLookupMap.end() != itControl) && (itControl->second.isColorType()) ) nValue = itControl->second.getColorComponent(eComponent, fError); else fError = true; } } return llformat("%f", nValue); }