From 4d77d3cca1c932516781222e0c8c14d27f876466 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 28 Feb 2012 19:07:44 -0800 Subject: PATH-199: Cleaning up code related to object flags so that I can better use the flags to managed pathfinding flags such as permanent and character. --- indra/newview/llpanelobject.cpp | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'indra/newview/llpanelobject.cpp') diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 1f77e7a602..ee62a39f75 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -283,7 +283,6 @@ LLPanelObject::LLPanelObject() mIsPhysical(FALSE), mIsTemporary(FALSE), mIsPhantom(FALSE), - mCastShadows(TRUE), mSelectedType(MI_BOX), mSculptTextureRevert(LLUUID::null), mSculptTypeRevert(0) @@ -497,7 +496,7 @@ void LLPanelObject::getState( ) BOOL is_flexible = volobjp && volobjp->isFlexible(); // Physics checkbox - mIsPhysical = root_objectp->usePhysics(); + mIsPhysical = root_objectp->flagUsePhysics(); mCheckPhysics->set( mIsPhysical ); mCheckPhysics->setEnabled( roots_selected>0 && (editable || gAgent.isGodlike()) @@ -512,12 +511,6 @@ void LLPanelObject::getState( ) mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible ); -#if 0 // 1.9.2 - mCastShadows = root_objectp->flagCastShadows(); - mCheckCastShadows->set( mCastShadows ); - mCheckCastShadows->setEnabled( roots_selected==1 && editable ); -#endif - //---------------------------------------------------------------------------- S32 selected_item = MI_BOX; @@ -1214,22 +1207,6 @@ void LLPanelObject::sendIsPhantom() } } -void LLPanelObject::sendCastShadows() -{ - BOOL value = mCheckCastShadows->get(); - if( mCastShadows != value ) - { - LLSelectMgr::getInstance()->selectionUpdateCastShadows(value); - mCastShadows = value; - - llinfos << "update cast shadows sent" << llendl; - } - else - { - llinfos << "update cast shadows not changed" << llendl; - } -} - // static void LLPanelObject::onCommitParametric( LLUICtrl* ctrl, void* userdata ) { @@ -1886,10 +1863,6 @@ void LLPanelObject::clearCtrls() mCheckPhantom ->set(FALSE); mCheckPhantom ->setEnabled( FALSE ); -#if 0 // 1.9.2 - mCheckCastShadows->set(FALSE); - mCheckCastShadows->setEnabled( FALSE ); -#endif // Disable text labels mLabelPosition ->setEnabled( FALSE ); mLabelSize ->setEnabled( FALSE ); @@ -1977,14 +1950,6 @@ void LLPanelObject::onCommitPhantom( LLUICtrl* ctrl, void* userdata ) self->sendIsPhantom(); } -// static -void LLPanelObject::onCommitCastShadows( LLUICtrl* ctrl, void* userdata ) -{ - LLPanelObject* self = (LLPanelObject*) userdata; - self->sendCastShadows(); -} - - void LLPanelObject::onSelectSculpt(const LLSD& data) { LLTextureCtrl* mTextureCtrl = getChild("sculpt texture control"); -- cgit v1.3 From 378ae8ce6588ce921b2aa960c08d4293c6b419e5 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 13 Mar 2012 15:33:15 -0700 Subject: PATH-199: Enforcing permanent objects in frozen state to not move. --- indra/newview/llmaniprotate.cpp | 10 +++++----- indra/newview/llmanipscale.cpp | 12 ++++++------ indra/newview/llmaniptranslate.cpp | 4 ++-- indra/newview/llpanelobject.cpp | 17 +++++++++++++---- indra/newview/llpanelobject.h | 3 ++- indra/newview/llselectmgr.cpp | 12 ++++++------ indra/newview/lltoolgrab.cpp | 14 ++++++++++---- indra/newview/llviewermenu.cpp | 1 + indra/newview/llviewerobject.cpp | 6 ++++++ indra/newview/llviewerobject.h | 2 ++ indra/newview/llviewerwindow.cpp | 2 +- 11 files changed, 54 insertions(+), 29 deletions(-) (limited to 'indra/newview/llpanelobject.cpp') diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index a8da94f75e..7ac347e66a 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -481,7 +481,7 @@ BOOL LLManipRotate::handleMouseUp(S32 x, S32 y, MASK mask) LLViewerObject* object = selectNode->getObject(); // 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() && (object->isRootEdit() || selectNode->mIndividualSelection)) { object->mUnselectedChildrenPositions.clear() ; } @@ -569,7 +569,7 @@ void LLManipRotate::drag( S32 x, S32 y ) LLViewerObject* object = selectNode->getObject(); // 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() && (object->isRootEdit() || selectNode->mIndividualSelection)) { if (!object->isRootEdit()) { @@ -623,7 +623,7 @@ void LLManipRotate::drag( S32 x, S32 y ) LLViewerObject* object = selectNode->getObject(); // 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()) { LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter ); @@ -704,7 +704,7 @@ void LLManipRotate::drag( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject*cur = selectNode->getObject(); - if( cur->permModify() && cur->permMove() && !cur->isAvatar()) + if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && !cur->isAvatar()) { selectNode->mLastRotation = cur->getRotation(); selectNode->mLastPositionLocal = cur->getPosition(); @@ -1871,7 +1871,7 @@ BOOL LLManipRotate::canAffectSelection() { virtual bool apply(LLViewerObject* objectp) { - return objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); + return objectp->permMove() && !objectp->isPermanentEnforced() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); } } func; can_rotate = mObjectSelection->applyToObjects(&func); diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index f6df4cdfbf..160ba40433 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -826,7 +826,7 @@ void LLManipScale::drag( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject*cur = selectNode->getObject(); - if( cur->permModify() && cur->permMove() && !cur->isAvatar()) + if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && !cur->isAvatar()) { selectNode->mLastScale = cur->getScale(); selectNode->mLastPositionLocal = cur->getPosition(); @@ -973,7 +973,7 @@ void LLManipScale::dragCorner( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject* cur = selectNode->getObject(); - if( cur->permModify() && cur->permMove() && !cur->isAvatar() ) + if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && !cur->isAvatar() ) { const LLVector3& scale = selectNode->mSavedScale; @@ -995,7 +995,7 @@ void LLManipScale::dragCorner( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject* cur = selectNode->getObject(); - if( cur->permModify() && cur->permMove() && !cur->isAvatar() && cur->isRootEdit() ) + if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && !cur->isAvatar() && cur->isRootEdit() ) { const LLVector3& scale = selectNode->mSavedScale; cur->setScale( scale_factor * scale ); @@ -1043,7 +1043,7 @@ void LLManipScale::dragCorner( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject*cur = selectNode->getObject(); - if( cur->permModify() && cur->permMove() && !cur->isAvatar() && !cur->isRootEdit() ) + if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && !cur->isAvatar() && !cur->isRootEdit() ) { const LLVector3& scale = selectNode->mSavedScale; cur->setScale( scale_factor * scale, FALSE ); @@ -1251,7 +1251,7 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto { LLSelectNode* selectNode = *iter; LLViewerObject*cur = selectNode->getObject(); - if( cur->permModify() && cur->permMove() && !cur->isAvatar() ) + if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && !cur->isAvatar() ) { LLBBox cur_bbox = cur->getBoundingBoxAgent(); LLVector3 start_local = cur_bbox.agentToLocal( drag_start_agent ); @@ -2057,7 +2057,7 @@ BOOL LLManipScale::canAffectSelection() { virtual bool apply(LLViewerObject* objectp) { - return objectp->permModify() && objectp->permMove() && !objectp->isSeat(); + return objectp->permModify() && objectp->permMove() && !objectp->isPermanentEnforced() && !objectp->isSeat(); } } func; can_scale = mObjectSelection->applyToObjects(&func); diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 3a88fbd96d..e6ccfc0af5 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -687,7 +687,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) } } - if (object->permMove()) + if (object->permMove() && !object->isPermanentEnforced()) { // handle attachments in local space if (object->isAttachment() && object->mDrawable.notNull()) @@ -2281,7 +2281,7 @@ BOOL LLManipTranslate::canAffectSelection() { virtual bool apply(LLViewerObject* objectp) { - return objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); + return objectp->permMove() && !objectp->isPermanentEnforced() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); } } func; can_move = mObjectSelection->applyToObjects(&func); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index ee62a39f75..26f4b09b30 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -66,6 +66,8 @@ #include "llviewercontrol.h" #include "lluictrlfactory.h" //#include "llfirstuse.h" +#include "llfloatertools.h" +#include "llpathfindingmanager.h" #include "lldrawpool.h" @@ -271,6 +273,8 @@ BOOL LLPanelObject::postBuild() childSetCommitCallback("sculpt mirror control", onCommitSculptType, this); mCtrlSculptInvert = getChild("sculpt invert control"); childSetCommitCallback("sculpt invert control", onCommitSculptType, this); + + LLPathfindingManager::getInstance()->registerAgentStateListener(boost::bind(&LLPanelObject::handleAgentStateCallback, this)); // Start with everyone disabled clearCtrls(); @@ -341,9 +345,9 @@ 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_move = objectp->permMove() && !objectp->isPermanentEnforced() && !objectp->isAttachment() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); + BOOL enable_scale = objectp->permMove() && !objectp->isPermanentEnforced() && objectp->permModify(); + BOOL enable_rotate = objectp->permMove() && !objectp->isPermanentEnforced() && ( (objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts")); S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); BOOL single_volume = (LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME )) @@ -548,7 +552,7 @@ void LLPanelObject::getState( ) { // Only allowed to change these parameters for objects // that you have permissions on AND are not attachments. - enabled = root_objectp->permModify(); + enabled = root_objectp->permModify() && !root_objectp->isPermanentEnforced(); // Volume type const LLVolumeParams &volume_params = objectp->getVolume()->getParams(); @@ -1968,6 +1972,11 @@ void LLPanelObject::onCommitSculpt( const LLSD& data ) sendSculpt(); } +void LLPanelObject::handleAgentStateCallback() const +{ + gFloaterTools->dirty(); +} + BOOL LLPanelObject::onDropSculpt(LLInventoryItem* item) { LLTextureCtrl* mTextureCtrl = getChild("sculpt texture control"); diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index 86b59d4ff9..8c94c99151 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -74,7 +74,8 @@ public: void onSelectSculpt(const LLSD& data); BOOL onDropSculpt(LLInventoryItem* item); static void onCommitSculptType( LLUICtrl *ctrl, void* userdata); - + + void handleAgentStateCallback() const; protected: void getState(); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9cfcf3de79..1ee365ce97 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -276,7 +276,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()) { @@ -955,7 +955,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; @@ -6236,7 +6236,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; @@ -6928,7 +6928,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); @@ -7008,7 +7008,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); @@ -7077,7 +7077,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()); diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index 61ff59c53a..192f83d064 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -222,18 +222,24 @@ BOOL LLToolGrab::handleObjectHit(const LLPickInfo& info) if (gAgentCamera.cameraMouselook()) { mMode = GRAB_LOCKED; + gViewerWindow->hideCursor(); + gViewerWindow->moveCursorToCenter(); } - else + else if (objectp->permMove() && !objectp->isPermanentEnforced()) { mMode = GRAB_ACTIVE_CENTER; + gViewerWindow->hideCursor(); + gViewerWindow->moveCursorToCenter(); + } + else + { + mMode = GRAB_LOCKED; } - gViewerWindow->hideCursor(); - gViewerWindow->moveCursorToCenter(); } } - else if( !objectp->permMove() ) + else if( !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; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index e91a1d6afa..390cad65c4 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6436,6 +6436,7 @@ BOOL object_selected_and_point_valid() (selection->getFirstRootObject()->getPCode() == LL_PCODE_VOLUME) && selection->getFirstRootObject()->permYouOwner() && selection->getFirstRootObject()->flagObjectMove() && + !selection->getFirstRootObject()->flagObjectPermanent() && !((LLViewerObject*)selection->getFirstRootObject()->getRoot())->isAvatar() && (selection->getFirstRootObject()->getNVPair("AssetContainer") == NULL); } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 330cf51b3e..c70ceac525 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -100,6 +100,7 @@ #include "lltrans.h" #include "llsdutil.h" #include "llmediaentry.h" +#include "llpathfindingmanager.h" //#define DEBUG_UPDATE_TYPE @@ -5321,6 +5322,11 @@ void LLViewerObject::markForUpdate(BOOL priority) } } +bool LLViewerObject::isPermanentEnforced() const +{ + return flagObjectPermanent() && !LLPathfindingManager::getInstance()->isAllowAlterPermanent(); +} + bool LLViewerObject::getIncludeInSearch() const { return flagIncludeInSearch(); diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 63215942ac..1af1eff458 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -496,6 +496,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); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 8750b3b1f2..49e07a1fe3 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3530,7 +3530,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, LLSelectNode* nodep = *iter; LLViewerObject* object = nodep->getObject(); BOOL this_object_movable = FALSE; - if (object->permMove() && (object->permModify() || selecting_linked_set)) + if (object->permMove() && !object->isPermanentEnforced() && (object->permModify() || selecting_linked_set)) { moveable_object_selected = TRUE; this_object_movable = TRUE; -- cgit v1.3 From b7aa6803a1f34de0cce9a88f9ecd9c7827c4bb52 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Wed, 21 Mar 2012 15:15:59 -0700 Subject: PATH-199: Adding a non-interactive checkbox to the build tools floater. --- indra/newview/llpanelobject.cpp | 8 ++++++++ indra/newview/llpanelobject.h | 1 + indra/newview/skins/default/xui/en/floater_tools.xml | 8 ++++++++ 3 files changed, 17 insertions(+) (limited to 'indra/newview/llpanelobject.cpp') diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 26f4b09b30..f0cd0f5d19 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -121,6 +121,9 @@ BOOL LLPanelObject::postBuild() mCheckPhantom = getChild("Phantom Checkbox Ctrl"); childSetCommitCallback("Phantom Checkbox Ctrl",onCommitPhantom,this); + // Permanent checkbox + mCheckPermanent = getChild("Permanent Checkbox Ctrl"); + // Position mLabelPosition = getChild("label position"); @@ -514,6 +517,9 @@ void LLPanelObject::getState( ) mCheckPhantom->set( mIsPhantom ); mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible ); + mCheckPermanent->set( root_objectp->flagObjectPermanent() ); + mCheckPermanent->setEnabled( FALSE ); + //---------------------------------------------------------------------------- @@ -1866,6 +1872,8 @@ void LLPanelObject::clearCtrls() mCheckTemporary ->setEnabled( FALSE ); mCheckPhantom ->set(FALSE); mCheckPhantom ->setEnabled( FALSE ); + mCheckPermanent ->set(FALSE); + mCheckPermanent ->setEnabled( FALSE ); // Disable text labels mLabelPosition ->setEnabled( FALSE ); diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index 8c94c99151..b606ef5044 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -152,6 +152,7 @@ protected: LLCheckBoxCtrl *mCheckPhysics; LLCheckBoxCtrl *mCheckTemporary; LLCheckBoxCtrl *mCheckPhantom; + LLCheckBoxCtrl *mCheckPermanent; LLTextureCtrl *mCtrlSculptTexture; LLTextBox *mLabelSculptType; diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 2d63c94fe1..0f390217d1 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1354,6 +1354,14 @@ even though the user gets a free copy. tool_tip="Causes object to not collide with other objects or avatars" top_pad="0" width="123" /> + Date: Wed, 21 Mar 2012 18:00:21 -0700 Subject: PATH-199: Disabling more functionality of the build tool floater when permanancy is enforced. --- indra/newview/llpanelobject.cpp | 16 +++++++++++----- indra/newview/llpanelvolume.cpp | 2 +- indra/newview/llselectmgr.cpp | 4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) (limited to 'indra/newview/llpanelobject.cpp') diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index f0cd0f5d19..2e41aa8002 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -501,24 +501,30 @@ void LLPanelObject::getState( ) } BOOL is_flexible = volobjp && volobjp->isFlexible(); + BOOL is_permanent = root_objectp->flagObjectPermanent(); + BOOL is_permanent_enforced = root_objectp->isPermanentEnforced(); // Physics checkbox mIsPhysical = root_objectp->flagUsePhysics(); + //llassert(is_permanent && mIsPhysical); // should never has 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(); mCheckPhantom->set( mIsPhantom ); - mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible ); + mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible && !is_permanent_enforced ); - mCheckPermanent->set( root_objectp->flagObjectPermanent() ); - mCheckPermanent->setEnabled( FALSE ); + mCheckPermanent->set(is_permanent); + mCheckPermanent->setEnabled(FALSE); //---------------------------------------------------------------------------- diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 12eea7844d..80dc2c0013 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -495,7 +495,7 @@ void LLPanelVolume::getState( ) mComboPhysicsShapeType->add(getString("Convex Hull"), LLSD(2)); mComboPhysicsShapeType->setValue(LLSD(objectp->getPhysicsShapeType())); - mComboPhysicsShapeType->setEnabled(editable); + mComboPhysicsShapeType->setEnabled(editable && !objectp->isPermanentEnforced()); mObject = objectp; mRootObject = root_objectp; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index ae61ead935..9b56a5be35 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -638,7 +638,7 @@ bool LLSelectMgr::enableLinkObjects() { virtual bool apply(LLViewerObject* object) { - return object->permModify(); + return object->permModify() && !object->isPermanentEnforced(); } } func; const bool firstonly = true; @@ -654,7 +654,7 @@ bool LLSelectMgr::enableUnlinkObjects() bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() && first_editable_object && - !first_editable_object->isAttachment(); + !first_editable_object->isAttachment() && !first_editable_object->isPermanentEnforced(); return new_value; } -- cgit v1.3 From f90bcb3a55a0e61f3dbf068c3ddea86b6d5f519f Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 29 Mar 2012 15:00:29 -0700 Subject: PATH-442: BUGFIX Disabling the phantom flag in the Build Tools floater for character objects. --- indra/newview/llpanelobject.cpp | 18 ++++++++++++++---- indra/newview/llpanelobject.h | 1 + indra/newview/skins/default/xui/en/floater_tools.xml | 12 ++++++++++-- 3 files changed, 25 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpanelobject.cpp') diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 2e41aa8002..028ca82fed 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -124,6 +124,8 @@ BOOL LLPanelObject::postBuild() // Permanent checkbox mCheckPermanent = getChild("Permanent Checkbox Ctrl"); + // Character checkbox + mCheckCharacter = getChild("Character Checkbox Ctrl"); // Position mLabelPosition = getChild("label position"); @@ -503,29 +505,35 @@ void LLPanelObject::getState( ) 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 // Physics checkbox mIsPhysical = root_objectp->flagUsePhysics(); - //llassert(is_permanent && mIsPhysical); // should never has a permanent object that is also physical + llassert(!is_permanent || !mIsPhysical); // should never have a permanent object that is also physical + llassert(!is_character || mIsPhysical); // all characters should also be physical mCheckPhysics->set( mIsPhysical ); mCheckPhysics->setEnabled( roots_selected>0 && (editable || gAgent.isGodlike()) - && !is_flexible && !is_permanent); + && !is_flexible && !is_permanent && !is_character); mIsTemporary = root_objectp->flagTemporaryOnRez(); - //llassert(is_permanent && mIsTemporary); // should never has a permanent object that is also temporary + llassert(!is_permanent || !mIsTemporary); // should never has a permanent object that is also temporary mCheckTemporary->set( mIsTemporary ); mCheckTemporary->setEnabled( roots_selected>0 && editable && !is_permanent); mIsPhantom = root_objectp->flagPhantom(); + 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 && !is_permanent_enforced ); + mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible && !is_permanent_enforced && !is_character); mCheckPermanent->set(is_permanent); mCheckPermanent->setEnabled(FALSE); + mCheckCharacter->set(is_character); + mCheckCharacter->setEnabled(FALSE); //---------------------------------------------------------------------------- @@ -1880,6 +1888,8 @@ void LLPanelObject::clearCtrls() mCheckPhantom ->setEnabled( FALSE ); mCheckPermanent ->set(FALSE); mCheckPermanent ->setEnabled( FALSE ); + mCheckCharacter ->set(FALSE); + mCheckCharacter ->setEnabled( FALSE ); // Disable text labels mLabelPosition ->setEnabled( FALSE ); diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index b606ef5044..307d63aada 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -153,6 +153,7 @@ protected: LLCheckBoxCtrl *mCheckTemporary; LLCheckBoxCtrl *mCheckPhantom; LLCheckBoxCtrl *mCheckPermanent; + LLCheckBoxCtrl *mCheckCharacter; LLTextureCtrl *mCtrlSculptTexture; LLTextBox *mLabelSculptType; diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 0f390217d1..528d2a7064 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1362,15 +1362,23 @@ even though the user gets a free copy. name="Permanent Checkbox Ctrl" top_pad="0" width="123" /> + - Position (meters) -- cgit v1.3 From c1a5d6a36b925728d98c37522ed7ae53e3a87155 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 30 Mar 2012 15:42:43 -0700 Subject: PATH-450: Disabling the movement and shape manipulation widgets when editing an item in a linked set. --- indra/newview/llmaniprotate.cpp | 24 +++++++++++++++++++----- indra/newview/llmanipscale.cpp | 30 ++++++++++++++++++++++++------ indra/newview/llmaniptranslate.cpp | 9 +++++++-- indra/newview/llpanelobject.cpp | 6 +++--- indra/newview/llpanelvolume.cpp | 2 +- indra/newview/llselectmgr.cpp | 8 ++++++-- indra/newview/llviewerwindow.cpp | 5 ++++- 7 files changed, 64 insertions(+), 20 deletions(-) (limited to 'indra/newview/llpanelobject.cpp') diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 7ac347e66a..826e8d560a 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -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->isPermanentEnforced() && (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->isPermanentEnforced() && (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() && !object->isPermanentEnforced()) + 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->isPermanentEnforced() && !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(); @@ -1871,7 +1882,10 @@ BOOL LLManipRotate::canAffectSelection() { virtual bool apply(LLViewerObject* objectp) { - return objectp->permMove() && !objectp->isPermanentEnforced() && (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); diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 160ba40433..bc6a94d61f 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -826,7 +826,10 @@ void LLManipScale::drag( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject*cur = selectNode->getObject(); - if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && !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(); @@ -973,7 +976,10 @@ void LLManipScale::dragCorner( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject* cur = selectNode->getObject(); - if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && !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; @@ -995,7 +1001,10 @@ void LLManipScale::dragCorner( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject* cur = selectNode->getObject(); - if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && !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 ); @@ -1043,7 +1052,10 @@ void LLManipScale::dragCorner( S32 x, S32 y ) { LLSelectNode* selectNode = *iter; LLViewerObject*cur = selectNode->getObject(); - if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && !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 ); @@ -1251,7 +1263,10 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto { LLSelectNode* selectNode = *iter; LLViewerObject*cur = selectNode->getObject(); - if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && !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->isPermanentEnforced() && !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); diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index e6ccfc0af5..7a35562f86 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -687,7 +687,9 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) } } - if (object->permMove() && !object->isPermanentEnforced()) + 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()) @@ -2281,7 +2283,10 @@ BOOL LLManipTranslate::canAffectSelection() { virtual bool apply(LLViewerObject* objectp) { - return objectp->permMove() && !objectp->isPermanentEnforced() && (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); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 028ca82fed..d0c60c3e62 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -350,9 +350,9 @@ 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->isPermanentEnforced() && !objectp->isAttachment() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); - BOOL enable_scale = objectp->permMove() && !objectp->isPermanentEnforced() && objectp->permModify(); - BOOL enable_rotate = objectp->permMove() && !objectp->isPermanentEnforced() && ( (objectp->permModify() && !objectp->isAttachment()) || !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")); S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); BOOL single_volume = (LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME )) diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 80dc2c0013..58c38387c3 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -495,7 +495,7 @@ void LLPanelVolume::getState( ) mComboPhysicsShapeType->add(getString("Convex Hull"), LLSD(2)); mComboPhysicsShapeType->setValue(LLSD(objectp->getPhysicsShapeType())); - mComboPhysicsShapeType->setEnabled(editable && !objectp->isPermanentEnforced()); + mComboPhysicsShapeType->setEnabled(editable && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced())); mObject = objectp; mRootObject = root_objectp; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 44a0b3adc4..49c568039c 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -644,7 +644,9 @@ bool LLSelectMgr::enableLinkObjects() { virtual bool apply(LLViewerObject* object) { - return object->permModify() && !object->isPermanentEnforced(); + LLViewerObject *root_object = (object == NULL) ? NULL : object->getRootEdit(); + return object->permModify() && !object->isPermanentEnforced() && + ((root_object == NULL) || !root_object->isPermanentEnforced()); } } func; const bool firstonly = true; @@ -657,10 +659,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->isPermanentEnforced(); + !first_editable_object->isAttachment() && !first_editable_object->isPermanentEnforced() && + ((root_object == NULL) || !root_object->isPermanentEnforced()); return new_value; } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 49e07a1fe3..3b41cdcdff 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3529,8 +3529,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->isPermanentEnforced() && (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; -- cgit v1.3 From 9252ad10fd28e98157137addde7df3ad883c9948 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 7 Jun 2012 12:29:01 -0700 Subject: PATH-696: Removing an assert as it is no longer always true. --- indra/newview/llpanelobject.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llpanelobject.cpp') diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index d0c60c3e62..0473866ac0 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -511,7 +511,6 @@ void LLPanelObject::getState( ) // Physics checkbox mIsPhysical = root_objectp->flagUsePhysics(); llassert(!is_permanent || !mIsPhysical); // should never have a permanent object that is also physical - llassert(!is_character || mIsPhysical); // all characters should also be physical mCheckPhysics->set( mIsPhysical ); mCheckPhysics->setEnabled( roots_selected>0 -- cgit v1.3 From 42f3648814923edad8a040620cb3db233597cbb9 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 11 Jun 2012 18:59:51 -0700 Subject: PATH-705: First pass at removing the agent state functionality. WIP -- still need to remove XXX_STINSON_AGENT_STATE_DELETE_ME ifdef'ed code. --- indra/newview/llpanelobject.cpp | 7 -- indra/newview/llpanelobject.h | 2 - indra/newview/llpathfindingmanager.cpp | 125 +++++---------------- indra/newview/llpathfindingmanager.h | 49 +++----- .../newview/skins/default/xui/en/notifications.xml | 19 ---- 5 files changed, 41 insertions(+), 161 deletions(-) (limited to 'indra/newview/llpanelobject.cpp') diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 0473866ac0..3786480f2e 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -279,8 +279,6 @@ BOOL LLPanelObject::postBuild() mCtrlSculptInvert = getChild("sculpt invert control"); childSetCommitCallback("sculpt invert control", onCommitSculptType, this); - LLPathfindingManager::getInstance()->registerAgentStateListener(boost::bind(&LLPanelObject::handleAgentStateCallback, this)); - // Start with everyone disabled clearCtrls(); @@ -1995,11 +1993,6 @@ void LLPanelObject::onCommitSculpt( const LLSD& data ) sendSculpt(); } -void LLPanelObject::handleAgentStateCallback() const -{ - gFloaterTools->dirty(); -} - BOOL LLPanelObject::onDropSculpt(LLInventoryItem* item) { LLTextureCtrl* mTextureCtrl = getChild("sculpt texture control"); diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index 307d63aada..34a19b3dfa 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -75,8 +75,6 @@ public: BOOL onDropSculpt(LLInventoryItem* item); static void onCommitSculptType( LLUICtrl *ctrl, void* userdata); - void handleAgentStateCallback() const; - protected: void getState(); diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 9893121980..f54c9892df 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -53,22 +53,24 @@ #include "llviewerregion.h" #include "llweb.h" -#define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc" +#define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc" -#define CAP_SERVICE_NAVMESH_STATUS "NavMeshGenerationStatus" +#define CAP_SERVICE_NAVMESH_STATUS "NavMeshGenerationStatus" -#define CAP_SERVICE_AGENT_STATE "AgentPreferences" -#define ALTER_NAVMESH_OBJECTS_FIELD "alter_navmesh_objects" +#define CAP_SERVICE_OBJECT_LINKSETS "ObjectNavMeshProperties" +#define CAP_SERVICE_TERRAIN_LINKSETS "TerrainNavMeshProperties" -#define CAP_SERVICE_OBJECT_LINKSETS "ObjectNavMeshProperties" -#define CAP_SERVICE_TERRAIN_LINKSETS "TerrainNavMeshProperties" - -#define CAP_SERVICE_CHARACTERS "CharacterProperties" +#define CAP_SERVICE_CHARACTERS "CharacterProperties" #define SIM_MESSAGE_NAVMESH_STATUS_UPDATE "/message/NavMeshStatusUpdate" -#define SIM_MESSAGE_AGENT_STATE_UPDATE "/message/AgentPreferencesUpdate" #define SIM_MESSAGE_BODY_FIELD "body" +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME +#define CAP_SERVICE_AGENT_STATE "AgentPreferences" +#define ALTER_NAVMESH_OBJECTS_FIELD "alter_navmesh_objects" +#define SIM_MESSAGE_AGENT_STATE_UPDATE "/message/AgentPreferencesUpdate" +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME + //--------------------------------------------------------------------------- // LLNavMeshSimStateChangeNode //--------------------------------------------------------------------------- @@ -81,6 +83,7 @@ public: LLHTTPRegistration gHTTPRegistrationNavMeshSimStateChangeNode(SIM_MESSAGE_NAVMESH_STATUS_UPDATE); +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // LLAgentStateChangeNode //--------------------------------------------------------------------------- @@ -92,6 +95,7 @@ public: }; LLHTTPRegistration gHTTPRegistrationAgentStateChangeNode(SIM_MESSAGE_AGENT_STATE_UPDATE); +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // NavMeshStatusResponder @@ -135,6 +139,7 @@ private: LLPathfindingNavMeshPtr mNavMeshPtr; }; +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // AgentStateResponder //--------------------------------------------------------------------------- @@ -154,6 +159,7 @@ private: std::string mCapabilityURL; LLPathfindingManager::EAgentState mRequestedAgentState; }; +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // LinksetsResponder @@ -262,10 +268,7 @@ private: LLPathfindingManager::LLPathfindingManager() : LLSingleton(), - mNavMeshMap(), - mAgentStateSignal(), - mAgentState(kAgentStateUnknown), - mLastKnownNonErrorAgentState(kAgentStateUnknown) + mNavMeshMap() { } @@ -336,51 +339,12 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion) } } +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME LLPathfindingManager::agent_state_slot_t LLPathfindingManager::registerAgentStateListener(agent_state_callback_t pAgentStateCallback) { return mAgentStateSignal.connect(pAgentStateCallback); } - -LLPathfindingManager::EAgentState LLPathfindingManager::getAgentState() -{ - if (!isPathfindingEnabledForCurrentRegion()) - { - setAgentState(kAgentStateNotEnabled); - } - else - { - if (!isValidAgentState(mAgentState)) - { - requestGetAgentState(); - } - } - - return mAgentState; -} - -LLPathfindingManager::EAgentState LLPathfindingManager::getLastKnownNonErrorAgentState() const -{ - return mLastKnownNonErrorAgentState; -} - -void LLPathfindingManager::requestSetAgentState(EAgentState pRequestedAgentState) -{ - llassert(isValidAgentState(pRequestedAgentState)); - std::string agentStateURL = getAgentStateURLForCurrentRegion(); - - if (agentStateURL.empty()) - { - setAgentState(kAgentStateNotEnabled); - } - else - { - LLSD request; - request[ALTER_NAVMESH_OBJECTS_FIELD] = static_cast(pRequestedAgentState == kAgentStateUnfrozen); - - LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL, pRequestedAgentState); - LLHTTPClient::post(agentStateURL, request, responder); - } -} +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME void LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, object_request_callback_t pLinksetsCallback) const { @@ -623,18 +587,13 @@ LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion return getNavMeshForRegion(regionUUID); } -bool LLPathfindingManager::isValidAgentState(EAgentState pAgentState) -{ - return ((pAgentState == kAgentStateFrozen) || (pAgentState == kAgentStateUnfrozen)); -} - +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME void LLPathfindingManager::requestGetAgentState() { std::string agentStateURL = getAgentStateURLForCurrentRegion(); if (agentStateURL.empty()) { - setAgentState(kAgentStateNotEnabled); } else { @@ -643,58 +602,25 @@ void LLPathfindingManager::requestGetAgentState() } } -void LLPathfindingManager::setAgentState(EAgentState pAgentState) -{ - mAgentState = pAgentState; - - if (mAgentState != kAgentStateError) - { - mLastKnownNonErrorAgentState = mAgentState; - } - - mAgentStateSignal(mAgentState); -} - void LLPathfindingManager::handleAgentStateResult(const LLSD &pContent, EAgentState pRequestedAgentState) { llassert(pContent.has(ALTER_NAVMESH_OBJECTS_FIELD)); llassert(pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).isBoolean()); EAgentState agentState = (pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen); - if (isValidAgentState(pRequestedAgentState) && (agentState != pRequestedAgentState)) + if ((agentState != pRequestedAgentState)) { agentState = kAgentStateError; llassert(0); } - - setAgentState(agentState); } void LLPathfindingManager::handleAgentStateError(U32 pStatus, const std::string &pReason, const std::string &pURL) { llwarns << "error with request to URL '" << pURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; - setAgentState(kAgentStateError); } +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME -void LLPathfindingManager::handleAgentStateUpdate(const LLSD &pContent) -{ - llassert(pContent.has(ALTER_NAVMESH_OBJECTS_FIELD)); - llassert(pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).isBoolean()); - EAgentState agentState = (pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen); - - setAgentState(agentState); - - LLSD substitutions, payload; - LLNotificationsUtil::add("AutomaticAgentStateUnfreeze", substitutions, payload, boost::bind(&LLPathfindingManager::handleAgentStateUserNotification, this, _1, _2)); -} - -void LLPathfindingManager::handleAgentStateUserNotification(const LLSD &pNotification, const LLSD &pResponse) -{ - if (LLNotificationsUtil::getSelectedOption(pNotification, pResponse) == 1) - { - LLWeb::loadURL(LLTrans::getString("Pathfinding_Wiki_URL")); - } -} std::string LLPathfindingManager::getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const { @@ -706,11 +632,6 @@ std::string LLPathfindingManager::getRetrieveNavMeshURLForRegion(LLViewerRegion return getCapabilityURLForRegion(pRegion, CAP_SERVICE_RETRIEVE_NAVMESH); } -std::string LLPathfindingManager::getAgentStateURLForCurrentRegion() const -{ - return getCapabilityURLForCurrentRegion(CAP_SERVICE_AGENT_STATE); -} - std::string LLPathfindingManager::getObjectLinksetsURLForCurrentRegion() const { return getCapabilityURLForCurrentRegion(CAP_SERVICE_OBJECT_LINKSETS); @@ -769,6 +690,7 @@ void LLNavMeshSimStateChangeNode::post(ResponsePtr pResponse, const LLSD &pConte LLPathfindingManager::getInstance()->handleNavMeshStatusUpdate(navMeshStatus); } +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // LLAgentStateChangeNode //--------------------------------------------------------------------------- @@ -782,6 +704,7 @@ void LLAgentStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, c llassert(pInput.get(SIM_MESSAGE_BODY_FIELD).isMap()); LLPathfindingManager::getInstance()->handleAgentStateUpdate(pInput.get(SIM_MESSAGE_BODY_FIELD)); } +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // NavMeshStatusResponder @@ -845,6 +768,7 @@ void NavMeshResponder::error(U32 pStatus, const std::string& pReason) mNavMeshPtr->handleNavMeshError(pStatus, pReason, mCapabilityURL, mNavMeshVersion); } +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // AgentStateResponder //--------------------------------------------------------------------------- @@ -869,6 +793,7 @@ void AgentStateResponder::error(U32 pStatus, const std::string &pReason) { LLPathfindingManager::getInstance()->handleAgentStateError(pStatus, pReason, mCapabilityURL); } +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME //--------------------------------------------------------------------------- // LinksetsResponder diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index 3aafef3565..40c0e6b140 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -46,24 +46,10 @@ class LLPathfindingNavMeshStatus; class LLPathfindingManager : public LLSingleton { friend class LLNavMeshSimStateChangeNode; - friend class LLAgentStateChangeNode; friend class NavMeshStatusResponder; - friend class AgentStateResponder; public: typedef std::map NavMeshMap; - typedef enum { - kAgentStateUnknown, - kAgentStateFrozen, - kAgentStateUnfrozen, - kAgentStateNotEnabled, - kAgentStateError - } EAgentState; - - typedef boost::function agent_state_callback_t; - typedef boost::signals2::signal agent_state_signal_t; - typedef boost::signals2::connection agent_state_slot_t; - typedef enum { kRequestStarted, kRequestCompleted, @@ -86,11 +72,6 @@ public: LLPathfindingNavMesh::navmesh_slot_t registerNavMeshListenerForRegion(LLViewerRegion *pRegion, LLPathfindingNavMesh::navmesh_callback_t pNavMeshCallback); void requestGetNavMeshForRegion(LLViewerRegion *pRegion); - agent_state_slot_t registerAgentStateListener(agent_state_callback_t pAgentStateCallback); - EAgentState getAgentState(); - EAgentState getLastKnownNonErrorAgentState() const; - void requestSetAgentState(EAgentState pAgentState); - typedef U32 request_id_t; typedef boost::function object_request_callback_t; @@ -99,6 +80,16 @@ public: void requestGetCharacters(request_id_t pRequestId, object_request_callback_t pCharactersCallback) const; +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME + friend class LLAgentStateChangeNode; + friend class AgentStateResponder; + typedef boost::function agent_state_callback_t; + typedef boost::signals2::signal agent_state_signal_t; + typedef boost::signals2::connection agent_state_slot_t; + + agent_state_slot_t registerAgentStateListener(agent_state_callback_t pAgentStateCallback); +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME + protected: private: @@ -114,18 +105,8 @@ private: LLPathfindingNavMeshPtr getNavMeshForRegion(const LLUUID &pRegionUUID); LLPathfindingNavMeshPtr getNavMeshForRegion(LLViewerRegion *pRegion); - static bool isValidAgentState(EAgentState pAgentState); - - void requestGetAgentState(); - void setAgentState(EAgentState pAgentState); - void handleAgentStateResult(const LLSD &pContent, EAgentState pRequestedAgentState); - void handleAgentStateError(U32 pStatus, const std::string &pReason, const std::string &pURL); - void handleAgentStateUpdate(const LLSD &pContent); - void handleAgentStateUserNotification(const LLSD &pNotification, const LLSD &pResponse); - std::string getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const; std::string getRetrieveNavMeshURLForRegion(LLViewerRegion *pRegion) const; - std::string getAgentStateURLForCurrentRegion() const; std::string getObjectLinksetsURLForCurrentRegion() const; std::string getTerrainLinksetsURLForCurrentRegion() const; std::string getCharactersURLForCurrentRegion() const; @@ -134,11 +115,13 @@ private: std::string getCapabilityURLForRegion(LLViewerRegion *pRegion, const std::string &pCapabilityName) const; LLViewerRegion *getCurrentRegion() const; - NavMeshMap mNavMeshMap; +#ifdef XXX_STINSON_AGENT_STATE_DELETE_ME + void requestGetAgentState(); + void handleAgentStateResult(const LLSD &pContent, EAgentState pRequestedAgentState); + void handleAgentStateError(U32 pStatus, const std::string &pReason, const std::string &pURL); +#endif // XXX_STINSON_AGENT_STATE_DELETE_ME - agent_state_signal_t mAgentStateSignal; - EAgentState mAgentState; - EAgentState mLastKnownNonErrorAgentState; + NavMeshMap mNavMeshMap; }; #endif // LL_LLPATHFINDINGMANAGER_H diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index af00d66ff9..62b2642b34 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1291,25 +1291,6 @@ The region [REGION] does not allow terraforming. fail - -You have automatically switched into Unfrozen mode because of one of the following reasons: - -- You rezzed an object marked as permanent -- You returned an object marked as permanent - -After you finish modifying your permanent objects, please remember to switch back to Frozen mode from the menu option Build->Pathfinding->Basic Setup. - confirm - - - Date: Wed, 13 Jun 2012 14:10:15 -0700 Subject: Enabling toggle of the Physical attribute for character objects. --- indra/newview/llpanelobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelobject.cpp') diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 3786480f2e..d7d5d9a078 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -513,7 +513,7 @@ void LLPanelObject::getState( ) mCheckPhysics->set( mIsPhysical ); mCheckPhysics->setEnabled( roots_selected>0 && (editable || gAgent.isGodlike()) - && !is_flexible && !is_permanent && !is_character); + && !is_flexible && !is_permanent); mIsTemporary = root_objectp->flagTemporaryOnRez(); llassert(!is_permanent || !mIsTemporary); // should never has a permanent object that is also temporary -- cgit v1.3 From 379aff3520d368d1119e00f46684670030472832 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Wed, 13 Jun 2012 16:57:35 -0700 Subject: PATH-713: Disabling all editable object fields on the build tools floater when a static pathfinding object is in not in the current region. --- indra/newview/llfloatertools.cpp | 5 ++++- indra/newview/llpanelcontents.cpp | 4 +++- indra/newview/llpanelface.cpp | 2 +- indra/newview/llpanelobject.cpp | 15 ++++++++------- indra/newview/llpanelpermissions.cpp | 12 ++++++------ indra/newview/llpanelvolume.cpp | 2 +- indra/newview/llsidepaneltaskinfo.cpp | 12 ++++++------ 7 files changed, 29 insertions(+), 23 deletions(-) (limited to 'indra/newview/llpanelobject.cpp') diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index c8599df161..105636364c 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -1198,7 +1198,10 @@ void LLFloaterTools::getMediaState() return; } - bool editable = (first_object->permModify() || selectedMediaEditable()); + BOOL is_nonpermanent = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() + && LLSelectMgr::getInstance()->selectGetRootsNonPermanent()) + || LLSelectMgr::getInstance()->selectGetNonPermanent(); + bool editable = is_nonpermanent && (first_object->permModify() || selectedMediaEditable()); // Check modify permissions and whether any selected objects are in // the process of being fetched. If they are, then we're not editable diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index a64b4ec94d..77e1487f38 100644 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -116,7 +116,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 ); @@ -127,6 +127,8 @@ void LLPanelContents::getState(LLViewerObject *objectp ) ((LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() == 1) || (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1))); + getChildView("button permissions")->setEnabled(!objectp->isPermanentEnforced()); + mPanelInventoryObject->setEnabled(!objectp->isPermanentEnforced()); } void LLPanelContents::refresh() diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 7301b305b2..05d9a32108 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -504,7 +504,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 getChildView("textbox autofix")->setEnabled(editable); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index d7d5d9a078..be4ce4700a 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -468,9 +468,16 @@ void LLPanelObject::getState( ) getChildView("select_single")->setVisible( TRUE); getChildView("select_single")->setEnabled(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; @@ -500,12 +507,6 @@ void LLPanelObject::getState( ) } } - 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 - // Physics checkbox mIsPhysical = root_objectp->flagUsePhysics(); llassert(!is_permanent || !mIsPhysical); // should never have a permanent object that is also physical diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index f3a16dbbf1..64481717f5 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -393,7 +393,7 @@ void LLPanelPermissions::refresh() } } - getChildView("button set group")->setEnabled(owners_identical && (mOwnerID == gAgent.getID())); + getChildView("button set group")->setEnabled(owners_identical && (mOwnerID == gAgent.getID()) && is_nonpermanent); getChildView("Name:")->setEnabled(TRUE); LLLineEditor* LineEditorObjectName = getChild("Object Name"); @@ -423,7 +423,7 @@ void LLPanelPermissions::refresh() // 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; } @@ -603,12 +603,12 @@ void LLPanelPermissions::refresh() BOOL has_change_perm_ability = FALSE; BOOL has_change_sale_ability = FALSE; - if (valid_base_perms && + if (valid_base_perms && is_nonpermanent && (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE)))) { has_change_perm_ability = TRUE; } - if (valid_base_perms && + if (valid_base_perms && is_nonpermanent && (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE)))) { has_change_sale_ability = TRUE; @@ -821,8 +821,8 @@ void LLPanelPermissions::refresh() combo_click_action->setValue(LLSD(combo_value)); } } - getChildView("label click action")->setEnabled(is_perm_modify && all_volume); - getChildView("clickaction")->setEnabled(is_perm_modify && all_volume); + getChildView("label click action")->setEnabled(is_perm_modify && is_nonpermanent && all_volume); + getChildView("clickaction")->setEnabled(is_perm_modify && is_nonpermanent && all_volume); } diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 792d852d53..13b746dbab 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -258,7 +258,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; diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 4b49ae9f43..4b84bbb265 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -393,7 +393,7 @@ void LLSidepanelTaskInfo::refresh() } } - getChildView("button set group")->setEnabled(owners_identical && (mOwnerID == gAgent.getID())); + getChildView("button set group")->setEnabled(owners_identical && (mOwnerID == gAgent.getID()) && is_nonpermanent); getChildView("Name:")->setEnabled(TRUE); LLLineEditor* LineEditorObjectName = getChild("Object Name"); @@ -423,7 +423,7 @@ void LLSidepanelTaskInfo::refresh() // 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; } @@ -603,12 +603,12 @@ void LLSidepanelTaskInfo::refresh() BOOL has_change_perm_ability = FALSE; BOOL has_change_sale_ability = FALSE; - if (valid_base_perms && + if (valid_base_perms && is_nonpermanent && (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_MANIPULATE)))) { has_change_perm_ability = TRUE; } - if (valid_base_perms && + if (valid_base_perms && is_nonpermanent && (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id, GP_OBJECT_SET_SALE)))) { has_change_sale_ability = TRUE; @@ -820,8 +820,8 @@ void LLSidepanelTaskInfo::refresh() ComboClickAction->setCurrentByIndex((S32)click_action); } } - getChildView("label click action")->setEnabled(is_perm_modify && all_volume); - getChildView("clickaction")->setEnabled(is_perm_modify && all_volume); + getChildView("label click action")->setEnabled(is_perm_modify && is_nonpermanent && all_volume); + getChildView("clickaction")->setEnabled(is_perm_modify && is_nonpermanent && all_volume); if (!getIsEditing()) { -- cgit v1.3 From f87034c3c2b9e11dee678dc3ff3458d2485c1710 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Wed, 20 Jun 2012 18:07:04 -0700 Subject: PATH-760: First pass at Leo's new design for the build floater. --- indra/newview/llpanelobject.cpp | 16 --- indra/newview/llpanelobject.h | 2 - indra/newview/llpanelpermissions.cpp | 27 +++++ .../newview/skins/default/xui/en/floater_tools.xml | 113 ++++++++++++--------- indra/newview/skins/default/xui/en/strings.xml | 6 +- 5 files changed, 96 insertions(+), 68 deletions(-) (limited to 'indra/newview/llpanelobject.cpp') diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index be4ce4700a..a740db00e2 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -121,12 +121,6 @@ BOOL LLPanelObject::postBuild() mCheckPhantom = getChild("Phantom Checkbox Ctrl"); childSetCommitCallback("Phantom Checkbox Ctrl",onCommitPhantom,this); - // Permanent checkbox - mCheckPermanent = getChild("Permanent Checkbox Ctrl"); - - // Character checkbox - mCheckCharacter = getChild("Character Checkbox Ctrl"); - // Position mLabelPosition = getChild("label position"); mCtrlPosX = getChild("Pos X"); @@ -527,12 +521,6 @@ void LLPanelObject::getState( ) mCheckPhantom->set( mIsPhantom ); mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible && !is_permanent_enforced && !is_character); - mCheckPermanent->set(is_permanent); - mCheckPermanent->setEnabled(FALSE); - - mCheckCharacter->set(is_character); - mCheckCharacter->setEnabled(FALSE); - //---------------------------------------------------------------------------- S32 selected_item = MI_BOX; @@ -1884,10 +1872,6 @@ void LLPanelObject::clearCtrls() mCheckTemporary ->setEnabled( FALSE ); mCheckPhantom ->set(FALSE); mCheckPhantom ->setEnabled( FALSE ); - mCheckPermanent ->set(FALSE); - mCheckPermanent ->setEnabled( FALSE ); - mCheckCharacter ->set(FALSE); - mCheckCharacter ->setEnabled( FALSE ); // Disable text labels mLabelPosition ->setEnabled( FALSE ); diff --git a/indra/newview/llpanelobject.h b/indra/newview/llpanelobject.h index 34a19b3dfa..c4cf27ab1a 100644 --- a/indra/newview/llpanelobject.h +++ b/indra/newview/llpanelobject.h @@ -150,8 +150,6 @@ protected: LLCheckBoxCtrl *mCheckPhysics; LLCheckBoxCtrl *mCheckTemporary; LLCheckBoxCtrl *mCheckPhantom; - LLCheckBoxCtrl *mCheckPermanent; - LLCheckBoxCtrl *mCheckCharacter; LLTextureCtrl *mCtrlSculptTexture; LLTextBox *mLabelSculptType; diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 64481717f5..262dadf907 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -62,6 +62,7 @@ #include "llspinctrl.h" #include "roles_constants.h" #include "llgroupactions.h" +#include "lltrans.h" U8 string_value_to_click_action(std::string p_value); @@ -180,6 +181,9 @@ void LLPanelPermissions::disableAll() getChildView("perm_modify")->setEnabled(FALSE); getChild("perm_modify")->setValue(LLStringUtil::null); + getChildView("pathfinding_attributes_value")->setEnabled(FALSE); + getChild("pathfinding_attributes_value")->setValue(LLStringUtil::null); + getChildView("Creator:")->setEnabled(FALSE); getChild("Creator Name")->setValue(LLStringUtil::null); getChildView("Creator Name")->setEnabled(FALSE); @@ -329,6 +333,29 @@ void LLPanelPermissions::refresh() getChildView("perm_modify")->setEnabled(TRUE); getChild("perm_modify")->setValue(MODIFY_INFO_STRINGS[string_index]); + getChildView("pathfinding_attributes_value")->setEnabled(TRUE); + std::string pfAttrName; + if (is_one_object) + { + if (objectp->flagObjectPermanent()) + { + pfAttrName = "Pathfinding_Object_Attr_Permanent"; + } + else if (objectp->flagCharacter()) + { + pfAttrName = "Pathfinding_Object_Attr_Character"; + } + else + { + pfAttrName = "Pathfinding_Object_Attr_None"; + } + } + else + { + pfAttrName = "Pathfinding_Object_Attr_MultiSelect"; + } + getChild("pathfinding_attributes_value")->setValue(LLTrans::getString(pfAttrName)); + getChildView("Permissions:")->setEnabled(TRUE); // Update creator text field diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index c881bb9d81..c49ce90e6b 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -980,7 +980,7 @@ height="19" layout="topleft" name="Owner:" - top_pad="13" + top_pad="3" width="90"> Owner: @@ -1008,7 +1008,7 @@ left="10" height="18" name="Group:" - top_pad="17" + top_pad="3" width="75"> Group: @@ -1037,7 +1037,7 @@ layout="topleft" name="checkbox share with group" tool_tip="Allow all members of the set group to share your modify permissions for this object. You must Deed to enable role restrictions." - top_pad="10" + top_pad="5" left="100" width="87" />