summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterland.cpp
diff options
context:
space:
mode:
authorsimon@lindenlab.com <simon@lindenlab.com>2011-07-07 17:42:54 -0700
committersimon@lindenlab.com <simon@lindenlab.com>2011-07-07 17:42:54 -0700
commitf5bd2109c27b098dd73a9578f1f032b6ff9e4c2d (patch)
tree64ba1a6a958c86cd37efce952bb666a5d06dea45 /indra/newview/llfloaterland.cpp
parent918238dd18f74ee2783d55dfb961e8f44b2f4b1b (diff)
Revert code fo ER-1016 - "Remove ability for anyone to edit terrain"
and muck with the "About Land" Options tab one more time.
Diffstat (limited to 'indra/newview/llfloaterland.cpp')
-rw-r--r--indra/newview/llfloaterland.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 45d215664e..b373a6afa0 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -1804,6 +1804,7 @@ LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel)
mCheckEditGroupObjects(NULL),
mCheckAllObjectEntry(NULL),
mCheckGroupObjectEntry(NULL),
+ mCheckEditLand(NULL),
mCheckSafe(NULL),
mCheckFly(NULL),
mCheckGroupScripts(NULL),
@@ -1837,8 +1838,8 @@ BOOL LLPanelLandOptions::postBuild()
mCheckGroupObjectEntry = getChild<LLCheckBoxCtrl>( "group object entry check");
childSetCommitCallback("group object entry check", onCommitAny, this);
-// mCheckEditLand = getChild<LLCheckBoxCtrl>( "edit land check");
-// childSetCommitCallback("edit land check", onCommitAny, this);
+ mCheckEditLand = getChild<LLCheckBoxCtrl>( "edit land check");
+ childSetCommitCallback("edit land check", onCommitAny, this);
mCheckGroupScripts = getChild<LLCheckBoxCtrl>( "check group scripts");
@@ -1953,6 +1954,9 @@ void LLPanelLandOptions::refresh()
mCheckGroupObjectEntry ->set(FALSE);
mCheckGroupObjectEntry ->setEnabled(FALSE);
+ mCheckEditLand ->set(FALSE);
+ mCheckEditLand ->setEnabled(FALSE);
+
mCheckSafe ->set(FALSE);
mCheckSafe ->setEnabled(FALSE);
@@ -2001,6 +2005,10 @@ void LLPanelLandOptions::refresh()
mCheckGroupObjectEntry ->set( parcel->getAllowGroupObjectEntry() || parcel->getAllowAllObjectEntry());
mCheckGroupObjectEntry ->setEnabled( can_change_options && !parcel->getAllowAllObjectEntry() );
+ BOOL can_change_terraform = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_EDIT);
+ mCheckEditLand ->set( parcel->getAllowTerraform() );
+ mCheckEditLand ->setEnabled( can_change_terraform );
+
mCheckSafe ->set( !parcel->getAllowDamage() );
mCheckSafe ->setEnabled( can_change_options );
@@ -2225,6 +2233,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata)
BOOL create_group_objects = self->mCheckEditGroupObjects->get() || self->mCheckEditObjects->get();
BOOL all_object_entry = self->mCheckAllObjectEntry->get();
BOOL group_object_entry = self->mCheckGroupObjectEntry->get() || self->mCheckAllObjectEntry->get();
+ BOOL allow_terraform = self->mCheckEditLand->get();
BOOL allow_damage = !self->mCheckSafe->get();
BOOL allow_fly = self->mCheckFly->get();
BOOL allow_landmark = TRUE; // cannot restrict landmark creation
@@ -2254,7 +2263,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata)
parcel->setParcelFlag(PF_CREATE_GROUP_OBJECTS, create_group_objects);
parcel->setParcelFlag(PF_ALLOW_ALL_OBJECT_ENTRY, all_object_entry);
parcel->setParcelFlag(PF_ALLOW_GROUP_OBJECT_ENTRY, group_object_entry);
- parcel->setParcelFlag(PF_ALLOW_TERRAFORM, FALSE); // was allow_terraform
+ parcel->setParcelFlag(PF_ALLOW_TERRAFORM, allow_terraform);
parcel->setParcelFlag(PF_ALLOW_DAMAGE, allow_damage);
parcel->setParcelFlag(PF_ALLOW_FLY, allow_fly);
parcel->setParcelFlag(PF_ALLOW_LANDMARK, allow_landmark);