diff options
Diffstat (limited to 'linden/indra/newview/llpanelcontents.cpp')
-rw-r--r-- | linden/indra/newview/llpanelcontents.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/linden/indra/newview/llpanelcontents.cpp b/linden/indra/newview/llpanelcontents.cpp index d91790e..e13ec46 100644 --- a/linden/indra/newview/llpanelcontents.cpp +++ b/linden/indra/newview/llpanelcontents.cpp | |||
@@ -66,6 +66,10 @@ | |||
66 | #include "lltoolcomp.h" | 66 | #include "lltoolcomp.h" |
67 | #include "llpanelinventory.h" | 67 | #include "llpanelinventory.h" |
68 | 68 | ||
69 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
70 | #include "llvoavatar.h" | ||
71 | // [/RLVa:KB] | ||
72 | |||
69 | // | 73 | // |
70 | // Imported globals | 74 | // Imported globals |
71 | // | 75 | // |
@@ -117,6 +121,24 @@ void LLPanelContents::getState(LLViewerObject *objectp ) | |||
117 | && ( objectp->permYouOwner() || ( !group_id.isNull() && gAgent.isInGroup(group_id) ))); // solves SL-23488 | 121 | && ( objectp->permYouOwner() || ( !group_id.isNull() && gAgent.isInGroup(group_id) ))); // solves SL-23488 |
118 | BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); | 122 | BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); |
119 | 123 | ||
124 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0g | ||
125 | if ( (rlv_handler_t::isEnabled()) && (editable) ) | ||
126 | { | ||
127 | // Don't allow creation of new scripts if it's undetachable | ||
128 | editable = gRlvHandler.isDetachable(objectp); | ||
129 | |||
130 | // Don't allow creation of new scripts if we're @unsit=n or @sittp=n restricted and we're sitting on the selection | ||
131 | if ( (editable) && ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP))) ) | ||
132 | { | ||
133 | LLVOAvatar* pAvatar = gAgent.getAvatarObject(); | ||
134 | // Only check the first (non-)root object because nothing else would result in enabling the button (see below) | ||
135 | LLViewerObject* pObj = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(TRUE); | ||
136 | |||
137 | editable = (pObj) && (pAvatar) && ((!pAvatar->mIsSitting) || (pAvatar->getRoot() != pObj->getRootEdit())); | ||
138 | } | ||
139 | } | ||
140 | // [/RLVa:KB] | ||
141 | |||
120 | // Edit script button - ok if object is editable and there's an | 142 | // Edit script button - ok if object is editable and there's an |
121 | // unambiguous destination for the object. | 143 | // unambiguous destination for the object. |
122 | if( editable && | 144 | if( editable && |
@@ -160,6 +182,22 @@ void LLPanelContents::onClickNewScript(void *userdata) | |||
160 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(children_ok); | 182 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(children_ok); |
161 | if(object) | 183 | if(object) |
162 | { | 184 | { |
185 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
186 | if (rlv_handler_t::isEnabled()) // Fallback code [see LLPanelContents::getState()] | ||
187 | { | ||
188 | if (!gRlvHandler.isDetachable(object)) | ||
189 | { | ||
190 | return; // Disallow creating new scripts in a locked attachment | ||
191 | } | ||
192 | else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) ) | ||
193 | { | ||
194 | LLVOAvatar* pAvatar = gAgent.getAvatarObject(); | ||
195 | if ( (pAvatar) && (pAvatar->mIsSitting) && (pAvatar->getRoot() == object->getRootEdit()) ) | ||
196 | return; // .. or in a linkset the avie is sitting on under @unsit=n/@sittp=n | ||
197 | } | ||
198 | } | ||
199 | // [/RLVa:KB] | ||
200 | |||
163 | LLPermissions perm; | 201 | LLPermissions perm; |
164 | perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null); | 202 | perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null); |
165 | perm.initMasks( | 203 | perm.initMasks( |