summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatereditextdaycycle.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/llfloatereditextdaycycle.cpp
parent2a613d7363c4e91a7258d4f0ea3971db1569e788 (diff)
Reconnect apply to region and parcel reconnected to interface.
Diffstat (limited to 'indra/newview/llfloatereditextdaycycle.cpp')
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp36
1 files changed, 23 insertions, 13 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 4703a1ec16..a9f0cffef1 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -267,7 +267,8 @@ void LLFloaterEditExtDayCycle::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());
LLFloater::refresh();
}
@@ -950,26 +951,35 @@ void LLFloaterEditExtDayCycle::doApplyUpdateInventory()
void LLFloaterEditExtDayCycle::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, mEditDay);
+ }
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;
+
+ LLEnvironment::instance().updateParcel(parcel->getLocalID(), mEditDay, -1, -1);
+ }
else if (where == ACTION_APPLY_REGION)
- env = LLEnvironment::ENV_REGION;
+ {
+ LLEnvironment::instance().updateRegion(mEditDay, -1, -1);
+ }
else
{
LL_WARNS("ENVIRONMENT") << "Unknown apply '" << where << "'" << LL_ENDL;
return;
}
- LLEnvironment::instance().setEnvironment(env, mEditDay);
- if (updateSimulator)
- {
- LL_WARNS("ENVIRONMENT") << "Attempting apply" << LL_ENDL;
- }
}
void LLFloaterEditExtDayCycle::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results)
@@ -1038,7 +1048,7 @@ bool LLFloaterEditExtDayCycle::canApplyParcel() const
if (!parcel)
return false;
- return parcel->allowModifyBy(gAgent.getID(), gAgent.getGroupID()) &&
+ return parcel->allowTerraformBy(gAgent.getID()) &&
LLEnvironment::instance().isExtendedEnvironmentEnabled();
}