summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterfixedenvironment.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-06-04 16:50:13 -0700
committerRider Linden <rider@lindenlab.com>2018-06-04 16:50:13 -0700
commitb06803225bff30e863ea18cae1d33f42a4fd937e (patch)
tree7cc96c7fcb573bc20dc6db93a606b846474ce7c9 /indra/newview/llfloaterfixedenvironment.cpp
parent2a613d7363c4e91a7258d4f0ea3971db1569e788 (diff)
Reconnect apply to region and parcel reconnected to interface.
Diffstat (limited to 'indra/newview/llfloaterfixedenvironment.cpp')
-rw-r--r--indra/newview/llfloaterfixedenvironment.cpp39
1 files changed, 28 insertions, 11 deletions
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index 6c1080294d..e7b8481caa 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -160,6 +160,8 @@ void LLFloaterFixedEnvironment::refresh()
mFlyoutControl->setMenuItemEnabled(ACTION_SAVE, is_inventory_avail);
mFlyoutControl->setMenuItemEnabled(ACTION_SAVEAS, is_inventory_avail);
+ mFlyoutControl->setMenuItemEnabled(ACTION_APPLY_PARCEL, canApplyParcel());
+ mFlyoutControl->setMenuItemEnabled(ACTION_APPLY_REGION, canApplyRegion());
mTxtName->setValue(mSettings->getName());
@@ -283,26 +285,41 @@ void LLFloaterFixedEnvironment::doApplyUpdateInventory()
void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where)
{
- LLEnvironment::EnvSelection_t env(LLEnvironment::ENV_DEFAULT);
- bool updateSimulator( where != ACTION_APPLY_LOCAL );
-
if (where == ACTION_APPLY_LOCAL)
- env = LLEnvironment::ENV_LOCAL;
+ {
+ LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mSettings);
+ }
else if (where == ACTION_APPLY_PARCEL)
- env = LLEnvironment::ENV_PARCEL;
+ {
+ LLParcelSelectionHandle handle(LLViewerParcelMgr::instance().getParcelSelection());
+ LLParcel *parcel(nullptr);
+
+ if (handle)
+ parcel = handle->getParcel();
+ if (!parcel)
+ parcel = LLViewerParcelMgr::instance().getAgentParcel();
+
+ if (!parcel)
+ return;
+
+ if (mSettings->getSettingType() == "sky")
+ LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast<LLSettingsSky>(mSettings), -1, -1);
+ else if (mSettings->getSettingType() == "water")
+ LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast<LLSettingsWater>(mSettings), -1, -1);
+ }
else if (where == ACTION_APPLY_REGION)
- env = LLEnvironment::ENV_REGION;
+ {
+ if (mSettings->getSettingType() == "sky")
+ LLEnvironment::instance().updateRegion(std::static_pointer_cast<LLSettingsSky>(mSettings), -1, -1);
+ else if (mSettings->getSettingType() == "water")
+ LLEnvironment::instance().updateRegion(std::static_pointer_cast<LLSettingsWater>(mSettings), -1, -1);
+ }
else
{
LL_WARNS("ENVIRONMENT") << "Unknown apply '" << where << "'" << LL_ENDL;
return;
}
- LLEnvironment::instance().setEnvironment(env, mSettings);
- if (updateSimulator)
- {
- LL_WARNS("ENVIRONMENT") << "Attempting apply" << LL_ENDL;
- }
}
void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results)