diff options
Diffstat (limited to 'linden/indra/newview/llpanelobject.cpp')
-rw-r--r-- | linden/indra/newview/llpanelobject.cpp | 64 |
1 files changed, 37 insertions, 27 deletions
diff --git a/linden/indra/newview/llpanelobject.cpp b/linden/indra/newview/llpanelobject.cpp index ae1c213..3e7be68 100644 --- a/linden/indra/newview/llpanelobject.cpp +++ b/linden/indra/newview/llpanelobject.cpp | |||
@@ -67,6 +67,7 @@ | |||
67 | #include "pipeline.h" | 67 | #include "pipeline.h" |
68 | #include "viewer.h" | 68 | #include "viewer.h" |
69 | #include "llvieweruictrlfactory.h" | 69 | #include "llvieweruictrlfactory.h" |
70 | #include "llfirstuse.h" | ||
70 | 71 | ||
71 | #include "lldrawpool.h" | 72 | #include "lldrawpool.h" |
72 | 73 | ||
@@ -256,32 +257,36 @@ BOOL LLPanelObject::postBuild() | |||
256 | 257 | ||
257 | // Sculpt | 258 | // Sculpt |
258 | mCtrlSculptTexture = LLUICtrlFactory::getTexturePickerByName(this,"sculpt texture control"); | 259 | mCtrlSculptTexture = LLUICtrlFactory::getTexturePickerByName(this,"sculpt texture control"); |
259 | mCtrlSculptTexture->setDefaultImageAssetID(LLUUID(SCULPT_DEFAULT_TEXTURE)); | 260 | if (mCtrlSculptTexture) |
260 | mCtrlSculptTexture->setCommitCallback( LLPanelObject::onCommitSculpt ); | 261 | { |
261 | mCtrlSculptTexture->setOnCancelCallback( LLPanelObject::onCancelSculpt ); | 262 | mCtrlSculptTexture->setDefaultImageAssetID(LLUUID(SCULPT_DEFAULT_TEXTURE)); |
262 | mCtrlSculptTexture->setOnSelectCallback( LLPanelObject::onSelectSculpt ); | 263 | mCtrlSculptTexture->setCommitCallback( LLPanelObject::onCommitSculpt ); |
263 | mCtrlSculptTexture->setDropCallback(LLPanelObject::onDropSculpt); | 264 | mCtrlSculptTexture->setOnCancelCallback( LLPanelObject::onCancelSculpt ); |
264 | mCtrlSculptTexture->setCallbackUserData( this ); | 265 | mCtrlSculptTexture->setOnSelectCallback( LLPanelObject::onSelectSculpt ); |
265 | // Don't allow (no copy) or (no transfer) textures to be selected during immediate mode | 266 | mCtrlSculptTexture->setDropCallback(LLPanelObject::onDropSculpt); |
266 | mCtrlSculptTexture->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); | 267 | mCtrlSculptTexture->setCallbackUserData( this ); |
267 | // Allow any texture to be used during non-immediate mode. | 268 | // Don't allow (no copy) or (no transfer) textures to be selected during immediate mode |
268 | mCtrlSculptTexture->setNonImmediateFilterPermMask(PERM_NONE); | 269 | mCtrlSculptTexture->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); |
269 | LLAggregatePermissions texture_perms; | 270 | // Allow any texture to be used during non-immediate mode. |
270 | if (gSelectMgr->selectGetAggregateTexturePermissions(texture_perms)) | 271 | mCtrlSculptTexture->setNonImmediateFilterPermMask(PERM_NONE); |
271 | { | 272 | LLAggregatePermissions texture_perms; |
272 | BOOL can_copy = | 273 | if (gSelectMgr->selectGetAggregateTexturePermissions(texture_perms)) |
273 | texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_EMPTY || | 274 | { |
274 | texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_ALL; | 275 | BOOL can_copy = |
275 | BOOL can_transfer = | 276 | texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_EMPTY || |
276 | texture_perms.getValue(PERM_TRANSFER) == LLAggregatePermissions::AP_EMPTY || | 277 | texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_ALL; |
277 | texture_perms.getValue(PERM_TRANSFER) == LLAggregatePermissions::AP_ALL; | 278 | BOOL can_transfer = |
278 | mCtrlSculptTexture->setCanApplyImmediately(can_copy && can_transfer); | 279 | texture_perms.getValue(PERM_TRANSFER) == LLAggregatePermissions::AP_EMPTY || |
279 | } | 280 | texture_perms.getValue(PERM_TRANSFER) == LLAggregatePermissions::AP_ALL; |
280 | else | 281 | mCtrlSculptTexture->setCanApplyImmediately(can_copy && can_transfer); |
281 | { | 282 | } |
282 | mCtrlSculptTexture->setCanApplyImmediately(FALSE); | 283 | else |
284 | { | ||
285 | mCtrlSculptTexture->setCanApplyImmediately(FALSE); | ||
286 | } | ||
283 | } | 287 | } |
284 | 288 | ||
289 | |||
285 | // Start with everyone disabled | 290 | // Start with everyone disabled |
286 | clearCtrls(); | 291 | clearCtrls(); |
287 | 292 | ||
@@ -347,9 +352,9 @@ void LLPanelObject::getState( ) | |||
347 | } | 352 | } |
348 | 353 | ||
349 | // can move or rotate only linked group with move permissions, or sub-object with move and modify perms | 354 | // can move or rotate only linked group with move permissions, or sub-object with move and modify perms |
350 | BOOL enable_move = objectp->permMove() && !objectp->isAttachment() && (objectp->permModify() || gSavedSettings.getBOOL("SelectLinkedSet")); | 355 | BOOL enable_move = objectp->permMove() && !objectp->isAttachment() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); |
351 | BOOL enable_scale = objectp->permMove() && objectp->permModify(); | 356 | BOOL enable_scale = objectp->permMove() && objectp->permModify(); |
352 | BOOL enable_rotate = objectp->permMove() && ( (objectp->permModify() && !objectp->isAttachment()) || gSavedSettings.getBOOL("SelectLinkedSet")); | 357 | BOOL enable_rotate = objectp->permMove() && ( (objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts")); |
353 | 358 | ||
354 | LLVector3 vec; | 359 | LLVector3 vec; |
355 | if (enable_move) | 360 | if (enable_move) |
@@ -638,6 +643,7 @@ void LLPanelObject::getState( ) | |||
638 | if (objectp->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT)) | 643 | if (objectp->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT)) |
639 | { | 644 | { |
640 | selected_item = MI_SCULPT; | 645 | selected_item = MI_SCULPT; |
646 | LLFirstUse::useSculptedPrim(); | ||
641 | } | 647 | } |
642 | 648 | ||
643 | 649 | ||
@@ -1044,7 +1050,11 @@ void LLPanelObject::getState( ) | |||
1044 | { | 1050 | { |
1045 | mTextureCtrl->setTentative(FALSE); | 1051 | mTextureCtrl->setTentative(FALSE); |
1046 | mTextureCtrl->setEnabled(editable); | 1052 | mTextureCtrl->setEnabled(editable); |
1047 | mTextureCtrl->setImageAssetID(sculpt_params->getSculptTexture()); | 1053 | if (editable) |
1054 | mTextureCtrl->setImageAssetID(sculpt_params->getSculptTexture()); | ||
1055 | else | ||
1056 | mTextureCtrl->setImageAssetID(LLUUID::null); | ||
1057 | |||
1048 | 1058 | ||
1049 | if (mObject != objectp) // we've just selected a new object, so save for undo | 1059 | if (mObject != objectp) // we've just selected a new object, so save for undo |
1050 | mSculptTextureRevert = sculpt_params->getSculptTexture(); | 1060 | mSculptTextureRevert = sculpt_params->getSculptTexture(); |