diff options
author | McCabe Maxsted | 2009-09-14 17:52:41 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-09-14 17:52:41 -0700 |
commit | 7f090f7bec5264ca9e203c27dfb6b2992bb2bcbd (patch) | |
tree | 0243666021de3ae6ac61a6c6f4e57d42771fe964 /linden/indra/newview/llinventorybridge.cpp | |
parent | Applied BlockClickSit debug setting from Emerald to block sit click action (diff) | |
download | meta-impy-7f090f7bec5264ca9e203c27dfb6b2992bb2bcbd.zip meta-impy-7f090f7bec5264ca9e203c27dfb6b2992bb2bcbd.tar.gz meta-impy-7f090f7bec5264ca9e203c27dfb6b2992bb2bcbd.tar.bz2 meta-impy-7f090f7bec5264ca9e203c27dfb6b2992bb2bcbd.tar.xz |
Merged in jacek/next
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llinventorybridge.cpp | 139 |
1 files changed, 129 insertions, 10 deletions
diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index 3505bd3..19a5ade 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp | |||
@@ -1923,6 +1923,12 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
1923 | LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); | 1923 | LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); |
1924 | LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND); | 1924 | LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND); |
1925 | 1925 | ||
1926 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
1927 | // Fixes LL bug | ||
1928 | mItems.clear(); | ||
1929 | mDisabledItems.clear(); | ||
1930 | // [/RLVa:KB] | ||
1931 | |||
1926 | if (lost_and_found_id == mUUID) | 1932 | if (lost_and_found_id == mUUID) |
1927 | { | 1933 | { |
1928 | // This is the lost+found folder. | 1934 | // This is the lost+found folder. |
@@ -2936,6 +2942,13 @@ void open_notecard(LLViewerInventoryItem* inv_item, | |||
2936 | const LLUUID& source_id, | 2942 | const LLUUID& source_id, |
2937 | BOOL take_focus) | 2943 | BOOL take_focus) |
2938 | { | 2944 | { |
2945 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
2946 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour("viewnote")) ) | ||
2947 | { | ||
2948 | return; | ||
2949 | } | ||
2950 | // [/RLVa:KB] | ||
2951 | |||
2939 | // See if we can bring an existing preview to the front | 2952 | // See if we can bring an existing preview to the front |
2940 | if(!LLPreview::show(inv_item->getUUID(), take_focus)) | 2953 | if(!LLPreview::show(inv_item->getUUID(), take_focus)) |
2941 | { | 2954 | { |
@@ -3261,7 +3274,14 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model | |||
3261 | item = (LLViewerInventoryItem*)gInventory.getItem(object_id); | 3274 | item = (LLViewerInventoryItem*)gInventory.getItem(object_id); |
3262 | if(item && gInventory.isObjectDescendentOf(object_id, gAgent.getInventoryRootID())) | 3275 | if(item && gInventory.isObjectDescendentOf(object_id, gAgent.getInventoryRootID())) |
3263 | { | 3276 | { |
3264 | rez_attachment(item, NULL); | 3277 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) |
3278 | // User picked "Wear" so either nothing is locked, or we need to look up the specific attach point from its name | ||
3279 | // (NOTE: rez_attachment will take care of deciding whether or not we *can* attach) | ||
3280 | rez_attachment(item, | ||
3281 | ((!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment()) || (RlvSettings::getEnableWear())) | ||
3282 | ? NULL : gRlvHandler.getAttachPoint(item, true)); | ||
3283 | // [/RLVa:KB] | ||
3284 | // rez_attachment(item, NULL); | ||
3265 | } | 3285 | } |
3266 | else if(item && item->isComplete()) | 3286 | else if(item && item->isComplete()) |
3267 | { | 3287 | { |
@@ -3280,6 +3300,15 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model | |||
3280 | else if ("detach" == action) | 3300 | else if ("detach" == action) |
3281 | { | 3301 | { |
3282 | LLInventoryItem* item = gInventory.getItem(mUUID); | 3302 | LLInventoryItem* item = gInventory.getItem(mUUID); |
3303 | |||
3304 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
3305 | // Fall-through: if there's a "Detach from yourself" code path we missed then we'll still disallow the detach here | ||
3306 | if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(item)) ) | ||
3307 | { | ||
3308 | return; | ||
3309 | } | ||
3310 | // [/RLVa:KB] | ||
3311 | |||
3283 | if( item ) | 3312 | if( item ) |
3284 | { | 3313 | { |
3285 | gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); | 3314 | gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); |
@@ -3369,11 +3398,24 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach | |||
3369 | rez_action->mAttachPt = attach_pt; | 3398 | rez_action->mAttachPt = attach_pt; |
3370 | if (attachment && attachment->getObject()) | 3399 | if (attachment && attachment->getObject()) |
3371 | { | 3400 | { |
3372 | gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment_rez, (void*)rez_action); | 3401 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) |
3402 | if ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isDetachable(attach_pt)) ) | ||
3403 | gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment_rez, (void*)rez_action); | ||
3404 | else | ||
3405 | delete rez_action; | ||
3406 | // [/RLVa] | ||
3407 | // gViewerWindow->alertXml("ReplaceAttachment", confirm_replace_attachment_rez, (void*)rez_action); | ||
3373 | } | 3408 | } |
3374 | else | 3409 | else |
3375 | { | 3410 | { |
3376 | confirm_replace_attachment_rez(0/*YES*/, (void*)rez_action); | 3411 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) |
3412 | // Don't allow wear to default attach point if there are any locked attachments | ||
3413 | if ( (!rlv_handler_t::isEnabled()) || (0 != attach_pt) || (!gRlvHandler.hasLockedAttachment()) || (RlvSettings::getEnableWear()) ) | ||
3414 | confirm_replace_attachment_rez(0/*YES*/, (void*)rez_action); | ||
3415 | else | ||
3416 | delete rez_action; | ||
3417 | // [/RLVa] | ||
3418 | // confirm_replace_attachment_rez(0/*YES*/, (void*)rez_action); | ||
3377 | } | 3419 | } |
3378 | } | 3420 | } |
3379 | 3421 | ||
@@ -3442,6 +3484,11 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
3442 | if( avatarp->isWearingAttachment( mUUID ) ) | 3484 | if( avatarp->isWearingAttachment( mUUID ) ) |
3443 | { | 3485 | { |
3444 | items.push_back(std::string("Detach From Yourself")); | 3486 | items.push_back(std::string("Detach From Yourself")); |
3487 | |||
3488 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
3489 | if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(item)) ) | ||
3490 | disabled_items.push_back(std::string("Detach From Yourself")); | ||
3491 | // [/RLVa:KB] | ||
3445 | } | 3492 | } |
3446 | else | 3493 | else |
3447 | if( !isInTrash() ) | 3494 | if( !isInTrash() ) |
@@ -3453,6 +3500,16 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
3453 | items.push_back(std::string("RestoreToWorld Separator")); | 3500 | items.push_back(std::string("RestoreToWorld Separator")); |
3454 | items.push_back(std::string("Restore to Last Position")); | 3501 | items.push_back(std::string("Restore to Last Position")); |
3455 | 3502 | ||
3503 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0c | ||
3504 | // Only enable "Wear" if there is an attach point name *and* there isn't a worn attachment there that's currently locked | ||
3505 | if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getEnableWear()) && (gRlvHandler.hasLockedAttachment()) ) | ||
3506 | { | ||
3507 | LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(item, true); | ||
3508 | if ( (!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt->getObject())) ) | ||
3509 | disabled_items.push_back(std::string("Object Wear")); | ||
3510 | } | ||
3511 | // [/RLVa:KB] | ||
3512 | |||
3456 | LLMenuGL* attach_menu = menu.getChildMenuByName("Attach To", TRUE); | 3513 | LLMenuGL* attach_menu = menu.getChildMenuByName("Attach To", TRUE); |
3457 | LLMenuGL* attach_hud_menu = menu.getChildMenuByName("Attach To HUD", TRUE); | 3514 | LLMenuGL* attach_hud_menu = menu.getChildMenuByName("Attach To HUD", TRUE); |
3458 | LLVOAvatar *avatarp = gAgent.getAvatarObject(); | 3515 | LLVOAvatar *avatarp = gAgent.getAvatarObject(); |
@@ -3468,15 +3525,27 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
3468 | LLMenuItemCallGL *new_item; | 3525 | LLMenuItemCallGL *new_item; |
3469 | if (attachment->getIsHUDAttachment()) | 3526 | if (attachment->getIsHUDAttachment()) |
3470 | { | 3527 | { |
3528 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
3471 | attach_hud_menu->append(new_item = new LLMenuItemCallGL(attachment->getName(), | 3529 | attach_hud_menu->append(new_item = new LLMenuItemCallGL(attachment->getName(), |
3472 | NULL, //&LLObjectBridge::attachToAvatar, | 3530 | NULL, //&LLObjectBridge::attachToAvatar, |
3473 | NULL, &attach_label, (void*)attachment)); | 3531 | (rlv_handler_t::isEnabled()) ? &rlvAttachToEnabler : NULL, |
3532 | &attach_label, (void*)attachment)); | ||
3533 | // [/RLVa:KB] | ||
3534 | //attach_hud_menu->append(new_item = new LLMenuItemCallGL(attachment->getName(), | ||
3535 | // NULL, //&LLObjectBridge::attachToAvatar, | ||
3536 | // NULL, &attach_label, (void*)attachment)); | ||
3474 | } | 3537 | } |
3475 | else | 3538 | else |
3476 | { | 3539 | { |
3540 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
3477 | attach_menu->append(new_item = new LLMenuItemCallGL(attachment->getName(), | 3541 | attach_menu->append(new_item = new LLMenuItemCallGL(attachment->getName(), |
3478 | NULL, //&LLObjectBridge::attachToAvatar, | 3542 | NULL, //&LLObjectBridge::attachToAvatar, |
3479 | NULL, &attach_label, (void*)attachment)); | 3543 | (rlv_handler_t::isEnabled()) ? &rlvAttachToEnabler : NULL, |
3544 | &attach_label, (void*)attachment)); | ||
3545 | // [/RLVa:KB] | ||
3546 | //attach_menu->append(new_item = new LLMenuItemCallGL(attachment->getName(), | ||
3547 | // NULL, //&LLObjectBridge::attachToAvatar, | ||
3548 | // NULL, &attach_label, (void*)attachment)); | ||
3480 | } | 3549 | } |
3481 | 3550 | ||
3482 | LLSimpleListener* callback = mInventoryPanel->getListenerByName("Inventory.AttachObject"); | 3551 | LLSimpleListener* callback = mInventoryPanel->getListenerByName("Inventory.AttachObject"); |
@@ -3981,6 +4050,20 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) | |||
3981 | is_gesture); | 4050 | is_gesture); |
3982 | S32 gest_count = gest_item_array.count(); | 4051 | S32 gest_count = gest_item_array.count(); |
3983 | 4052 | ||
4053 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c | ||
4054 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) && (!RlvSettings::getEnableWear()) ) | ||
4055 | { | ||
4056 | // Filter anything that doesn't specify an attachment point (or that specifies one that's currently locked) | ||
4057 | for (S32 idxObj = obj_item_array.count() - 1; idxObj >= 0; idxObj--) | ||
4058 | { | ||
4059 | LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(obj_item_array.get(idxObj).get(), true); | ||
4060 | if ( ((!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt->getObject()))) ) | ||
4061 | obj_item_array.remove(idxObj); | ||
4062 | } | ||
4063 | obj_count = obj_item_array.count(); | ||
4064 | } | ||
4065 | // [/RLVa:KB] | ||
4066 | |||
3984 | if( !wearable_count && !obj_count && !gest_count) | 4067 | if( !wearable_count && !obj_count && !gest_count) |
3985 | { | 4068 | { |
3986 | gViewerWindow->alertXml("CouldNotPutOnOutfit"); | 4069 | gViewerWindow->alertXml("CouldNotPutOnOutfit"); |
@@ -4118,6 +4201,13 @@ void wear_inventory_category_on_avatar_step3(LLWearableHoldingPattern* holder, B | |||
4118 | // item->setAssetUUID(wearable->getID()); | 4201 | // item->setAssetUUID(wearable->getID()); |
4119 | // item->updateAssetOnServer(); | 4202 | // item->updateAssetOnServer(); |
4120 | // } | 4203 | // } |
4204 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c | ||
4205 | if ( (!gRlvHandler.isWearable(wearable->getType())) || | ||
4206 | ( (!gRlvHandler.isRemovable(wearable->getType())) && (gAgent.getWearable(wearable->getType())) ) ) | ||
4207 | { | ||
4208 | continue; | ||
4209 | } | ||
4210 | // [/RLVa:KB] | ||
4121 | items.put(item); | 4211 | items.put(item); |
4122 | wearables.put(wearable); | 4212 | wearables.put(wearable); |
4123 | } | 4213 | } |
@@ -4210,14 +4300,24 @@ void wear_attachments_on_avatar(const LLInventoryModel::item_array_t& items, BOO | |||
4210 | msg->nextBlockFast(_PREHASH_HeaderData); | 4300 | msg->nextBlockFast(_PREHASH_HeaderData); |
4211 | msg->addUUIDFast(_PREHASH_CompoundMsgID, compound_msg_id ); | 4301 | msg->addUUIDFast(_PREHASH_CompoundMsgID, compound_msg_id ); |
4212 | msg->addU8Fast(_PREHASH_TotalObjects, count ); | 4302 | msg->addU8Fast(_PREHASH_TotalObjects, count ); |
4213 | msg->addBOOLFast(_PREHASH_FirstDetachAll, remove ); | 4303 | // msg->addBOOLFast(_PREHASH_FirstDetachAll, remove ); |
4214 | } | 4304 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Added: RLVa-0.2.2a |
4305 | // This really should just *always* be FALSE since TRUE can result in loss of the current asset state | ||
4306 | msg->addBOOLFast(_PREHASH_FirstDetachAll, remove && (!gRlvHandler.hasLockedAttachment()) ); | ||
4307 | // [/RLVa:KB] | ||
4308 | } | ||
4215 | 4309 | ||
4216 | LLInventoryItem* item = items.get(i); | 4310 | LLInventoryItem* item = items.get(i); |
4217 | msg->nextBlockFast(_PREHASH_ObjectData ); | 4311 | msg->nextBlockFast(_PREHASH_ObjectData ); |
4218 | msg->addUUIDFast(_PREHASH_ItemID, item->getUUID() ); | 4312 | msg->addUUIDFast(_PREHASH_ItemID, item->getUUID() ); |
4219 | msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); | 4313 | msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); |
4220 | msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point | 4314 | // msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point |
4315 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Added: RLVa-0.2.2a | ||
4316 | msg->addU8Fast(_PREHASH_AttachmentPt, | ||
4317 | ( (!rlv_handler_t::isEnabled()) || (RlvSettings::getEnableWear()) || (!gRlvHandler.hasLockedAttachment()) ) | ||
4318 | ? 0 | ||
4319 | : gRlvHandler.getAttachPointIndex(gRlvHandler.getAttachPoint(item, true))); | ||
4320 | // [/RLVa:KB] | ||
4221 | pack_permissions_slam(msg, item->getFlags(), item->getPermissions()); | 4321 | pack_permissions_slam(msg, item->getFlags(), item->getPermissions()); |
4222 | msg->addStringFast(_PREHASH_Name, item->getName()); | 4322 | msg->addStringFast(_PREHASH_Name, item->getName()); |
4223 | msg->addStringFast(_PREHASH_Description, item->getDescription()); | 4323 | msg->addStringFast(_PREHASH_Description, item->getDescription()); |
@@ -4299,7 +4399,11 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata) | |||
4299 | { | 4399 | { |
4300 | for(i = 0; i < wearable_count; ++i) | 4400 | for(i = 0; i < wearable_count; ++i) |
4301 | { | 4401 | { |
4302 | if( gAgent.isWearingItem (item_array.get(i)->getUUID()) ) | 4402 | // if( gAgent.isWearingItem (item_array.get(i)->getUUID()) ) |
4403 | // [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.2a | ||
4404 | LLWearable* pWearable = gAgent.getWearableFromWearableItem(item_array.get(i)->getUUID()); | ||
4405 | if ( (pWearable) && ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.isRemovable(pWearable->getType()))) ) | ||
4406 | // [/RLVa:KB] | ||
4303 | { | 4407 | { |
4304 | gWearableList.getAsset(item_array.get(i)->getAssetUUID(), | 4408 | gWearableList.getAsset(item_array.get(i)->getAssetUUID(), |
4305 | item_array.get(i)->getName(), | 4409 | item_array.get(i)->getName(), |
@@ -4316,6 +4420,18 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata) | |||
4316 | { | 4420 | { |
4317 | for(i = 0; i < obj_count; ++i) | 4421 | for(i = 0; i < obj_count; ++i) |
4318 | { | 4422 | { |
4423 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.2a | ||
4424 | // TODO-RLVa: is there a reason why LL doesn't bother checking to see if you're actually wearing the object? | ||
4425 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
4426 | { | ||
4427 | LLVOAvatar* pAvatar = gAgent.getAvatarObject(); | ||
4428 | if ( (!pAvatar) || (!pAvatar->isWearingAttachment(obj_item_array.get(i)->getUUID())) || | ||
4429 | (!gRlvHandler.isDetachable(obj_item_array.get(i).get())) ) // Why does LLPointer have a cast to BOOL aka S32??? | ||
4430 | { | ||
4431 | continue; | ||
4432 | } | ||
4433 | } | ||
4434 | // [/RVLa:KB] | ||
4319 | gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); | 4435 | gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); |
4320 | gMessageSystem->nextBlockFast(_PREHASH_ObjectData ); | 4436 | gMessageSystem->nextBlockFast(_PREHASH_ObjectData ); |
4321 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); | 4437 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); |
@@ -4708,8 +4824,11 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, | |||
4708 | { | 4824 | { |
4709 | EWearableType type = wearable->getType(); | 4825 | EWearableType type = wearable->getType(); |
4710 | 4826 | ||
4711 | if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR ) ) //&& | 4827 | //if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR ) ) //&& |
4712 | //!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) ) | 4828 | //!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) ) |
4829 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.2a | SL big fix | ||
4830 | if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR || type==WT_EYES) ) | ||
4831 | // [/RLVa:KB] | ||
4713 | { | 4832 | { |
4714 | gAgent.removeWearable( type ); | 4833 | gAgent.removeWearable( type ); |
4715 | } | 4834 | } |