summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatereditextdaycycle.cpp
diff options
context:
space:
mode:
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 788f58d480..34e49c73d0 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();
}
@@ -953,26 +954,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)
@@ -1041,7 +1051,7 @@ bool LLFloaterEditExtDayCycle::canApplyParcel() const
if (!parcel)
return false;
- return parcel->allowModifyBy(gAgent.getID(), gAgent.getGroupID()) &&
+ return parcel->allowTerraformBy(gAgent.getID()) &&
LLEnvironment::instance().isExtendedEnvironmentEnabled();
}