Implemented basic 'awareness' of objects flagged as permanent.

This commit is contained in:
Shyotl
2012-08-04 20:46:51 -05:00
parent aca3e8f6c4
commit b847c53395
18 changed files with 605 additions and 96 deletions

View File

@@ -41,6 +41,9 @@ const U32 FLAGS_TAKES_MONEY = (1U << 9);
const U32 FLAGS_PHANTOM = (1U << 10);
const U32 FLAGS_INVENTORY_EMPTY = (1U << 11);
const U32 FLAGS_AFFECTS_NAVMESH = (1U << 12);
const U32 FLAGS_CHARACTER = (1U << 13);
const U32 FLAGS_VOLUME_DETECT = (1U << 14);
const U32 FLAGS_INCLUDE_IN_SEARCH = (1U << 15);
const U32 FLAGS_ALLOW_INVENTORY_DROP = (1U << 16);
@@ -54,6 +57,11 @@ const U32 FLAGS_CAMERA_SOURCE = (1U << 22);
//const U32 FLAGS_UNUSED_001 = (1U << 23); // was FLAGS_CAST_SHADOWS
//const U32 FLAGS_UNUSED_002 = (1U << 24);
//const U32 FLAGS_UNUSED_003 = (1U << 25);
//const U32 FLAGS_UNUSED_004 = (1U << 26);
//const U32 FLAGS_UNUSED_005 = (1U << 27);
const U32 FLAGS_OBJECT_OWNER_MODIFY = (1U << 28);
const U32 FLAGS_TEMPORARY_ON_REZ = (1U << 29);

View File

@@ -479,9 +479,12 @@ BOOL LLManipRotate::handleMouseUp(S32 x, S32 y, MASK mask)
{
LLSelectNode* selectNode = *iter;
LLViewerObject* object = selectNode->getObject();
LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit();
// have permission to move and object is root of selection or individually selected
if (object->permMove() && (object->isRootEdit() || selectNode->mIndividualSelection))
if (object->permMove() && !object->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
(object->isRootEdit() || selectNode->mIndividualSelection))
{
object->mUnselectedChildrenPositions.clear() ;
}
@@ -567,9 +570,12 @@ void LLManipRotate::drag( S32 x, S32 y )
{
LLSelectNode* selectNode = *iter;
LLViewerObject* object = selectNode->getObject();
LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit();
// have permission to move and object is root of selection or individually selected
if (object->permMove() && (object->isRootEdit() || selectNode->mIndividualSelection))
if (object->permMove() && !object->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
(object->isRootEdit() || selectNode->mIndividualSelection))
{
if (!object->isRootEdit())
{
@@ -621,9 +627,11 @@ void LLManipRotate::drag( S32 x, S32 y )
{
LLSelectNode* selectNode = *iter;
LLViewerObject* object = selectNode->getObject();
LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit();
// to avoid cumulative position changes we calculate the objects new position using its saved position
if (object && object->permMove())
if (object && object->permMove() && !object->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced()))
{
LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter );
@@ -704,7 +712,10 @@ void LLManipRotate::drag( S32 x, S32 y )
{
LLSelectNode* selectNode = *iter;
LLViewerObject*cur = selectNode->getObject();
if( cur->permModify() && cur->permMove() && !cur->isAvatar())
LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
!cur->isAvatar())
{
selectNode->mLastRotation = cur->getRotation();
selectNode->mLastPositionLocal = cur->getPosition();
@@ -1872,7 +1883,10 @@ BOOL LLManipRotate::canAffectSelection()
{
virtual bool apply(LLViewerObject* objectp)
{
return objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit();
return objectp->permMove() && !objectp->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
(objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
}
} func;
can_rotate = mObjectSelection->applyToObjects(&func);

View File

@@ -825,7 +825,10 @@ void LLManipScale::drag( S32 x, S32 y )
{
LLSelectNode* selectNode = *iter;
LLViewerObject*cur = selectNode->getObject();
if( cur->permModify() && cur->permMove() && !cur->isAvatar())
LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
!cur->isAvatar())
{
selectNode->mLastScale = cur->getScale();
selectNode->mLastPositionLocal = cur->getPosition();
@@ -972,7 +975,10 @@ void LLManipScale::dragCorner( S32 x, S32 y )
{
LLSelectNode* selectNode = *iter;
LLViewerObject* cur = selectNode->getObject();
if( cur->permModify() && cur->permMove() && !cur->isAvatar() )
LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
!cur->isAvatar() )
{
const LLVector3& scale = selectNode->mSavedScale;
@@ -994,7 +1000,10 @@ void LLManipScale::dragCorner( S32 x, S32 y )
{
LLSelectNode* selectNode = *iter;
LLViewerObject* cur = selectNode->getObject();
if( cur->permModify() && cur->permMove() && !cur->isAvatar() && cur->isRootEdit() )
LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
!cur->isAvatar() && cur->isRootEdit() )
{
const LLVector3& scale = selectNode->mSavedScale;
cur->setScale( scale_factor * scale );
@@ -1042,7 +1051,10 @@ void LLManipScale::dragCorner( S32 x, S32 y )
{
LLSelectNode* selectNode = *iter;
LLViewerObject*cur = selectNode->getObject();
if( cur->permModify() && cur->permMove() && !cur->isAvatar() && !cur->isRootEdit() )
LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
!cur->isAvatar() && !cur->isRootEdit() )
{
const LLVector3& scale = selectNode->mSavedScale;
cur->setScale( scale_factor * scale, FALSE );
@@ -1250,7 +1262,10 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto
{
LLSelectNode* selectNode = *iter;
LLViewerObject*cur = selectNode->getObject();
if( cur->permModify() && cur->permMove() && !cur->isAvatar() )
LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit();
if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
!cur->isAvatar() )
{
LLBBox cur_bbox = cur->getBoundingBoxAgent();
LLVector3 start_local = cur_bbox.agentToLocal( drag_start_agent );
@@ -2057,7 +2072,10 @@ BOOL LLManipScale::canAffectSelection()
{
virtual bool apply(LLViewerObject* objectp)
{
return objectp->permModify() && objectp->permMove() && !objectp->isSeat();
LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit();
return objectp->permModify() && objectp->permMove() && !objectp->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
!objectp->isSeat();
}
} func;
can_scale = mObjectSelection->applyToObjects(&func);

View File

@@ -705,7 +705,9 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
}
}
if (object->permMove())
LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit();
if (object->permMove() && !object->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced()))
{
// handle attachments in local space
if (object->isAttachment() && object->mDrawable.notNull())
@@ -2328,7 +2330,10 @@ BOOL LLManipTranslate::canAffectSelection()
{
virtual bool apply(LLViewerObject* objectp)
{
return objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit();
return objectp->permMove() && !objectp->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
(objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
}
} func;
can_move = mObjectSelection->applyToObjects(&func);

View File

@@ -121,7 +121,7 @@ void LLPanelContents::getState(LLViewerObject *objectp )
// BUG? Check for all objects being editable?
bool editable = gAgent.isGodlike()
|| (objectp->permModify()
|| (objectp->permModify() && !objectp->isPermanentEnforced()
&& ( objectp->permYouOwner() || ( !group_id.isNull() && gAgent.isInGroup(group_id) ))); // solves SL-23488
BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME );
@@ -150,6 +150,9 @@ void LLPanelContents::getState(LLViewerObject *objectp )
all_volume &&
((LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() == 1)
|| (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1)));
getChildView("button permissions")->setEnabled(!objectp->isPermanentEnforced());
mPanelInventory->setEnabled(!objectp->isPermanentEnforced());
}

View File

@@ -516,7 +516,7 @@ void LLPanelFace::getState()
&& objectp->getPCode() == LL_PCODE_VOLUME
&& objectp->permModify())
{
BOOL editable = objectp->permModify();
BOOL editable = objectp->permModify() && !objectp->isPermanentEnforced();
// only turn on auto-adjust button if there is a media renderer and the media is loaded

View File

@@ -477,10 +477,10 @@ void LLPanelObject::getState( )
}
// can move or rotate only linked group with move permissions, or sub-object with move and modify perms
BOOL enable_move = objectp->permMove() && ((!objectp->isAttachment() && objectp->permModify()) || !gSavedSettings.getBOOL("EditLinkedParts"));
BOOL enable_scale = objectp->permMove() && objectp->permModify();
BOOL enable_rotate = objectp->permMove() && ((objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts"));
BOOL enable_link = objectp->permMove() && ((!objectp->isAttachment() && objectp->permModify()) || !gSavedSettings.getBOOL("EditLinkedParts"));
BOOL enable_move = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && !objectp->isAttachment() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
BOOL enable_scale = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && objectp->permModify();
BOOL enable_rotate = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && ( (objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts"));
childSetEnabled("build_math_constants",true);
S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
BOOL single_volume = (LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ))
@@ -527,8 +527,8 @@ void LLPanelObject::getState( )
mCtrlPosX->setEnabled(enable_move);
mCtrlPosY->setEnabled(enable_move);
mCtrlPosZ->setEnabled(enable_move);
mBtnLinkObj->setEnabled((enable_link && !single_volume));
mBtnUnlinkObj->setEnabled((enable_link && (selected_count > 1)));
mBtnLinkObj->setEnabled((enable_move && !single_volume));
mBtnUnlinkObj->setEnabled((enable_move && (selected_count > 1)));
mBtnCopyPos->setEnabled(enable_move);
mBtnPastePos->setEnabled(enable_move);
mBtnPastePosClip->setEnabled(enable_move);
@@ -623,9 +623,15 @@ void LLPanelObject::getState( )
childSetVisible("select_single", TRUE);
childSetEnabled("select_single", TRUE);
}
BOOL is_flexible = volobjp && volobjp->isFlexible();
BOOL is_permanent = root_objectp->flagObjectPermanent();
BOOL is_permanent_enforced = root_objectp->isPermanentEnforced();
BOOL is_character = root_objectp->flagCharacter();
llassert(!is_permanent || !is_character); // should never have a permanent object that is also a character
// Lock checkbox - only modifiable if you own the object.
BOOL self_owned = (gAgent.getID() == owner_id);
mCheckLock->setEnabled( roots_selected > 0 && self_owned );
mCheckLock->setEnabled( roots_selected > 0 && self_owned && !is_permanent_enforced);
// More lock and debit checkbox - get the values
BOOL valid;
@@ -655,22 +661,26 @@ void LLPanelObject::getState( )
}
}
BOOL is_flexible = volobjp && volobjp->isFlexible();
// Physics checkbox
mIsPhysical = root_objectp->flagUsePhysics();
llassert(!is_permanent || !mIsPhysical); // should never have a permanent object that is also physical
mCheckPhysics->set( mIsPhysical );
mCheckPhysics->setEnabled( roots_selected>0
&& (editable || gAgent.isGodlike())
&& !is_flexible);
&& !is_flexible && !is_permanent);
mIsTemporary = root_objectp->flagTemporaryOnRez();
llassert(!is_permanent || !mIsTemporary); // should never has a permanent object that is also temporary
mCheckTemporary->set( mIsTemporary );
mCheckTemporary->setEnabled( roots_selected>0 && editable );
mCheckTemporary->setEnabled( roots_selected>0 && editable && !is_permanent);
mIsPhantom = root_objectp->flagPhantom();
BOOL is_volume_detect = root_objectp->flagVolumeDetect();
llassert(!is_character || !mIsPhantom); // should never have a character that is also a phantom
mCheckPhantom->set( mIsPhantom );
mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible );
mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible && !is_permanent_enforced && !is_character && !is_volume_detect);
// Update material part
// slightly inefficient - materials are unique per object, not per TE
@@ -724,6 +734,7 @@ void LLPanelObject::getState( )
BOOL hole_enabled = FALSE;
F32 scale_x=1.f, scale_y=1.f;
BOOL isMesh = FALSE;
if( !objectp || !objectp->getVolume() || !editable || !single_volume)
{
// Clear out all geometry fields.
@@ -752,11 +763,10 @@ void LLPanelObject::getState( )
{
// Only allowed to change these parameters for objects
// that you have permissions on AND are not attachments.
enabled = root_objectp->permModify();
const LLVolumeParams &volume_params = objectp->getVolume()->getParams();
enabled = root_objectp->permModify() && !root_objectp->isPermanentEnforced();
// Volume type
const LLVolumeParams &volume_params = objectp->getVolume()->getParams();
U8 path = volume_params.getPathParams().getCurveType();
U8 profile_and_hole = volume_params.getProfileParams().getCurveType();
U8 profile = profile_and_hole & LL_PCODE_PROFILE_MASK;

View File

@@ -280,6 +280,10 @@ void LLPanelPermissions::refresh()
BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode()
&& LLSelectMgr::getInstance()->selectGetRootsModify())
|| LLSelectMgr::getInstance()->selectGetModify();
BOOL is_nonpermanent_enforced = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode()
&& LLSelectMgr::getInstance()->selectGetRootsNonPermanentEnforced())
|| LLSelectMgr::getInstance()->selectGetNonPermanentEnforced();
const LLFocusableElement* keyboard_focus_view = gFocusMgr.getKeyboardFocus();
S32 string_index = 0;
std::string MODIFY_INFO_STRINGS[] =
@@ -394,12 +398,12 @@ void LLPanelPermissions::refresh()
}
}
childSetEnabled("button set group",owners_identical && (mOwnerID == gAgent.getID()));
childSetEnabled("button set group",owners_identical && (mOwnerID == gAgent.getID()) && is_nonpermanent_enforced);
childSetEnabled("button open group", group_id.notNull());
// figure out the contents of the name, description, & category
BOOL edit_name_desc = FALSE;
if(is_one_object && objectp->permModify())
if(is_one_object && objectp->permModify() && !objectp->isPermanentEnforced())
{
edit_name_desc = TRUE;
}
@@ -628,15 +632,13 @@ void LLPanelPermissions::refresh()
bool has_change_perm_ability = false;
bool has_change_sale_ability = false;
if(valid_base_perms
&& (self_owned
|| (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE))))
if(valid_base_perms && is_nonpermanent_enforced &&
(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE))))
{
has_change_perm_ability = true;
}
if(valid_base_perms
&& (self_owned
|| (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE))))
if(valid_base_perms && is_nonpermanent_enforced &&
(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE))))
{
has_change_sale_ability = true;
}
@@ -847,8 +849,8 @@ void LLPanelPermissions::refresh()
ComboClickAction->setCurrentByIndex((S32)click_action);
}
}
childSetEnabled("label click action",is_perm_modify && all_volume);
childSetEnabled("clickaction",is_perm_modify && all_volume);
childSetEnabled("label click action",is_perm_modify && is_nonpermanent_enforced && all_volume);
childSetEnabled("clickaction",is_perm_modify && is_nonpermanent_enforced && all_volume);
}

View File

@@ -246,7 +246,7 @@ void LLPanelVolume::getState( )
owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
// BUG? Check for all objects being editable?
BOOL editable = root_objectp->permModify();
BOOL editable = root_objectp->permModify() && !root_objectp->isPermanentEnforced();
BOOL single_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME )
&& LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1;
@@ -344,7 +344,7 @@ void LLPanelVolume::getState( )
getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->setValue(is_flexible);
if (is_flexible || (volobjp && volobjp->canBeFlexible()))
{
getChildView("Flexible1D Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp && !volobjp->isMesh());
getChildView("Flexible1D Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp && !volobjp->isMesh() && !objectp->isPermanentEnforced());
}
else
{
@@ -449,7 +449,7 @@ void LLPanelVolume::getState( )
mComboPhysicsShapeType->add(getString("Convex Hull"), LLSD(2));
mComboPhysicsShapeType->setValue(LLSD(objectp->getPhysicsShapeType()));
mComboPhysicsShapeType->setEnabled(editable);
mComboPhysicsShapeType->setEnabled(editable && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()));
mObject = objectp;
mRootObject = root_objectp;

View File

@@ -2,31 +2,25 @@
* @file llselectmgr.cpp
* @brief A manager for selected objects and faces.
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -281,7 +275,7 @@ void LLSelectMgr::overrideObjectUpdates()
virtual bool apply(LLSelectNode* selectNode)
{
LLViewerObject* object = selectNode->getObject();
if (object && object->permMove())
if (object && object->permMove() && !object->isPermanentEnforced())
{
if (!selectNode->mLastPositionLocal.isExactlyZero())
{
@@ -600,6 +594,12 @@ bool LLSelectMgr::linkObjects()
return true;
}
if (!LLSelectMgr::getInstance()->selectGetRootsNonPermanentEnforced())
{
LLNotificationsUtil::add("CannotLinkPermanent");
return true;
}
LLUUID owner_id;
std::string owner_name;
if (!LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name))
@@ -645,7 +645,9 @@ bool LLSelectMgr::enableLinkObjects()
{
virtual bool apply(LLViewerObject* object)
{
return object->permModify();
LLViewerObject *root_object = (object == NULL) ? NULL : object->getRootEdit();
return object->permModify() && !object->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced());
}
} func;
const bool firstonly = true;
@@ -668,10 +670,12 @@ bool LLSelectMgr::enableLinkObjects()
bool LLSelectMgr::enableUnlinkObjects()
{
LLViewerObject* first_editable_object = LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject();
LLViewerObject *root_object = (first_editable_object == NULL) ? NULL : first_editable_object->getRootEdit();
bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() &&
first_editable_object &&
!first_editable_object->isAttachment();
!first_editable_object->isAttachment() && !first_editable_object->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced());
// [RLVa:KB] - Checked: 2011-03-19 (RLVa-1.3.0f) | Modified: RLVa-0.2.0g
if ( (new_value) && ((rlv_handler_t::isEnabled()) && (!gRlvHandler.canStand())) )
{
@@ -981,7 +985,7 @@ void LLSelectMgr::highlightObjectOnly(LLViewerObject* objectp)
}
if ((gSavedSettings.getBOOL("SelectOwnedOnly") && !objectp->permYouOwner())
|| (gSavedSettings.getBOOL("SelectMovableOnly") && !objectp->permMove()))
|| (gSavedSettings.getBOOL("SelectMovableOnly") && (!objectp->permMove() || objectp->isPermanentEnforced())))
{
// only select my own objects
return;
@@ -2505,6 +2509,341 @@ BOOL LLSelectMgr::selectGetRootsModify()
}
//-----------------------------------------------------------------------------
// selectGetNonPermanentEnforced() - return TRUE if all objects are not
// permanent enforced
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::selectGetNonPermanentEnforced()
{
for (LLObjectSelection::iterator iter = getSelection()->begin();
iter != getSelection()->end(); iter++ )
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if( !object || !node->mValid )
{
return FALSE;
}
if( object->isPermanentEnforced())
{
return FALSE;
}
}
return TRUE;
}
//-----------------------------------------------------------------------------
// selectGetRootsNonPermanentEnforced() - return TRUE if all root objects are
// not permanent enforced
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::selectGetRootsNonPermanentEnforced()
{
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
iter != getSelection()->root_end(); iter++ )
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if( !node->mValid )
{
return FALSE;
}
if( object->isPermanentEnforced())
{
return FALSE;
}
}
return TRUE;
}
//-----------------------------------------------------------------------------
// selectGetPermanent() - return TRUE if all objects are permanent
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::selectGetPermanent()
{
for (LLObjectSelection::iterator iter = getSelection()->begin();
iter != getSelection()->end(); iter++ )
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if( !object || !node->mValid )
{
return FALSE;
}
if( !object->flagObjectPermanent())
{
return FALSE;
}
}
return TRUE;
}
//-----------------------------------------------------------------------------
// selectGetRootsPermanent() - return TRUE if all root objects are
// permanent
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::selectGetRootsPermanent()
{
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
iter != getSelection()->root_end(); iter++ )
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if( !node->mValid )
{
return FALSE;
}
if( !object->flagObjectPermanent())
{
return FALSE;
}
}
return TRUE;
}
//-----------------------------------------------------------------------------
// selectGetCharacter() - return TRUE if all objects are character
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::selectGetCharacter()
{
for (LLObjectSelection::iterator iter = getSelection()->begin();
iter != getSelection()->end(); iter++ )
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if( !object || !node->mValid )
{
return FALSE;
}
if( !object->flagCharacter())
{
return FALSE;
}
}
return TRUE;
}
//-----------------------------------------------------------------------------
// selectGetRootsCharacter() - return TRUE if all root objects are
// character
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::selectGetRootsCharacter()
{
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
iter != getSelection()->root_end(); iter++ )
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if( !node->mValid )
{
return FALSE;
}
if( !object->flagCharacter())
{
return FALSE;
}
}
return TRUE;
}
//-----------------------------------------------------------------------------
// selectGetNonPathfinding() - return TRUE if all objects are not pathfinding
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::selectGetNonPathfinding()
{
for (LLObjectSelection::iterator iter = getSelection()->begin();
iter != getSelection()->end(); iter++ )
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if( !object || !node->mValid )
{
return FALSE;
}
if( object->flagObjectPermanent() || object->flagCharacter())
{
return FALSE;
}
}
return TRUE;
}
//-----------------------------------------------------------------------------
// selectGetRootsNonPathfinding() - return TRUE if all root objects are not
// pathfinding
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::selectGetRootsNonPathfinding()
{
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
iter != getSelection()->root_end(); iter++ )
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if( !node->mValid )
{
return FALSE;
}
if( object->flagObjectPermanent() || object->flagCharacter())
{
return FALSE;
}
}
return TRUE;
}
//-----------------------------------------------------------------------------
// selectGetNonPermanent() - return TRUE if all objects are not permanent
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::selectGetNonPermanent()
{
for (LLObjectSelection::iterator iter = getSelection()->begin();
iter != getSelection()->end(); iter++ )
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if( !object || !node->mValid )
{
return FALSE;
}
if( object->flagObjectPermanent())
{
return FALSE;
}
}
return TRUE;
}
//-----------------------------------------------------------------------------
// selectGetRootsNonPermanent() - return TRUE if all root objects are not
// permanent
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::selectGetRootsNonPermanent()
{
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
iter != getSelection()->root_end(); iter++ )
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if( !node->mValid )
{
return FALSE;
}
if( object->flagObjectPermanent())
{
return FALSE;
}
}
return TRUE;
}
//-----------------------------------------------------------------------------
// selectGetNonCharacter() - return TRUE if all objects are not character
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::selectGetNonCharacter()
{
for (LLObjectSelection::iterator iter = getSelection()->begin();
iter != getSelection()->end(); iter++ )
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if( !object || !node->mValid )
{
return FALSE;
}
if( object->flagCharacter())
{
return FALSE;
}
}
return TRUE;
}
//-----------------------------------------------------------------------------
// selectGetRootsNonCharacter() - return TRUE if all root objects are not
// character
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::selectGetRootsNonCharacter()
{
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
iter != getSelection()->root_end(); iter++ )
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if( !node->mValid )
{
return FALSE;
}
if( object->flagCharacter())
{
return FALSE;
}
}
return TRUE;
}
//-----------------------------------------------------------------------------
// selectGetEditableLinksets() - return TRUE if all objects are editable
// pathfinding linksets
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::selectGetEditableLinksets()
{
for (LLObjectSelection::iterator iter = getSelection()->begin();
iter != getSelection()->end(); iter++ )
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if( !object || !node->mValid )
{
return FALSE;
}
if (object->flagUsePhysics() ||
object->flagTemporaryOnRez() ||
object->flagCharacter() ||
object->flagVolumeDetect() ||
object->flagAnimSource() ||
(object->getRegion() != gAgent.getRegion()) ||
(!gAgent.isGodlike() &&
!gAgent.canManageEstate() &&
!object->permYouOwner() &&
!object->permMove()))
{
return FALSE;
}
}
return TRUE;
}
//-----------------------------------------------------------------------------
// selectGetViewableCharacters() - return TRUE if all objects are characters
// viewable within the pathfinding characters floater
//-----------------------------------------------------------------------------
BOOL LLSelectMgr::selectGetViewableCharacters()
{
for (LLObjectSelection::iterator iter = getSelection()->begin();
iter != getSelection()->end(); iter++ )
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if( !object || !node->mValid )
{
return FALSE;
}
if( !object->flagCharacter() ||
(object->getRegion() != gAgent.getRegion()))
{
return FALSE;
}
}
return TRUE;
}
//-----------------------------------------------------------------------------
// selectGetRootsTransfer() - return TRUE if current agent can transfer all
// selected root objects.
@@ -6233,7 +6572,7 @@ BOOL LLSelectMgr::canSelectObject(LLViewerObject* object)
}
if ((gSavedSettings.getBOOL("SelectOwnedOnly") && !object->permYouOwner()) ||
(gSavedSettings.getBOOL("SelectMovableOnly") && !object->permMove()))
(gSavedSettings.getBOOL("SelectMovableOnly") && (!object->permMove() || object->isPermanentEnforced())))
{
// only select my own objects
return FALSE;
@@ -6927,7 +7266,7 @@ LLSelectNode* LLObjectSelection::getFirstMoveableNode(BOOL get_root_first)
bool apply(LLSelectNode* node)
{
LLViewerObject* obj = node->getObject();
return obj && obj->permMove();
return obj && obj->permMove() && !obj->isPermanentEnforced();
}
} func;
LLSelectNode* res = get_root_first ? getFirstRootNode(&func, TRUE) : getFirstNode(&func);
@@ -6965,9 +7304,10 @@ LLViewerObject* LLObjectSelection::getFirstDeleteableObject()
LLViewerObject* obj = node->getObject();
// you can delete an object if you are the owner
// or you have permission to modify it.
if( obj && ( (obj->permModify()) ||
(obj->permYouOwner()) ||
(!obj->permAnyOwner()) )) // public
if( obj && !obj->isPermanentEnforced() &&
( (obj->permModify()) ||
(obj->permYouOwner()) ||
(!obj->permAnyOwner()) )) // public
{
if( !obj->isAttachment() )
{
@@ -7007,7 +7347,7 @@ LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_parent)
bool apply(LLSelectNode* node)
{
LLViewerObject* obj = node->getObject();
return obj && obj->permMove();
return obj && obj->permMove() && !obj->isPermanentEnforced();
}
} func;
return getFirstSelectedObject(&func, get_parent);
@@ -7076,7 +7416,7 @@ bool LLSelectMgr::selectionMove(const LLVector3& displ,
{
obj = (*it)->getObject();
bool enable_pos = false, enable_rot = false;
bool perm_move = obj->permMove();
bool perm_move = obj->permMove() && !obj->isPermanentEnforced();
bool perm_mod = obj->permModify();
LLVector3d sel_center(getSelectionCenterGlobal());

View File

@@ -564,6 +564,33 @@ public:
BOOL selectGetRootsModify();
BOOL selectGetModify();
// returns TRUE if is all objects are non-permanent-enforced
BOOL selectGetRootsNonPermanentEnforced();
BOOL selectGetNonPermanentEnforced();
// returns TRUE if is all objects are permanent
BOOL selectGetRootsPermanent();
BOOL selectGetPermanent();
// returns TRUE if is all objects are character
BOOL selectGetRootsCharacter();
BOOL selectGetCharacter();
// returns TRUE if is all objects are not permanent
BOOL selectGetRootsNonPathfinding();
BOOL selectGetNonPathfinding();
// returns TRUE if is all objects are not permanent
BOOL selectGetRootsNonPermanent();
BOOL selectGetNonPermanent();
// returns TRUE if is all objects are not character
BOOL selectGetRootsNonCharacter();
BOOL selectGetNonCharacter();
BOOL selectGetEditableLinksets();
BOOL selectGetViewableCharacters();
// returns TRUE if selected objects can be transferred.
BOOL selectGetRootsTransfer();

View File

@@ -218,24 +218,37 @@ BOOL LLToolGrab::handleObjectHit(const LLPickInfo& info)
if (!objectp->flagUsePhysics())
{
// In mouselook, we shouldn't be able to grab non-physical,
// non-touchable objects. If it has a touch handler, we
// do grab it (so llDetectedGrab works), but movement is
// blocked on the server side. JC
if (gAgentCamera.cameraMouselook() && !script_touch)
if (script_touch)
{
mMode = GRAB_LOCKED;
gViewerWindow->hideCursor();
gViewerWindow->moveCursorToCenter();
mMode = GRAB_NONPHYSICAL; // if it has a script, use the non-physical grab
}
else
{
mMode = GRAB_NONPHYSICAL;
// In mouselook, we shouldn't be able to grab non-physical,
// non-touchable objects. If it has a touch handler, we
// do grab it (so llDetectedGrab works), but movement is
// blocked on the server side. JC
if (gAgentCamera.cameraMouselook())
{
mMode = GRAB_LOCKED;
gViewerWindow->hideCursor();
gViewerWindow->moveCursorToCenter();
}
else if (objectp->permMove() && !objectp->isPermanentEnforced())
{
mMode = GRAB_ACTIVE_CENTER;
gViewerWindow->hideCursor();
gViewerWindow->moveCursorToCenter();
}
else
{
mMode = GRAB_LOCKED;
}
}
// Don't bail out here, go on and grab so buttons can get
// their "touched" event.
}
else if( !objectp->permMove() )
else if( objectp->flagCharacter() || !objectp->permMove() || objectp->isPermanentEnforced())
{
// if mouse is over a physical object without move permission, show feedback if user tries to move it.
mMode = GRAB_LOCKED;

View File

@@ -374,7 +374,6 @@ void near_sit_object();
BOOL is_selection_buy_not_take();
S32 selection_price();
BOOL enable_take();
void handle_take();
bool confirm_take(const LLSD& notification, const LLSD& response, LLObjectSelectionHandle selection_handle);
void handle_buy_object(LLSaleInfo sale_info);
@@ -4524,8 +4523,9 @@ static bool get_derezzable_objects(
{
case DRD_TAKE_INTO_AGENT_INVENTORY:
case DRD_TRASH:
if( (node->mPermissions->allowTransferTo(gAgent.getID()) && object->permModify())
|| (node->allowOperationOnNode(PERM_OWNER, GP_OBJECT_MANIPULATE)) )
if (!object->isPermanentEnforced() &&
((node->mPermissions->allowTransferTo(gAgent.getID()) && object->permModify())
|| (node->allowOperationOnNode(PERM_OWNER, GP_OBJECT_MANIPULATE))))
{
can_derez_current = TRUE;
}
@@ -4945,9 +4945,10 @@ BOOL enable_take()
return TRUE;
}
# endif
if((node->mPermissions->allowTransferTo(gAgent.getID())
if(!object->isPermanentEnforced() &&
((node->mPermissions->allowTransferTo(gAgent.getID())
&& object->permModify())
|| (node->mPermissions->getOwner() == gAgent.getID()))
|| (node->mPermissions->getOwner() == gAgent.getID())))
{
return TRUE;
}
@@ -7296,6 +7297,7 @@ BOOL object_selected_and_point_valid(void *user_data)
return (selection->getRootObjectCount() == 1) &&
(selection->getFirstRootObject()->getPCode() == LL_PCODE_VOLUME) &&
selection->getFirstRootObject()->permYouOwner() &&
!selection->getFirstRootObject()->flagObjectPermanent() &&
!((LLViewerObject*)selection->getFirstRootObject()->getRoot())->isAvatar() &&
(selection->getFirstRootObject()->getNVPair("AssetContainer") == NULL);
}
@@ -7971,8 +7973,8 @@ BOOL enable_save_into_inventory(void*)
return TRUE;
}
}
#endif
return FALSE;
#endif
}
BOOL enable_save_into_task_inventory(void*)

View File

@@ -5450,6 +5450,11 @@ void LLViewerObject::markForUpdate(BOOL priority)
}
}
bool LLViewerObject::isPermanentEnforced() const
{
return flagObjectPermanent() && (mRegionp != gAgent.getRegion()) && !gAgent.isGodlike();
}
bool LLViewerObject::getIncludeInSearch() const
{
return flagIncludeInSearch();

View File

@@ -491,6 +491,9 @@ public:
inline BOOL flagObjectCopy() const { return ((mFlags & FLAGS_OBJECT_COPY) != 0); }
inline BOOL flagObjectMove() const { return ((mFlags & FLAGS_OBJECT_MOVE) != 0); }
inline BOOL flagObjectTransfer() const { return ((mFlags & FLAGS_OBJECT_TRANSFER) != 0); }
inline BOOL flagObjectPermanent() const { return ((mFlags & FLAGS_AFFECTS_NAVMESH) != 0); }
inline BOOL flagCharacter() const { return ((mFlags & FLAGS_CHARACTER) != 0); }
inline BOOL flagVolumeDetect() const { return ((mFlags & FLAGS_VOLUME_DETECT) != 0); }
inline BOOL flagIncludeInSearch() const { return ((mFlags & FLAGS_INCLUDE_IN_SEARCH) != 0); }
inline BOOL flagScripted() const { return ((mFlags & FLAGS_SCRIPTED) != 0); }
inline BOOL flagHandleTouch() const { return ((mFlags & FLAGS_HANDLE_TOUCH) != 0); }
@@ -509,6 +512,8 @@ public:
inline F32 getPhysicsFriction() const { return mPhysicsFriction; }
inline F32 getPhysicsDensity() const { return mPhysicsDensity; }
inline F32 getPhysicsRestitution() const { return mPhysicsRestitution; }
bool isPermanentEnforced() const;
bool getIncludeInSearch() const;
void setIncludeInSearch(bool include_in_search);

View File

@@ -3425,8 +3425,11 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
{
LLSelectNode* nodep = *iter;
LLViewerObject* object = nodep->getObject();
LLViewerObject *root_object = (object == NULL) ? NULL : object->getRootEdit();
BOOL this_object_movable = FALSE;
if (object->permMove() && (object->permModify() || selecting_linked_set))
if (object->permMove() && !object->isPermanentEnforced() &&
((root_object == NULL) || !root_object->isPermanentEnforced()) &&
(object->permModify() || selecting_linked_set))
{
moveable_object_selected = TRUE;
this_object_movable = TRUE;

View File

@@ -2390,7 +2390,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
produces_light = 1;
}
for (S32 i = 0; i < num_faces; ++i)
for (S32 i = 0; i < (S32)num_faces; ++i)
{
const LLFace* face = drawablep->getFace(i);
if (!face) continue;

View File

@@ -1527,6 +1527,13 @@ Unable to link because you don&apos;t have modify permission on all the objects.
Please make sure none are locked, and that you own all of them.
</notification>
<notification
icon="alertmodal.tga"
name="CannotLinkPermanent"
type="alertmodal">
Objects cannot be linked across region boundaries.
</notification>
<notification
icon="alertmodal.tga"
name="CannotLinkDifferentOwners"
@@ -5942,6 +5949,53 @@ You cannot create objects here.
<unique/>
</notification>
<notification
icon="notify.tga"
name="PathfindingDirty"
type="notify">
<unique/>
The region has pending pathfinding changes. If you have build rights, you may rebake the region by clicking on the “Rebake region” button.
</notification>
<notification
icon="notify.tga"
name="DynamicPathfindingDisabled"
type="notify">
<unique/>
Dynamic pathfinding is not enabled on this region. Scripted objects using pathfinding LSL calls may not operate as expected on this region.
</notification>
<notification
icon="alertmodal.tga"
name="PathfindingRebakeNavmesh"
type="alertmodal">
<unique/>
Changing certain objects in this region could cause other moving objects to behave incorrectly. To make moving objects behave correctly, click the “Rebake region” button. Choose “Help” for more information.
<url
option="1"
name="url"
target = "_external">
http://wiki.secondlife.com/wiki/Pathfinding_Tools_in_the_Second_Life_Viewer
</url>
<usetemplate
name="okhelpignore"
ignoretext="Changing certain objects in this region could cause other moving objects to behave incorrectly."
yestext="OK"
helptext="Help"
/>
</notification>
<notification
icon="alertmodal.tga"
name="PathfindingCannotRebakeNavmesh"
type="alertmodal">
<unique/>
An error occurred. There may be a network or server problem, or you may not have build rights. Sometimes logging out and back in will solve this problem.
<usetemplate
name="okbutton"
yestext="OK"
/>
</notification>
<notification
icon="notify.tga"
name="ScriptsStopped"