diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp index 5e85b01865..2bab557e3e 100644 --- a/indra/llcommon/llassettype.cpp +++ b/indra/llcommon/llassettype.cpp @@ -95,7 +95,7 @@ LLAssetDictionary::LLAssetDictionary() addEntry(LLAssetType::AT_MESH, new AssetEntry("MESH", "mesh", "mesh", false, false, false)); addEntry(LLAssetType::AT_WIDGET, new AssetEntry("WIDGET", "widget", "widget", false, false, false)); addEntry(LLAssetType::AT_PERSON, new AssetEntry("PERSON", "person", "person", false, false, false)); - addEntry(LLAssetType::AT_SETTINGS, new AssetEntry("SETTINGS", "settings", "settings blob", true, true, true)); + addEntry(LLAssetType::AT_SETTINGS, new AssetEntry("SETTINGS", "settings", "settings blob", true, true, false)); addEntry(LLAssetType::AT_NONE, new AssetEntry("NONE", "-1", NULL, FALSE, FALSE, FALSE)); }; diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp index 5f8e049b45..e74c496b4a 100644 --- a/indra/llinventory/llinventorytype.cpp +++ b/indra/llinventory/llinventorytype.cpp @@ -210,6 +210,12 @@ bool LLInventoryType::cannotRestrictPermissions(LLInventoryType::EType type) } } +// Should show permissions that apply only to objects rezed in world. +bool LLInventoryType::showInWorldPermissions(LLInventoryType::EType type) +{ + return (type != IT_SETTINGS); +} + bool inventory_and_asset_types_match(LLInventoryType::EType inventory_type, LLAssetType::EType asset_type) { diff --git a/indra/llinventory/llinventorytype.h b/indra/llinventory/llinventorytype.h index 86486373b5..8f2267307b 100644 --- a/indra/llinventory/llinventorytype.h +++ b/indra/llinventory/llinventorytype.h @@ -134,6 +134,8 @@ public: // true if this type cannot have restricted permissions. static bool cannotRestrictPermissions(EType type); + static bool showInWorldPermissions(EType type); + private: // don't instantiate or derive one of these objects LLInventoryType( void ); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 72590fda6c..d20d0b6120 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2764,6 +2764,17 @@ Value 1 + BulkChangeIncludeSettings + + Comment + Bulk permission changes affect environment settings + Persist + 1 + Type + Boolean + Value + 1 + BulkChangeEveryoneCopy Comment @@ -19687,6 +19698,28 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + SettingsNextOwnerModify + + Comment + Newly created Environment setting can be modified by next owner + Persist + 1 + Type + Boolean + Value + 1 + + SettingsNextOwnerTransfer + + Comment + Newly created Environment setting can be resold or given away by next owner + Persist + 1 + Type + Boolean + Value + 1 + DefaultUploadPermissionsConverted Comment diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index ec2577d053..1b38fceef7 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -502,7 +502,9 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSe environment->setDay(pday, daylength, dayoffset); environment->setSkyTrack(mCurrentTrack); environment->animate(); - /*TODO: readjust environment*/ + + if (!mSignalEnvChanged.empty()) + mSignalEnvChanged(env); } @@ -519,6 +521,8 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm environment->clear(); environment->setSky((fixed.first) ? fixed.first : mEnvironments[ENV_DEFAULT]->getSky()); environment->setWater((fixed.second) ? fixed.second : mEnvironments[ENV_DEFAULT]->getWater()); + if (!mSignalEnvChanged.empty()) + mSignalEnvChanged(env); /*TODO: readjust environment*/ } @@ -605,6 +609,10 @@ void LLEnvironment::clearEnvironment(LLEnvironment::EnvSelection_t env) } mEnvironments[env].reset(); + + if (!mSignalEnvChanged.empty()) + mSignalEnvChanged(env); + /*TODO: readjust environment*/ } @@ -968,10 +976,28 @@ void LLEnvironment::updateShaderUniforms(LLGLSLShader *shader) void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envinfo) { if (envinfo->mParcelId == INVALID_PARCEL_ID) - { // the returned info applies to an entire region. - LL_WARNS("LAPRAS") << "Setting Region environment" << LL_ENDL; - setEnvironment(ENV_REGION, envinfo->mDayCycle, envinfo->mDayLength, envinfo->mDayOffset); - mTrackAltitudes = envinfo->mAltitudes; + { + // the returned info applies to an entire region. + if (!envinfo->mDayCycle) + { + clearEnvironment(ENV_PARCEL); + setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); + updateEnvironment(); + } + else if (envinfo->mDayCycle->isTrackEmpty(LLSettingsDay::TRACK_WATER) + || envinfo->mDayCycle->isTrackEmpty(LLSettingsDay::TRACK_GROUND_LEVEL)) + { + LL_WARNS("LAPRAS") << "Invalid day cycle for region" << LL_ENDL; + clearEnvironment(ENV_PARCEL); + setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); + updateEnvironment(); + } + else + { + LL_INFOS("LAPRAS") << "Setting Region environment" << LL_ENDL; + setEnvironment(ENV_REGION, envinfo->mDayCycle, envinfo->mDayLength, envinfo->mDayOffset); + mTrackAltitudes = envinfo->mAltitudes; + } LL_WARNS("LAPRAS") << "Altitudes set to {" << mTrackAltitudes[0] << ", "<< mTrackAltitudes[1] << ", " << mTrackAltitudes[2] << ", " << mTrackAltitudes[3] << LL_ENDL; } @@ -990,6 +1016,12 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI LL_WARNS("LAPRAS") << "Clearing environment on parcel #" << parcel_id << LL_ENDL; clearEnvironment(ENV_PARCEL); } + else if (envinfo->mDayCycle->isTrackEmpty(LLSettingsDay::TRACK_WATER) + || envinfo->mDayCycle->isTrackEmpty(LLSettingsDay::TRACK_GROUND_LEVEL)) + { + LL_WARNS("LAPRAS") << "Invalid day cycle for parcel #" << parcel_id << LL_ENDL; + clearEnvironment(ENV_PARCEL); + } else { setEnvironment(ENV_PARCEL, envinfo->mDayCycle, envinfo->mDayLength, envinfo->mDayOffset); @@ -1048,13 +1080,7 @@ void LLEnvironment::requestParcel(S32 parcel_id, environment_apply_fn cb) { cb = [this](S32 pid, EnvironmentInfo::ptr_t envinfo) { - if (envinfo->mDayCycle) recordEnvironment(pid, envinfo); - else - { - clearEnvironment(ENV_PARCEL); - setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); - updateEnvironment(); - } + recordEnvironment(pid, envinfo); }; } diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index b5bd353066..32a99c4286 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -135,15 +135,12 @@ public: }; typedef std::pair fixedEnvironment_t; + typedef std::function environment_apply_fn; + typedef boost::signals2::signal env_changed_signal_t; + typedef env_changed_signal_t::slot_type env_changed_fn; + typedef std::array altitude_list_t; - typedef std::function environment_apply_fn; - - typedef boost::signals2::signal environment_changed_signal_t; - typedef environment_changed_signal_t::slot_type environment_changed_fn; - - typedef std::array altitude_list_t; - - virtual ~LLEnvironment(); + virtual ~LLEnvironment(); void loadPreferences(); void updatePreferences(); @@ -229,7 +226,7 @@ public: LLSettingsDay::ptr_t createDayCycleFromEnvironment(EnvSelection_t env, LLSettingsBase::ptr_t settings); //------------------------------------------- - connection_t setEnvironmentChanged(environment_changed_fn cb); + connection_t setEnvironmentChanged(env_changed_fn cb) { return mSignalEnvChanged.connect(cb); } void requestRegion(environment_apply_fn cb = environment_apply_fn()); void updateRegion(const LLUUID &asset_id, S32 day_length, S32 day_offset, environment_apply_fn cb = environment_apply_fn()); @@ -350,6 +347,8 @@ private: LLSettingsBlender::ptr_t mBlenderSky; LLSettingsBlender::ptr_t mBlenderWater; + env_changed_signal_t mSignalEnvChanged; + UserPrefs mUserPrefs; S32 mCurrentTrack; diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp index f2040bc760..a1a06706bc 100644 --- a/indra/newview/llfloaterbulkpermission.cpp +++ b/indra/newview/llfloaterbulkpermission.cpp @@ -75,6 +75,7 @@ BOOL LLFloaterBulkPermission::postBuild() mBulkChangeIncludeScripts = gSavedSettings.getBOOL("BulkChangeIncludeScripts"); mBulkChangeIncludeSounds = gSavedSettings.getBOOL("BulkChangeIncludeSounds"); mBulkChangeIncludeTextures = gSavedSettings.getBOOL("BulkChangeIncludeTextures"); + mBulkChangeIncludeSettings = gSavedSettings.getBOOL("BulkChangeIncludeSettings"); mBulkChangeShareWithGroup = gSavedSettings.getBOOL("BulkChangeShareWithGroup"); mBulkChangeEveryoneCopy = gSavedSettings.getBOOL("BulkChangeEveryoneCopy"); mBulkChangeNextOwnerModify = gSavedSettings.getBOOL("BulkChangeNextOwnerModify"); @@ -186,6 +187,7 @@ void LLFloaterBulkPermission::onCloseBtn() gSavedSettings.setBOOL("BulkChangeIncludeScripts", mBulkChangeIncludeScripts); gSavedSettings.setBOOL("BulkChangeIncludeSounds", mBulkChangeIncludeSounds); gSavedSettings.setBOOL("BulkChangeIncludeTextures", mBulkChangeIncludeTextures); + gSavedSettings.setBOOL("BulkChangeIncludeSettings", mBulkChangeIncludeSettings); gSavedSettings.setBOOL("BulkChangeShareWithGroup", mBulkChangeShareWithGroup); gSavedSettings.setBOOL("BulkChangeEveryoneCopy", mBulkChangeEveryoneCopy); gSavedSettings.setBOOL("BulkChangeNextOwnerModify", mBulkChangeNextOwnerModify); @@ -281,6 +283,7 @@ void LLFloaterBulkPermission::doCheckUncheckAll(BOOL check) gSavedSettings.setBOOL("BulkChangeIncludeScripts" , check); gSavedSettings.setBOOL("BulkChangeIncludeSounds" , check); gSavedSettings.setBOOL("BulkChangeIncludeTextures" , check); + gSavedSettings.setBOOL("BulkChangeIncludeSettings" , check); } @@ -302,6 +305,7 @@ void LLFloaterBulkPermission::handleInventory(LLViewerObject* viewer_obj, LLInve ( asstype == LLAssetType::AT_OBJECT && gSavedSettings.getBOOL("BulkChangeIncludeObjects" )) || ( asstype == LLAssetType::AT_LSL_TEXT && gSavedSettings.getBOOL("BulkChangeIncludeScripts" )) || ( asstype == LLAssetType::AT_SOUND && gSavedSettings.getBOOL("BulkChangeIncludeSounds" )) || + ( asstype == LLAssetType::AT_SETTINGS && gSavedSettings.getBOOL("BulkChangeIncludeSettings" )) || ( asstype == LLAssetType::AT_TEXTURE && gSavedSettings.getBOOL("BulkChangeIncludeTextures" ))) { LLViewerObject* object = gObjectList.findObject(viewer_obj->getID()); @@ -333,7 +337,12 @@ void LLFloaterBulkPermission::handleInventory(LLViewerObject* viewer_obj, LLInve //|| something else // for next owner perms ) { - perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("BulkChange")); + U32 mask_next = LLFloaterPerms::getNextOwnerPerms("BulkChange"); + if (asstype == LLAssetType::AT_SETTINGS) + { + mask_next |= PERM_COPY; + } + perm.setMaskNext(mask_next); perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("BulkChange")); perm.setMaskGroup(LLFloaterPerms::getGroupPerms("BulkChange")); new_item->setPermissions(perm); // here's the beef diff --git a/indra/newview/llfloaterbulkpermission.h b/indra/newview/llfloaterbulkpermission.h index 0c042c3ee3..1afc876bba 100644 --- a/indra/newview/llfloaterbulkpermission.h +++ b/indra/newview/llfloaterbulkpermission.h @@ -102,6 +102,7 @@ private: bool mBulkChangeIncludeScripts; bool mBulkChangeIncludeSounds; bool mBulkChangeIncludeTextures; + bool mBulkChangeIncludeSettings; bool mBulkChangeShareWithGroup; bool mBulkChangeEveryoneCopy; bool mBulkChangeNextOwnerModify; diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index fa16648140..5b083e8503 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -437,6 +437,19 @@ void LLFloaterEditExtDayCycle::refresh() void LLFloaterEditExtDayCycle::setEditDayCycle(const LLSettingsDay::ptr_t &pday) { mEditDay = pday->buildDeepCloneAndUncompress(); + + if (mEditDay->isTrackEmpty(LLSettingsDay::TRACK_WATER)) + { + LL_WARNS("ENVDAYEDIT") << "No water frames found, generating replacement" << LL_ENDL; + mEditDay->setWaterAtKeyframe(LLSettingsVOWater::buildDefaultWater(), .5f); + } + + if (mEditDay->isTrackEmpty(LLSettingsDay::TRACK_GROUND_LEVEL)) + { + LL_WARNS("ENVDAYEDIT") << "No sky frames found, generating replacement" << LL_ENDL; + mEditDay->setSkyAtKeyframe(LLSettingsVOSky::buildDefaultSky(), .5f, LLSettingsDay::TRACK_GROUND_LEVEL); + } + updateEditEnvironment(); LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_INSTANT); LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT); @@ -1260,11 +1273,25 @@ void LLFloaterEditExtDayCycle::doApplyEnvironment(const std::string &where, cons return; } - LLEnvironment::instance().updateParcel(parcel->getLocalID(), day, -1, -1); + if (mInventoryItem && !isDirty()) + { + LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), -1, -1); + } + else + { + LLEnvironment::instance().updateParcel(parcel->getLocalID(), day, -1, -1); + } } else if (where == ACTION_APPLY_REGION) { - LLEnvironment::instance().updateRegion(day, -1, -1); + if (mInventoryItem && !isDirty()) + { + LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), -1, -1); + } + else + { + LLEnvironment::instance().updateRegion(day, -1, -1); + } } else { diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index d65a578a6d..2eda405f51 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -430,17 +430,33 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) return; } - if (mSettings->getSettingsType() == "sky") + if (mInventoryItem && !isDirty()) + { + LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), -1, -1); + } + else if (mSettings->getSettingsType() == "sky") + { LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); + } else if (mSettings->getSettingsType() == "water") + { LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); + } } else if (where == ACTION_APPLY_REGION) { - if (mSettings->getSettingsType() == "sky") + if (mInventoryItem && !isDirty()) + { + LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), -1, -1); + } + else if (mSettings->getSettingsType() == "sky") + { LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); + } else if (mSettings->getSettingsType() == "water") + { LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); + } } else { diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 12dc3c298a..1724d9d6bd 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -3602,8 +3602,8 @@ void LLPanelLandEnvironment::refreshFromSource() setCrossRegion(true); mCurrentEnvironment.reset(); mLastParcelId = INVALID_PARCEL_ID; - setControlsEnabled(false); } + setControlsEnabled(false); } diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp index 9319ff9ee9..e554559e58 100644 --- a/indra/newview/llfloaterperms.cpp +++ b/indra/newview/llfloaterperms.cpp @@ -124,7 +124,8 @@ const std::string LLFloaterPermsDefault::sCategoryNames[CAT_LAST] = "Scripts", "Notecards", "Gestures", - "Wearables" + "Wearables", + "Settings" }; BOOL LLFloaterPermsDefault::postBuild() diff --git a/indra/newview/llfloaterperms.h b/indra/newview/llfloaterperms.h index 3a913947f5..b3912d2e79 100644 --- a/indra/newview/llfloaterperms.h +++ b/indra/newview/llfloaterperms.h @@ -76,6 +76,7 @@ enum Categories CAT_NOTECARDS, CAT_GESTURES, CAT_WEARABLES, + CAT_SETTINGS, CAT_LAST }; diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index f1b3b21df4..003a414ac8 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -586,6 +586,25 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) edit_cost->setEnabled(FALSE); } + // Hide any properties that are not relevant to settings + if (is_settings) + { + getChild("GroupLabel")->setEnabled(false); + getChild("GroupLabel")->setVisible(false); + getChild("CheckShareWithGroup")->setEnabled(false); + getChild("CheckShareWithGroup")->setVisible(false); + getChild("AnyoneLabel")->setEnabled(false); + getChild("AnyoneLabel")->setVisible(false); + getChild("CheckEveryoneCopy")->setEnabled(false); + getChild("CheckEveryoneCopy")->setVisible(false); + getChild("CheckPurchase")->setEnabled(false); + getChild("CheckPurchase")->setVisible(false); + getChild("ComboBoxSaleType")->setEnabled(false); + getChild("ComboBoxSaleType")->setVisible(false); + getChild("Edit Cost")->setEnabled(false); + getChild("Edit Cost")->setVisible(false); + } + // Set values. getChild("CheckPurchase")->setValue(is_for_sale); getChild("CheckNextOwnerModify")->setValue(LLSD(BOOL(next_owner_mask & PERM_MODIFY))); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index f389396123..7ceb071c3b 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3694,6 +3694,8 @@ void LLPanelRegionEnvironment::refreshFromSource() LLEnvironment::instance().requestRegion( [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); + + setControlsEnabled(false); } void LLPanelRegionEnvironment::doApply() diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 80f75a32ad..e25a8f0b72 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -7742,6 +7742,16 @@ BOOL LLSettingsBridge::renameItem(const std::string& new_name) return LLItemBridge::renameItem(new_name); } +BOOL LLSettingsBridge::isItemRenameable() const +{ + LLViewerInventoryItem* item = getItem(); + if (item) + { + return (item->getPermissions().allowModifyBy(gAgent.getID())); + } + return FALSE; +} + bool LLSettingsBridge::canUpdateParcel() const { return LLEnvironment::instance().canAgentUpdateParcelEnvironment(); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 0b8cbadf79..8f1c21e729 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -649,6 +649,7 @@ public: virtual BOOL isMultiPreviewAllowed() { return FALSE; } virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual BOOL renameItem(const std::string& new_name); + virtual BOOL isItemRenameable() const; virtual LLSettingsType::type_e getSettingsType() const { return mSettingsType; } protected: diff --git a/indra/newview/llpaneleditwater.cpp b/indra/newview/llpaneleditwater.cpp index 5d7c6f3943..40d84d74bd 100644 --- a/indra/newview/llpaneleditwater.cpp +++ b/indra/newview/llpaneleditwater.cpp @@ -143,9 +143,9 @@ void LLPanelSettingsWaterMainTab::refresh() getChild(FIELD_WATER_FOG_DENSITY)->setValue(mWaterSettings->getWaterFogDensity()); getChild(FIELD_WATER_UNDERWATER_MOD)->setValue(mWaterSettings->getFogMod()); mTxtNormalMap->setValue(mWaterSettings->getNormalMapID()); - LLVector2 vect2 = mWaterSettings->getWave1Dir(); + LLVector2 vect2 = mWaterSettings->getWave1Dir() * -1.0; // Flip so that north and east are + getChild(FIELD_WATER_WAVE1_XY)->setValue(vect2.getValue()); - vect2 = mWaterSettings->getWave2Dir(); + vect2 = mWaterSettings->getWave2Dir() * -1.0; // Flip so that north and east are + getChild(FIELD_WATER_WAVE2_XY)->setValue(vect2.getValue()); LLVector3 vect3 = mWaterSettings->getNormalScale(); getChild(FIELD_WATER_NORMAL_SCALE_X)->setValue(vect3[0]); @@ -188,6 +188,7 @@ void LLPanelSettingsWaterMainTab::onNormalMapChanged() void LLPanelSettingsWaterMainTab::onLargeWaveChanged() { LLVector2 vect(getChild(FIELD_WATER_WAVE1_XY)->getValue()); + vect *= -1.0; // Flip so that north and east are - LL_WARNS("LAPRAS") << "Changing Large Wave from " << mWaterSettings->getWave1Dir() << " -> " << vect << LL_ENDL; mWaterSettings->setWave1Dir(vect); setIsDirty(); @@ -196,6 +197,7 @@ void LLPanelSettingsWaterMainTab::onLargeWaveChanged() void LLPanelSettingsWaterMainTab::onSmallWaveChanged() { LLVector2 vect(getChild(FIELD_WATER_WAVE2_XY)->getValue()); + vect *= -1.0; // Flip so that north and east are - LL_WARNS("LAPRAS") << "Changing Small Wave from " << mWaterSettings->getWave2Dir() << " -> " << vect << LL_ENDL; mWaterSettings->setWave2Dir(vect); setIsDirty(); diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index ecffa34ab9..1beba9db0c 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -125,6 +125,12 @@ LLPanelEnvironmentInfo::LLPanelEnvironmentInfo(): { } +LLPanelEnvironmentInfo::~LLPanelEnvironmentInfo() +{ + if (mChangeMonitor.connected()) + mChangeMonitor.disconnect(); +} + BOOL LLPanelEnvironmentInfo::postBuild() { getChild(RDG_ENVIRONMENT_SELECT)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onSwitchDefaultSelection(); }); @@ -138,6 +144,8 @@ BOOL LLPanelEnvironmentInfo::postBuild() getChild(SLD_ALTITUDES)->setCommitCallback([this](LLUICtrl *cntrl, const LLSD &value) { onAltSliderCallback(cntrl, value); }); + mChangeMonitor = LLEnvironment::instance().setEnvironmentChanged([this](LLEnvironment::EnvSelection_t env) { onEnvironmentChanged(env); }); + return TRUE; } @@ -151,7 +159,9 @@ void LLPanelEnvironmentInfo::onOpen(const LLSD& key) void LLPanelEnvironmentInfo::onVisibilityChange(BOOL new_visibility) { if (new_visibility) + { gIdleCallbacks.addFunction(onIdlePlay, this); + } else { LLFloaterSettingsPicker *picker = getSettingsPicker(false); @@ -164,6 +174,7 @@ void LLPanelEnvironmentInfo::onVisibilityChange(BOOL new_visibility) LLFloaterEditExtDayCycle *dayeditor = getEditFloater(); if (mCommitConnection.connected()) mCommitConnection.disconnect(); + if (dayeditor) { if (dayeditor->isDirty()) @@ -550,7 +561,7 @@ void LLPanelEnvironmentInfo::onBtnEdit() (LLFloaterEditExtDayCycle::KEY_CANMOD, LLSD::Boolean(true))); dayeditor->openFloater(params); - if (mCurrentEnvironment->mDayCycle) + if (mCurrentEnvironment && mCurrentEnvironment->mDayCycle) dayeditor->setEditDayCycle(mCurrentEnvironment->mDayCycle); else dayeditor->setEditDefaultDayCycle(); @@ -562,7 +573,7 @@ void LLPanelEnvironmentInfo::onBtnSelect() if (picker) { picker->setSettingsFilter(LLSettingsType::ST_NONE); - picker->setSettingsAssetId((mCurrentEnvironment->mDayCycle) ? mCurrentEnvironment->mDayCycle->getAssetId() : LLUUID::null); + picker->setSettingsAssetId((mCurrentEnvironment && mCurrentEnvironment->mDayCycle) ? mCurrentEnvironment->mDayCycle->getAssetId() : LLUUID::null); picker->openFloater(); picker->setFocus(TRUE); } @@ -674,6 +685,17 @@ void LLPanelEnvironmentInfo::onEditCommitted(LLSettingsDay::ptr_t newday) } } +void LLPanelEnvironmentInfo::onEnvironmentChanged(LLEnvironment::EnvSelection_t env) +{ + if ((isRegion() && (env == LLEnvironment::ENV_REGION)) || + ((env == LLEnvironment::ENV_PARCEL) && (getParcelId() == LLViewerParcelMgr::instance().getAgentParcelId()))) + { + mCurrentEnvironment.reset(); + refreshFromSource(); + } +} + + void LLPanelEnvironmentInfo::onPickerAssetDownloaded(LLSettingsBase::ptr_t settings) { LLSettingsVODay::buildFromOtherSetting(settings, [this](LLSettingsDay::ptr_t pday) diff --git a/indra/newview/llpanelenvironment.h b/indra/newview/llpanelenvironment.h index a632acfd03..2753e766ac 100644 --- a/indra/newview/llpanelenvironment.h +++ b/indra/newview/llpanelenvironment.h @@ -43,6 +43,7 @@ class LLPanelEnvironmentInfo : public LLPanel { public: LLPanelEnvironmentInfo(); + virtual ~LLPanelEnvironmentInfo(); virtual BOOL postBuild() override; virtual void onOpen(const LLSD& key) override; @@ -137,6 +138,8 @@ protected: LLEnvironment::EnvironmentInfo::ptr_t mCurrentEnvironment; + void onEnvironmentChanged(LLEnvironment::EnvSelection_t env); + class AltitudeData { public: @@ -162,6 +165,7 @@ private: typedef boost::signals2::connection connection_t; connection_t mCommitConnection; + connection_t mChangeMonitor; LLHandle mSettingsFloater; LLHandle mEditFloater; S32 mDirtyFlag; diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 583adcb024..4073639a20 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -43,6 +43,7 @@ #include "llagent.h" #include "llassettype.h" +#include "llfloaterperms.h" #include "llnotificationsutil.h" #include "llviewerregion.h" @@ -95,7 +96,8 @@ namespace void LLSettingsVOBase::createNewInventoryItem(LLSettingsType::type_e stype, const LLUUID &parent_id, inventory_result_fn callback) { LLTransactionID tid; - U32 nextOwnerPerm = LLPermissions::DEFAULT.getMaskNextOwner(); + U32 nextOwnerPerm = LLFloaterPerms::getNextOwnerPerms("Settings"); + nextOwnerPerm |= PERM_COPY; if (!LLEnvironment::instance().isInventoryEnabled()) { diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 868790a454..abef66dc6b 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -655,7 +655,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) LLUICtrl* edit_cost = getChild("Edit Cost"); // Check for ability to change values. - if (is_obj_modify && can_agent_sell + if (is_obj_modify && can_agent_sell && gAgent.allowOperation(PERM_TRANSFER, perm, GP_OBJECT_MANIPULATE)) { getChildView("CheckPurchase")->setEnabled(is_complete); @@ -681,6 +681,25 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) edit_cost->setEnabled(FALSE); } + // Hide any properties that are not relevant to settings + if (is_settings) + { + getChild("GroupLabel")->setEnabled(false); + getChild("GroupLabel")->setVisible(false); + getChild("CheckShareWithGroup")->setEnabled(false); + getChild("CheckShareWithGroup")->setVisible(false); + getChild("AnyoneLabel")->setEnabled(false); + getChild("AnyoneLabel")->setVisible(false); + getChild("CheckEveryoneCopy")->setEnabled(false); + getChild("CheckEveryoneCopy")->setVisible(false); + getChild("CheckPurchase")->setEnabled(false); + getChild("CheckPurchase")->setVisible(false); + getChild("ComboBoxSaleType")->setEnabled(false); + getChild("ComboBoxSaleType")->setVisible(false); + getChild("Edit Cost")->setEnabled(false); + getChild("Edit Cost")->setVisible(false); + } + // Set values. getChild("CheckPurchase")->setValue(is_for_sale); getChild("CheckNextOwnerModify")->setValue(LLSD(BOOL(next_owner_mask & PERM_MODIFY))); diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index e5e17b7963..5df9e79e74 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1368,6 +1368,13 @@ const std::string& LLViewerParcelMgr::getAgentParcelName() const } +const S32 LLViewerParcelMgr::getAgentParcelId() const +{ + if (mAgentParcel) + return mAgentParcel->getLocalID(); + return INVALID_PARCEL_ID; +} + void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_agent_region) { if(!parcel) diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 0accdda070..07cf65921b 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -277,6 +277,7 @@ public: // accessors for mAgentParcel const std::string& getAgentParcelName() const; + const S32 getAgentParcelId() const; // Create a landmark at the "appropriate" location for the // currently selected parcel. diff --git a/indra/newview/skins/default/xui/en/floater_bulk_perms.xml b/indra/newview/skins/default/xui/en/floater_bulk_perms.xml index a8d6e5fb63..d2533ef1e6 100644 --- a/indra/newview/skins/default/xui/en/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/en/floater_bulk_perms.xml @@ -7,7 +7,7 @@ name="floaterbulkperms" help_topic="floaterbulkperms" title="Adjust Content Permissions" - width="300"> + width="350"> Selection contains no editable contents. @@ -156,13 +156,26 @@ name="icon_texture" tool_tip="Textures" left_pad="2" /> - + +