summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-11-02 22:34:20 +0100
committerGraham Linden <graham@lindenlab.com>2018-11-02 22:34:20 +0100
commite0a1b46e6129a0e6ca62efe18882889db96c572f (patch)
treed63f5d79302741627a7c3ae4e0de7cc1b1b22ad1 /indra/newview
parent3494fa3cfe50a0152ff9f66885a17e0adbaaf221 (diff)
parent8d333a0176d56738154c75b1a24d694467647312 (diff)
Merge
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llenvironment.cpp79
-rw-r--r--indra/newview/llenvironment.h42
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp4
-rw-r--r--indra/newview/llfloaterfixedenvironment.cpp4
-rw-r--r--indra/newview/llfloatermyenvironment.cpp5
-rw-r--r--indra/newview/llinventorybridge.cpp6
-rw-r--r--indra/newview/llpanelenvironment.cpp3
7 files changed, 94 insertions, 49 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index da558a0ba3..6bc7b8bf25 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -69,6 +69,8 @@ namespace
const std::string KEY_DAYCYCLE("day_cycle");
const std::string KEY_DAYHASH("day_hash");
const std::string KEY_DAYLENGTH("day_length");
+ const std::string KEY_DAYNAME("day_name");
+ const std::string KEY_DAYNAMES("day_names");
const std::string KEY_DAYOFFSET("day_offset");
const std::string KEY_ISDEFAULT("is_default");
const std::string KEY_PARCELID("parcel_id");
@@ -1040,7 +1042,7 @@ void LLEnvironment::updateRegion(const LLSettingsDay::ptr_t &pday, S32 day_lengt
updateParcel(INVALID_PARCEL_ID, pday, day_length, day_offset, altitudes, cb);
}
-void LLEnvironment::updateRegion(const LLUUID &asset_id, S32 day_length, S32 day_offset, LLEnvironment::altitudes_vect_t altitudes, environment_apply_fn cb)
+void LLEnvironment::updateRegion(const LLUUID &asset_id, std::string display_name, S32 day_length, S32 day_offset, LLEnvironment::altitudes_vect_t altitudes, environment_apply_fn cb)
{
if (!isExtendedEnvironmentEnabled())
{
@@ -1049,7 +1051,7 @@ void LLEnvironment::updateRegion(const LLUUID &asset_id, S32 day_length, S32 day
return;
}
- updateParcel(INVALID_PARCEL_ID, asset_id, day_length, day_offset, altitudes, cb);
+ updateParcel(INVALID_PARCEL_ID, asset_id, display_name, day_length, day_offset, altitudes, cb);
}
void LLEnvironment::updateRegion(const LLSettingsSky::ptr_t &psky, S32 day_length, S32 day_offset, LLEnvironment::altitudes_vect_t altitudes, environment_apply_fn cb)
@@ -1099,12 +1101,12 @@ void LLEnvironment::requestParcel(S32 parcel_id, environment_apply_fn cb)
[this, parcel_id, cb]() { coroRequestEnvironment(parcel_id, cb); });
}
-void LLEnvironment::updateParcel(S32 parcel_id, const LLUUID &asset_id, S32 day_length, S32 day_offset, LLEnvironment::altitudes_vect_t altitudes, environment_apply_fn cb)
+void LLEnvironment::updateParcel(S32 parcel_id, const LLUUID &asset_id, std::string display_name, S32 day_length, S32 day_offset, LLEnvironment::altitudes_vect_t altitudes, environment_apply_fn cb)
{
+ UpdateInfo::ptr_t updates(std::make_shared<UpdateInfo>(asset_id, display_name, day_length, day_offset, altitudes));
std::string coroname =
LLCoros::instance().launch("LLEnvironment::coroUpdateEnvironment",
- [this, parcel_id, asset_id, day_length, day_offset, altitudes, cb]() { coroUpdateEnvironment(parcel_id, NO_TRACK,
- LLSettingsDay::ptr_t(), asset_id, day_length, day_offset, altitudes, cb); });
+ [this, parcel_id, updates, cb]() { coroUpdateEnvironment(parcel_id, NO_TRACK, updates, cb); });
}
void LLEnvironment::onUpdateParcelAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, S32 parcel_id, S32 day_length, S32 day_offset, LLEnvironment::altitudes_vect_t altitudes)
@@ -1149,10 +1151,11 @@ void LLEnvironment::updateParcel(S32 parcel_id, const LLSettingsWater::ptr_t &pw
void LLEnvironment::updateParcel(S32 parcel_id, const LLSettingsDay::ptr_t &pday, S32 day_length, S32 day_offset, LLEnvironment::altitudes_vect_t altitudes, environment_apply_fn cb)
{
+ UpdateInfo::ptr_t updates(std::make_shared<UpdateInfo>(pday, day_length, day_offset, altitudes));
+
std::string coroname =
LLCoros::instance().launch("LLEnvironment::coroUpdateEnvironment",
- [this, parcel_id, pday, day_length, day_offset, altitudes, cb]() { coroUpdateEnvironment(parcel_id, NO_TRACK,
- pday, LLUUID::null, day_length, day_offset, altitudes, cb); });
+ [this, parcel_id, updates, cb]() { coroUpdateEnvironment(parcel_id, NO_TRACK, updates, cb); });
}
@@ -1221,8 +1224,7 @@ void LLEnvironment::coroRequestEnvironment(S32 parcel_id, LLEnvironment::environ
// }
}
-void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, S32 track_no, LLSettingsDay::ptr_t pday,
- LLUUID settings_asset, S32 day_length, S32 day_offset, LLEnvironment::altitudes_vect_t altitudes, LLEnvironment::environment_apply_fn apply)
+void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, S32 track_no, UpdateInfo::ptr_t updates, environment_apply_fn apply)
{
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
@@ -1233,45 +1235,34 @@ void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, S32 track_no, LLSetting
if (url.empty())
return;
-// if (day_length < 1)
-// {
-// day_length = getEnvironmentDayLength((parcel_id == INVALID_PARCEL_ID) ? ENV_REGION : ENV_PARCEL).value();
-// if ((day_length < 1) && (parcel_id != INVALID_PARCEL_ID))
-// day_length = getEnvironmentDayLength(ENV_REGION).value();
-// }
-//
-// if (day_offset < 1)
-// {
-// day_offset = getEnvironmentDayOffset((parcel_id == INVALID_PARCEL_ID) ? ENV_REGION : ENV_PARCEL).value();
-// if ((day_offset < 1) && (parcel_id != INVALID_PARCEL_ID))
-// day_offset = getEnvironmentDayOffset(ENV_REGION).value();
-// }
-
LLSD body(LLSD::emptyMap());
body[KEY_ENVIRONMENT] = LLSD::emptyMap();
if (track_no == NO_TRACK)
{ // day length and offset are only applicable if we are addressing the entire day cycle.
- if (day_length > 0)
- body[KEY_ENVIRONMENT][KEY_DAYLENGTH] = day_length;
- if (day_offset > 0)
- body[KEY_ENVIRONMENT][KEY_DAYOFFSET] = day_offset;
+ if (updates->mDayLength > 0)
+ body[KEY_ENVIRONMENT][KEY_DAYLENGTH] = updates->mDayLength;
+ if (updates->mDayOffset > 0)
+ body[KEY_ENVIRONMENT][KEY_DAYOFFSET] = updates->mDayOffset;
- if ((parcel_id == INVALID_PARCEL_ID) && (altitudes.size() == 3))
+ if ((parcel_id == INVALID_PARCEL_ID) && (updates->mAltitudes.size() == 3))
{ // only test for altitude changes if we are changing the region.
body[KEY_ENVIRONMENT][KEY_TRACKALTS] = LLSD::emptyArray();
for (S32 i = 0; i < 3; ++i)
{
- body[KEY_ENVIRONMENT][KEY_TRACKALTS][i] = altitudes[i];
+ body[KEY_ENVIRONMENT][KEY_TRACKALTS][i] = updates->mAltitudes[i];
}
}
}
- if (pday)
- body[KEY_ENVIRONMENT][KEY_DAYCYCLE] = pday->getSettings();
- else if (!settings_asset.isNull())
- body[KEY_ENVIRONMENT][KEY_DAYASSET] = settings_asset;
-
+ if (updates->mDayp)
+ body[KEY_ENVIRONMENT][KEY_DAYCYCLE] = updates->mDayp->getSettings();
+ else if (!updates->mSettingsAsset.isNull())
+ {
+ body[KEY_ENVIRONMENT][KEY_DAYASSET] = updates->mSettingsAsset;
+ if (!updates->mDayName.empty())
+ body[KEY_ENVIRONMENT][KEY_DAYNAME] = updates->mDayName;
+ }
LL_WARNS("LAPRAS") << "Body = " << body << LL_ENDL;
@@ -1401,7 +1392,9 @@ LLEnvironment::EnvironmentInfo::EnvironmentInfo():
mDayCycle(),
mAltitudes({ { 0.0, 0.0, 0.0, 0.0 } }),
mIsDefault(false),
- mIsLegacy(false)
+ mIsLegacy(false),
+ mDayCycleName(),
+ mNameList()
{
}
@@ -1441,6 +1434,22 @@ LLEnvironment::EnvironmentInfo::ptr_t LLEnvironment::EnvironmentInfo::extract(LL
pinfo->mAssetId = environment[KEY_DAYASSET].asUUID();
}
+ if (environment.has(KEY_DAYNAMES))
+ {
+ LLSD daynames = environment[KEY_DAYNAMES];
+ if (daynames.isArray())
+ {
+ for (S32 index = 0; index < pinfo->mNameList.size(); ++index)
+ {
+ pinfo->mNameList[index] = daynames[index].asString();
+ }
+ }
+ else if (daynames.isString())
+ {
+ pinfo->mDayCycleName = daynames.asString();
+ }
+ }
+
return pinfo;
}
diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h
index 63020ab5d7..9e943cce00 100644
--- a/indra/newview/llenvironment.h
+++ b/indra/newview/llenvironment.h
@@ -69,7 +69,8 @@ public:
{
EnvironmentInfo();
- typedef std::shared_ptr<EnvironmentInfo> ptr_t;
+ typedef std::shared_ptr<EnvironmentInfo> ptr_t;
+ typedef std::array<std::string, 5> namelist_t;
S32 mParcelId;
LLUUID mRegionId;
@@ -81,6 +82,8 @@ public:
bool mIsDefault;
LLUUID mAssetId;
bool mIsLegacy;
+ std::string mDayCycleName;
+ namelist_t mNameList;
static ptr_t extract(LLSD);
static ptr_t extractLegacy(LLSD);
@@ -192,13 +195,13 @@ public:
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, altitudes_vect_t altitudes = altitudes_vect_t(), environment_apply_fn cb = environment_apply_fn());
+ void updateRegion(const LLUUID &asset_id, std::string display_name, S32 day_length, S32 day_offset, altitudes_vect_t altitudes = altitudes_vect_t(), environment_apply_fn cb = environment_apply_fn());
void updateRegion(const LLSettingsDay::ptr_t &pday, S32 day_length, S32 day_offset, altitudes_vect_t altitudes = altitudes_vect_t(), environment_apply_fn cb = environment_apply_fn());
void updateRegion(const LLSettingsSky::ptr_t &psky, S32 day_length, S32 day_offset, altitudes_vect_t altitudes = altitudes_vect_t(), environment_apply_fn cb = environment_apply_fn());
void updateRegion(const LLSettingsWater::ptr_t &pwater, S32 day_length, S32 day_offset, altitudes_vect_t altitudes = altitudes_vect_t(), environment_apply_fn cb = environment_apply_fn());
void resetRegion(environment_apply_fn cb = environment_apply_fn());
void requestParcel(S32 parcel_id, environment_apply_fn cb = environment_apply_fn());
- void updateParcel(S32 parcel_id, const LLUUID &asset_id, S32 day_length, S32 day_offset, altitudes_vect_t altitudes = altitudes_vect_t(), environment_apply_fn cb = environment_apply_fn());
+ void updateParcel(S32 parcel_id, const LLUUID &asset_id, std::string display_name, S32 day_length, S32 day_offset, altitudes_vect_t altitudes = altitudes_vect_t(), environment_apply_fn cb = environment_apply_fn());
void updateParcel(S32 parcel_id, const LLSettingsDay::ptr_t &pday, S32 day_length, S32 day_offset, altitudes_vect_t altitudes = altitudes_vect_t(), environment_apply_fn cb = environment_apply_fn());
void updateParcel(S32 parcel_id, const LLSettingsSky::ptr_t &psky, S32 day_length, S32 day_offset, altitudes_vect_t altitudes = altitudes_vect_t(), environment_apply_fn cb = environment_apply_fn());
void updateParcel(S32 parcel_id, const LLSettingsWater::ptr_t &pwater, S32 day_length, S32 day_offset, altitudes_vect_t altitudes = altitudes_vect_t(), environment_apply_fn cb = environment_apply_fn());
@@ -319,13 +322,42 @@ private:
DayInstance::ptr_t getSelectedEnvironmentInstance();
-
void updateCloudScroll();
void onParcelChange();
+ struct UpdateInfo
+ {
+ typedef std::shared_ptr<UpdateInfo> ptr_t;
+
+ UpdateInfo(LLSettingsDay::ptr_t pday, S32 day_length, S32 day_offset, altitudes_vect_t altitudes):
+ mDayp(pday),
+ mSettingsAsset(),
+ mDayLength(day_length),
+ mDayOffset(day_offset),
+ mAltitudes(altitudes),
+ mDayName()
+ {}
+
+ UpdateInfo(LLUUID settings_asset, std::string name, S32 day_length, S32 day_offset, altitudes_vect_t altitudes) :
+ mDayp(),
+ mSettingsAsset(settings_asset),
+ mDayLength(day_length),
+ mDayOffset(day_offset),
+ mAltitudes(altitudes),
+ mDayName(name)
+ {}
+
+ LLSettingsDay::ptr_t mDayp;
+ LLUUID mSettingsAsset;
+ S32 mDayLength;
+ S32 mDayOffset;
+ altitudes_vect_t mAltitudes;
+ std::string mDayName;
+ };
+
void coroRequestEnvironment(S32 parcel_id, environment_apply_fn apply);
- void coroUpdateEnvironment(S32 parcel_id, S32 track_no, LLSettingsDay::ptr_t pday, LLUUID settings_asset, S32 day_length, S32 day_offset, altitudes_vect_t altitudes, environment_apply_fn apply);
+ void coroUpdateEnvironment(S32 parcel_id, S32 track_no, UpdateInfo::ptr_t updates, environment_apply_fn apply);
void coroResetEnvironment(S32 parcel_id, S32 track_no, environment_apply_fn apply);
void recordEnvironment(S32 parcel_id, EnvironmentInfo::ptr_t environment);
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index aff9dec0db..5a47e02926 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -1363,7 +1363,7 @@ void LLFloaterEditExtDayCycle::doApplyEnvironment(const std::string &where, cons
if (mInventoryItem && !isDirty())
{
- LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), -1, -1);
+ LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), mInventoryItem->getName(), -1, -1);
}
else
{
@@ -1374,7 +1374,7 @@ void LLFloaterEditExtDayCycle::doApplyEnvironment(const std::string &where, cons
{
if (mInventoryItem && !isDirty())
{
- LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), -1, -1);
+ LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), mInventoryItem->getName(), -1, -1);
}
else
{
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index ad4dcd567a..d35dd5ec98 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -490,7 +490,7 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where)
if (mInventoryItem && !isDirty())
{
- LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), -1, -1);
+ LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), mInventoryItem->getName(), -1, -1);
}
else if (mSettings->getSettingsType() == "sky")
{
@@ -505,7 +505,7 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where)
{
if (mInventoryItem && !isDirty())
{
- LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), -1, -1);
+ LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), mInventoryItem->getName(), -1, -1);
}
else if (mSettings->getSettingsType() == "sky")
{
diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp
index 6dcff7c264..c34ca9e458 100644
--- a/indra/newview/llfloatermyenvironment.cpp
+++ b/indra/newview/llfloatermyenvironment.cpp
@@ -320,10 +320,11 @@ void LLFloaterMyEnvironment::onDoApply(const std::string &context)
if (itemp && itemp->getInventoryType() == LLInventoryType::IT_SETTINGS)
{
LLUUID asset_id = itemp->getAssetUUID();
+ std::string name = itemp->getName();
if (context == PARAMETER_REGION)
{
- LLEnvironment::instance().updateRegion(asset_id, -1, -1);
+ LLEnvironment::instance().updateRegion(asset_id, name, -1, -1);
}
else if (context == PARAMETER_PARCEL)
{
@@ -333,7 +334,7 @@ void LLFloaterMyEnvironment::onDoApply(const std::string &context)
LL_WARNS("ENVIRONMENT") << "Unable to determine parcel." << LL_ENDL;
return;
}
- LLEnvironment::instance().updateParcel(parcel->getLocalID(), asset_id, -1, -1);
+ LLEnvironment::instance().updateParcel(parcel->getLocalID(), asset_id, name, -1, -1);
}
else if (context == PARAMETER_LOCAL)
{
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 3b6778892f..bc953f3ed1 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -6933,6 +6933,7 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action
if (!item)
return;
LLUUID asset_id = item->getAssetUUID();
+ std::string name = item->getName();
LLParcel *parcel = LLViewerParcelMgr::instance().getAgentOrSelectedParcel();
if (!parcel)
@@ -6943,7 +6944,7 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action
S32 parcel_id = parcel->getLocalID();
LL_WARNS("LAPRAS") << "Applying asset ID " << asset_id << " to parcel " << parcel_id << LL_ENDL;
- LLEnvironment::instance().updateParcel(parcel_id, asset_id, -1, -1);
+ LLEnvironment::instance().updateParcel(parcel_id, asset_id, name, -1, -1);
}
else if ("apply_settings_region" == action)
{
@@ -6952,10 +6953,11 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action
if (!item)
return;
LLUUID asset_id = item->getAssetUUID();
+ std::string name = item->getName();
LL_WARNS("LAPRAS") << "Applyng asset id " << asset_id << " to region." << LL_ENDL;
- LLEnvironment::instance().updateRegion(asset_id, -1, -1);
+ LLEnvironment::instance().updateRegion(asset_id, name, -1, -1);
}
else
LLItemBridge::performAction(model, action);
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index e049fa7842..e848c6eaf1 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -667,7 +667,8 @@ void LLPanelEnvironmentInfo::doApply()
else if (rdo_selection == 1)
{
LLEnvironment::instance().updateParcel(parcel_id,
- mCurrentEnvironment->mDayCycle->getAssetId(), mCurrentEnvironment->mDayLength.value(), mCurrentEnvironment->mDayOffset.value(), alts,
+ mCurrentEnvironment->mDayCycle->getAssetId(), std::string(), mCurrentEnvironment->mDayLength.value(),
+ mCurrentEnvironment->mDayOffset.value(), alts,
[that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); });
}
else