From ba7ad1af7222ae39dfc0e0303fdee820636eddf2 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 9 May 2019 16:18:44 +0300 Subject: SL-9684 Fixed editor edits environment that was freshly applied from same editor --- indra/newview/llfloaterfixedenvironment.cpp | 45 +++++++++++++++-------------- indra/newview/llfloaterfixedenvironment.h | 8 ++--- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index f08c36a7e7..a94b7c219f 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -388,12 +388,14 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) std::string ctrl_action = ctrl->getName(); std::string local_desc; + LLSettingsBase::ptr_t setting_clone; bool is_local = false; // because getString can be empty if (mSettings->getSettingsType() == "water") { LLSettingsWater::ptr_t water = std::static_pointer_cast(mSettings); if (water) { + setting_clone = water->buildClone(); // LLViewerFetchedTexture and check for FTT_LOCAL_FILE or check LLLocalBitmapMgr if (LLLocalBitmapMgr::isLocal(water->getNormalMapID())) { @@ -412,6 +414,7 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) LLSettingsSky::ptr_t sky = std::static_pointer_cast(mSettings); if (sky) { + setting_clone = sky->buildClone(); if (LLLocalBitmapMgr::isLocal(sky->getSunTextureId())) { local_desc = LLTrans::getString("EnvironmentSun"); @@ -445,19 +448,19 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) if (ctrl_action == ACTION_SAVE) { - doApplyUpdateInventory(); + doApplyUpdateInventory(setting_clone); } else if (ctrl_action == ACTION_SAVEAS) { LLSD args; args["DESC"] = mSettings->getName(); - LLNotificationsUtil::add("SaveSettingAs", args, LLSD(), boost::bind(&LLFloaterFixedEnvironment::onSaveAsCommit, this, _1, _2)); + LLNotificationsUtil::add("SaveSettingAs", args, LLSD(), boost::bind(&LLFloaterFixedEnvironment::onSaveAsCommit, this, _1, _2, setting_clone)); } else if ((ctrl_action == ACTION_APPLY_LOCAL) || (ctrl_action == ACTION_APPLY_PARCEL) || (ctrl_action == ACTION_APPLY_REGION)) { - doApplyEnvironment(ctrl_action); + doApplyEnvironment(ctrl_action, setting_clone); } else { @@ -465,7 +468,7 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) } } -void LLFloaterFixedEnvironment::onSaveAsCommit(const LLSD& notification, const LLSD& response) +void LLFloaterFixedEnvironment::onSaveAsCommit(const LLSD& notification, const LLSD& response, const LLSettingsBase::ptr_t &settings) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) @@ -474,7 +477,7 @@ void LLFloaterFixedEnvironment::onSaveAsCommit(const LLSD& notification, const L LLStringUtil::trim(settings_name); if (mCanMod) { - doApplyCreateNewInventory(settings_name); + doApplyCreateNewInventory(settings_name, settings); } else if (mInventoryItem) { @@ -514,44 +517,44 @@ void LLFloaterFixedEnvironment::onButtonLoad() checkAndConfirmSettingsLoss([this](){ doSelectFromInventory(); }); } -void LLFloaterFixedEnvironment::doApplyCreateNewInventory(std::string settings_name) +void LLFloaterFixedEnvironment::doApplyCreateNewInventory(std::string settings_name, const LLSettingsBase::ptr_t &settings) { if (mInventoryItem) { LLUUID parent_id = mInventoryItem->getParentUUID(); U32 next_owner_perm = mInventoryItem->getPermissions().getMaskNextOwner(); - LLSettingsVOBase::createInventoryItem(mSettings, next_owner_perm, parent_id, settings_name, + LLSettingsVOBase::createInventoryItem(settings, next_owner_perm, parent_id, settings_name, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } else { LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); // This method knows what sort of settings object to create. - LLSettingsVOBase::createInventoryItem(mSettings, parent_id, settings_name, + LLSettingsVOBase::createInventoryItem(settings, parent_id, settings_name, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } } -void LLFloaterFixedEnvironment::doApplyUpdateInventory() +void LLFloaterFixedEnvironment::doApplyUpdateInventory(const LLSettingsBase::ptr_t &settings) { LL_DEBUGS("ENVEDIT") << "Update inventory for " << mInventoryId << LL_ENDL; if (mInventoryId.isNull()) { - LLSettingsVOBase::createInventoryItem(mSettings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), std::string(), + LLSettingsVOBase::createInventoryItem(settings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), std::string(), [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } else { - LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId, + LLSettingsVOBase::updateInventoryItem(settings, mInventoryId, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); }); } } -void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) +void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where, const LLSettingsBase::ptr_t &settings) { if (where == ACTION_APPLY_LOCAL) { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mSettings); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, settings); } else if (where == ACTION_APPLY_PARCEL) { @@ -568,13 +571,13 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) { LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), mInventoryItem->getName(), LLEnvironment::NO_TRACK, -1, -1); } - else if (mSettings->getSettingsType() == "sky") + else if (settings->getSettingsType() == "sky") { - LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); + LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(settings), -1, -1); } - else if (mSettings->getSettingsType() == "water") + else if (settings->getSettingsType() == "water") { - LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); + LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(settings), -1, -1); } } else if (where == ACTION_APPLY_REGION) @@ -583,13 +586,13 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) { LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), mInventoryItem->getName(), LLEnvironment::NO_TRACK, -1, -1); } - else if (mSettings->getSettingsType() == "sky") + else if (settings->getSettingsType() == "sky") { - LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); + LLEnvironment::instance().updateRegion(std::static_pointer_cast(settings), -1, -1); } - else if (mSettings->getSettingsType() == "water") + else if (settings->getSettingsType() == "water") { - LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); + LLEnvironment::instance().updateRegion(std::static_pointer_cast(settings), -1, -1); } } else diff --git a/indra/newview/llfloaterfixedenvironment.h b/indra/newview/llfloaterfixedenvironment.h index f694e59281..138f26cfd7 100644 --- a/indra/newview/llfloaterfixedenvironment.h +++ b/indra/newview/llfloaterfixedenvironment.h @@ -86,9 +86,9 @@ protected: LLSettingsBase::ptr_t mSettings; virtual void doImportFromDisk() = 0; - virtual void doApplyCreateNewInventory(std::string settings_name); - virtual void doApplyUpdateInventory(); - virtual void doApplyEnvironment(const std::string &where); + virtual void doApplyCreateNewInventory(std::string settings_name, const LLSettingsBase::ptr_t &settings); + virtual void doApplyUpdateInventory(const LLSettingsBase::ptr_t &settings); + virtual void doApplyEnvironment(const std::string &where, const LLSettingsBase::ptr_t &settings); void doCloseInventoryFloater(bool quitting = false); bool canUseInventory() const; @@ -116,7 +116,7 @@ protected: void onPanelDirtyFlagChanged(bool); virtual void onClickCloseBtn(bool app_quitting = false) override; - void onSaveAsCommit(const LLSD& notification, const LLSD& response); + void onSaveAsCommit(const LLSD& notification, const LLSD& response, const LLSettingsBase::ptr_t &settings); private: void onNameChanged(const std::string &name); -- cgit v1.2.3 From 61c2f820b4f9753fc73d2e338a38f81ff11de791 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 9 May 2019 14:16:01 -0700 Subject: SL-11008: Do not adjust imported windlight density and distance multipliers. --- indra/newview/llsettingsvo.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index d307e1a947..7e0ec23a06 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -566,14 +566,8 @@ void LLSettingsVOSky::convertAtmosphericsToLegacy(LLSD& legacy, LLSD& settings) legacy[SETTING_BLUE_DENSITY] = ensure_array_4(legacyhaze[SETTING_BLUE_DENSITY], 1.0); legacy[SETTING_BLUE_HORIZON] = ensure_array_4(legacyhaze[SETTING_BLUE_HORIZON], 1.0); - F32 density_multiplier = legacyhaze[SETTING_DENSITY_MULTIPLIER].asReal(); - density_multiplier = (density_multiplier < 0.0001f) ? 0.0001f : density_multiplier; - density_multiplier *= 0.9f / 2.0f; // take 0 - 2.0 range to 0 - 0.9 range - legacy[SETTING_DENSITY_MULTIPLIER] = LLSDArray(density_multiplier)(0.0f)(0.0f)(1.0f); - - F32 distance_multiplier = legacyhaze[SETTING_DISTANCE_MULTIPLIER].asReal(); - distance_multiplier *= 0.1f; // take 0 - 1000 range to 0 - 100 range - legacy[SETTING_DISTANCE_MULTIPLIER] = LLSDArray(distance_multiplier)(0.0f)(0.0f)(1.0f); + legacy[SETTING_DENSITY_MULTIPLIER] = LLSDArray(legacyhaze[SETTING_DENSITY_MULTIPLIER].asReal())(0.0f)(0.0f)(1.0f); + legacy[SETTING_DISTANCE_MULTIPLIER] = LLSDArray(legacyhaze[SETTING_DISTANCE_MULTIPLIER].asReal())(0.0f)(0.0f)(1.0f); legacy[SETTING_HAZE_DENSITY] = LLSDArray(legacyhaze[SETTING_HAZE_DENSITY])(0.0f)(0.0f)(1.0f); legacy[SETTING_HAZE_HORIZON] = LLSDArray(legacyhaze[SETTING_HAZE_HORIZON])(0.0f)(0.0f)(1.0f); -- cgit v1.2.3 From ce910edb0ed6222ad402e4310ccef6a0d0207dd0 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 13 May 2019 16:28:33 +0300 Subject: SL-11150 FIXED [EEP] Settings names get truncated. --- indra/llinventory/llsettingsbase.cpp | 2 +- indra/newview/skins/default/xui/en/floater_fixedenvironment.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp index 7d7547ecb1..7f2b5d4597 100644 --- a/indra/llinventory/llsettingsbase.cpp +++ b/indra/llinventory/llsettingsbase.cpp @@ -389,7 +389,7 @@ bool LLSettingsBase::validate() LLSD LLSettingsBase::settingValidation(LLSD &settings, validation_list_t &validations, bool partial) { - static Validator validateName(SETTING_NAME, false, LLSD::TypeString, boost::bind(&Validator::verifyStringLength, _1, 32)); + static Validator validateName(SETTING_NAME, false, LLSD::TypeString, boost::bind(&Validator::verifyStringLength, _1, 63)); static Validator validateId(SETTING_ID, false, LLSD::TypeUUID); static Validator validateHash(SETTING_HASH, false, LLSD::TypeInteger); static Validator validateType(SETTING_TYPE, false, LLSD::TypeString); diff --git a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml index 348c0ce195..dbf91b0834 100644 --- a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml +++ b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml @@ -44,7 +44,7 @@ width="250" name="settings_name" prevalidate_callback="ascii" - max_length_chars="32" + max_length_chars="63" height="20"/>