From d66012f85e885679738cf8c488fd8ff460319c85 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 30 Nov 2018 17:48:08 +0200 Subject: SL-9716 [EEP] "Use Shared Environment" does not enable when applying an environment to a parcel or region --- indra/newview/llenvironment.cpp | 7 +++++++ indra/newview/llenvironment.h | 2 ++ indra/newview/llfloatermyenvironment.cpp | 2 ++ indra/newview/llinventorybridge.cpp | 1 + indra/newview/skins/default/xui/en/menu_inventory.xml | 1 - 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 580d0e785a..3a030bb09d 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -1731,6 +1731,13 @@ void LLEnvironment::clearExperienceEnvironment(LLUUID experience_id, F32 transit updateEnvironment(LLSettingsBase::Seconds(transition_time)); } +void LLEnvironment::setSharedEnvironment() +{ + clearEnvironment(LLEnvironment::ENV_LOCAL); + setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + updateEnvironment(); +} + void LLEnvironment::setExperienceEnvironment(LLUUID experience_id, LLUUID asset_id, F32 transition_time) { LLSettingsVOBase::getSettingsAsset(asset_id, diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 55881f1c75..7e35fdcfac 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -144,6 +144,8 @@ public: void setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset); void setEnvironment(EnvSelection_t env, const LLUUID &assetId); + void setSharedEnvironment(); + void clearEnvironment(EnvSelection_t env); LLSettingsDay::ptr_t getEnvironmentDay(EnvSelection_t env); LLSettingsDay::Seconds getEnvironmentDayLength(EnvSelection_t env); diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp index c34ca9e458..f93d7ce8ed 100644 --- a/indra/newview/llfloatermyenvironment.cpp +++ b/indra/newview/llfloatermyenvironment.cpp @@ -325,6 +325,7 @@ void LLFloaterMyEnvironment::onDoApply(const std::string &context) if (context == PARAMETER_REGION) { LLEnvironment::instance().updateRegion(asset_id, name, -1, -1); + LLEnvironment::instance().setSharedEnvironment(); } else if (context == PARAMETER_PARCEL) { @@ -335,6 +336,7 @@ void LLFloaterMyEnvironment::onDoApply(const std::string &context) return; } LLEnvironment::instance().updateParcel(parcel->getLocalID(), asset_id, name, -1, -1); + LLEnvironment::instance().setSharedEnvironment(); } else if (context == PARAMETER_LOCAL) { diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 6a5c124108..f2d418fc9d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -6945,6 +6945,7 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action LL_WARNS("LAPRAS") << "Applying asset ID " << asset_id << " to parcel " << parcel_id << LL_ENDL; LLEnvironment::instance().updateParcel(parcel_id, asset_id, name, -1, -1); + LLEnvironment::instance().setSharedEnvironment(); } else LLItemBridge::performAction(model, action); diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 9b24e2ffcf..33ecb4477a 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -879,7 +879,6 @@ -