diff options
author | McCabe Maxsted | 2009-11-08 13:23:54 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-11-08 13:23:54 -0700 |
commit | d9ecd6fde8f588d8be9a54a3ebc301bab1e99754 (patch) | |
tree | 1f595f7577a5134b29e4933d1ce6b4b52e9c1f57 /linden/indra/newview/llinventorybridge.cpp | |
parent | Merged working branch of 1.2 into LL 1.23 merge (diff) | |
parent | Changed version to 1.20 in other files (diff) | |
download | meta-impy-d9ecd6fde8f588d8be9a54a3ebc301bab1e99754.zip meta-impy-d9ecd6fde8f588d8be9a54a3ebc301bab1e99754.tar.gz meta-impy-d9ecd6fde8f588d8be9a54a3ebc301bab1e99754.tar.bz2 meta-impy-d9ecd6fde8f588d8be9a54a3ebc301bab1e99754.tar.xz |
Merged almost-final version of Imprudence 1.2 into 1.3
Diffstat (limited to 'linden/indra/newview/llinventorybridge.cpp')
-rw-r--r-- | linden/indra/newview/llinventorybridge.cpp | 117 |
1 files changed, 86 insertions, 31 deletions
diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index 5a4fad7..1e86301 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp | |||
@@ -489,6 +489,20 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
489 | items.push_back(std::string("Open")); | 489 | items.push_back(std::string("Open")); |
490 | items.push_back(std::string("Properties")); | 490 | items.push_back(std::string("Properties")); |
491 | 491 | ||
492 | // [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Modified: RLVa-1.0.5c | ||
493 | if (rlv_handler_t::isEnabled()) | ||
494 | { | ||
495 | LLInventoryObject* pItem = (mInventoryPanel->getModel()) ? mInventoryPanel->getModel()->getObject(mUUID) : NULL; | ||
496 | if ( (pItem) && | ||
497 | ( ((LLAssetType::AT_NOTECARD == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE))) || | ||
498 | ((LLAssetType::AT_LSL_TEXT == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT))) || | ||
499 | ((LLAssetType::AT_NOTECARD == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE))) ) ) | ||
500 | { | ||
501 | disabled_items.push_back(std::string("Open")); | ||
502 | } | ||
503 | } | ||
504 | // [/RLVa:KB] | ||
505 | |||
492 | getClipboardEntries(true, items, disabled_items, flags); | 506 | getClipboardEntries(true, items, disabled_items, flags); |
493 | } | 507 | } |
494 | hideContextEntries(menu, items, disabled_items); | 508 | hideContextEntries(menu, items, disabled_items); |
@@ -2472,6 +2486,13 @@ void open_texture(const LLUUID& item_id, | |||
2472 | const LLUUID& source_id, | 2486 | const LLUUID& source_id, |
2473 | BOOL take_focus) | 2487 | BOOL take_focus) |
2474 | { | 2488 | { |
2489 | // [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Added: RLVa-1.0.5c | ||
2490 | if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE)) | ||
2491 | { | ||
2492 | return; | ||
2493 | } | ||
2494 | // [/RLVa:KB] | ||
2495 | |||
2475 | // See if we can bring an exiting preview to the front | 2496 | // See if we can bring an exiting preview to the front |
2476 | if( !LLPreview::show( item_id, take_focus ) ) | 2497 | if( !LLPreview::show( item_id, take_focus ) ) |
2477 | { | 2498 | { |
@@ -3305,11 +3326,11 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model | |||
3305 | item = (LLViewerInventoryItem*)gInventory.getItem(object_id); | 3326 | item = (LLViewerInventoryItem*)gInventory.getItem(object_id); |
3306 | if(item && gInventory.isObjectDescendentOf(object_id, gAgent.getInventoryRootID())) | 3327 | if(item && gInventory.isObjectDescendentOf(object_id, gAgent.getInventoryRootID())) |
3307 | { | 3328 | { |
3308 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | 3329 | // [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a |
3309 | // User picked "Wear" so either nothing is locked, or we need to look up the specific attach point from its name | 3330 | // User picked "Wear" so either nothing is locked, or we need to look up the specific attach point from its name |
3310 | // (NOTE: rez_attachment will take care of deciding whether or not we *can* attach) | 3331 | // (NOTE: rez_attachment will take care of deciding whether or not we *can* attach) |
3311 | rez_attachment(item, | 3332 | rez_attachment(item, |
3312 | ((!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment()) || (RlvSettings::getEnableWear())) | 3333 | ((!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) || (RlvSettings::getEnableWear())) |
3313 | ? NULL : gRlvHandler.getAttachPoint(item, true)); | 3334 | ? NULL : gRlvHandler.getAttachPoint(item, true)); |
3314 | // [/RLVa:KB] | 3335 | // [/RLVa:KB] |
3315 | // rez_attachment(item, NULL); | 3336 | // rez_attachment(item, NULL); |
@@ -3332,9 +3353,9 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model | |||
3332 | { | 3353 | { |
3333 | LLInventoryItem* item = gInventory.getItem(mUUID); | 3354 | LLInventoryItem* item = gInventory.getItem(mUUID); |
3334 | 3355 | ||
3335 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | 3356 | // [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a |
3336 | // Fall-through: if there's a "Detach from yourself" code path we missed then we'll still disallow the detach here | 3357 | // Fall-through: if there's a "Detach from yourself" code path we missed then we'll still disallow the detach here |
3337 | if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(item)) ) | 3358 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(item, RLV_LOCK_REMOVE)) ) |
3338 | { | 3359 | { |
3339 | return; | 3360 | return; |
3340 | } | 3361 | } |
@@ -3504,9 +3525,12 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
3504 | { | 3525 | { |
3505 | items.push_back(std::string("Detach From Yourself")); | 3526 | items.push_back(std::string("Detach From Yourself")); |
3506 | 3527 | ||
3507 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | 3528 | // [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a |
3508 | if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.isDetachable(item)) ) | 3529 | if ( (rlv_handler_t::isEnabled()) && |
3530 | (gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE)) && (gRlvHandler.isLockedAttachment(item, RLV_LOCK_REMOVE)) ) | ||
3531 | { | ||
3509 | disabled_items.push_back(std::string("Detach From Yourself")); | 3532 | disabled_items.push_back(std::string("Detach From Yourself")); |
3533 | } | ||
3510 | // [/RLVa:KB] | 3534 | // [/RLVa:KB] |
3511 | } | 3535 | } |
3512 | else | 3536 | else |
@@ -3519,13 +3543,16 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
3519 | items.push_back(std::string("RestoreToWorld Separator")); | 3543 | items.push_back(std::string("RestoreToWorld Separator")); |
3520 | items.push_back(std::string("Restore to Last Position")); | 3544 | items.push_back(std::string("Restore to Last Position")); |
3521 | 3545 | ||
3522 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0c | 3546 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a |
3523 | // Only enable "Wear" if there is an attach point name *and* there isn't a worn attachment there that's currently locked | 3547 | if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getEnableWear()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) ) |
3524 | if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getEnableWear()) && (gRlvHandler.hasLockedAttachment()) ) | ||
3525 | { | 3548 | { |
3526 | LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(item, true); | 3549 | LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(item, true); // The item's name should specify |
3527 | if ( (!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt)) ) | 3550 | if ( (!pAttachPt) || // an attachment point that |
3551 | (gRlvHandler.isLockedAttachment(pAttachPt->getObject(), RLV_LOCK_REMOVE)) || // doesn't have an undetachable object | ||
3552 | (gRlvHandler.isLockedAttachment(pAttachPt, RLV_LOCK_ADD)) ) // and that can be attached to | ||
3553 | { | ||
3528 | disabled_items.push_back(std::string("Object Wear")); | 3554 | disabled_items.push_back(std::string("Object Wear")); |
3555 | } | ||
3529 | } | 3556 | } |
3530 | // [/RLVa:KB] | 3557 | // [/RLVa:KB] |
3531 | 3558 | ||
@@ -3628,6 +3655,13 @@ LLUIImagePtr LLLSLTextBridge::getIcon() const | |||
3628 | 3655 | ||
3629 | void LLLSLTextBridge::openItem() | 3656 | void LLLSLTextBridge::openItem() |
3630 | { | 3657 | { |
3658 | // [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Modified: RLVa-1.0.5c | ||
3659 | if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT)) | ||
3660 | { | ||
3661 | return; | ||
3662 | } | ||
3663 | // [/RLVa:KB] | ||
3664 | |||
3631 | // See if we can bring an exiting preview to the front | 3665 | // See if we can bring an exiting preview to the front |
3632 | if(!LLPreview::show(mUUID)) | 3666 | if(!LLPreview::show(mUUID)) |
3633 | { | 3667 | { |
@@ -4069,15 +4103,26 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) | |||
4069 | is_gesture); | 4103 | is_gesture); |
4070 | S32 gest_count = gest_item_array.count(); | 4104 | S32 gest_count = gest_item_array.count(); |
4071 | 4105 | ||
4072 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c | 4106 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a |
4073 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) && (!RlvSettings::getEnableWear()) ) | 4107 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) ) |
4074 | { | 4108 | { |
4075 | // Filter anything that doesn't specify an attachment point (or that specifies one that's currently locked) | 4109 | // Filter anything that we shouldn't be attaching |
4076 | for (S32 idxObj = obj_item_array.count() - 1; idxObj >= 0; idxObj--) | 4110 | for (S32 idxObj = obj_item_array.count() - 1; idxObj >= 0; idxObj--) |
4077 | { | 4111 | { |
4078 | LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(obj_item_array.get(idxObj).get(), true); | 4112 | if (!RlvSettings::getEnableWear()) |
4079 | if ( ((!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt))) ) | 4113 | { |
4080 | obj_item_array.remove(idxObj); | 4114 | LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(obj_item_array.get(idxObj).get(), true); |
4115 | if ( (!pAttachPt) || // Item should specify attachpt that | ||
4116 | (gRlvHandler.isLockedAttachment(pAttachPt->getObject(), RLV_LOCK_REMOVE)) || // doesn't have an undetachable object | ||
4117 | (gRlvHandler.isLockedAttachment(pAttachPt, RLV_LOCK_ADD)) ) // and that is attachable | ||
4118 | { | ||
4119 | obj_item_array.remove(idxObj); | ||
4120 | } | ||
4121 | } | ||
4122 | else | ||
4123 | { | ||
4124 | gRlvHandler.onWearAttachment(obj_item_array.get(idxObj)->getUUID()); | ||
4125 | } | ||
4081 | } | 4126 | } |
4082 | obj_count = obj_item_array.count(); | 4127 | obj_count = obj_item_array.count(); |
4083 | } | 4128 | } |
@@ -4260,15 +4305,26 @@ void wear_attachments_on_avatar(const std::set<LLUUID>& item_ids, BOOL remove) | |||
4260 | { | 4305 | { |
4261 | if ( (gInventory.isObjectDescendentOf(*it, gAgent.getInventoryRootID())) ) | 4306 | if ( (gInventory.isObjectDescendentOf(*it, gAgent.getInventoryRootID())) ) |
4262 | { | 4307 | { |
4263 | // items.put(item); | 4308 | // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-10-15 (RLVa-1.0.5e) | Modified: RLVa-1.0.5e |
4264 | // [RLVa:KB] - Checked: 2009-09-11 (RLVa-1.0.2c) | Modified: RLVa-1.0.2c | 4309 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) ) |
4265 | LLViewerJointAttachment* pAttachPt = NULL; | ||
4266 | if ( (!rlv_handler_t::isEnabled()) || (RlvSettings::getEnableWear()) || (!gRlvHandler.hasLockedAttachment()) || | ||
4267 | (((pAttachPt = gRlvHandler.getAttachPoint(item, true)) != NULL) && (gRlvHandler.isDetachable(pAttachPt))) ) | ||
4268 | { | 4310 | { |
4269 | items.put(item); | 4311 | if (!RlvSettings::getEnableWear()) |
4312 | { | ||
4313 | LLViewerJointAttachment* pAttachPt = NULL; | ||
4314 | if ( ((pAttachPt = gRlvHandler.getAttachPoint(item, true)) == NULL) || // Item should specify attachpt that | ||
4315 | (gRlvHandler.isLockedAttachment(pAttachPt->getObject(), RLV_LOCK_REMOVE)) || // doesn't have an undetachable object | ||
4316 | (gRlvHandler.isLockedAttachment(pAttachPt, RLV_LOCK_ADD)) ) // and that is attachable | ||
4317 | { | ||
4318 | continue; | ||
4319 | } | ||
4320 | } | ||
4321 | else | ||
4322 | { | ||
4323 | gRlvHandler.onWearAttachment(item->getUUID()); | ||
4324 | } | ||
4270 | } | 4325 | } |
4271 | // [/RLVa:KB] | 4326 | // [/RLVa:KB] |
4327 | items.put(item); | ||
4272 | } | 4328 | } |
4273 | else if ( (item->isComplete()) ) | 4329 | else if ( (item->isComplete()) ) |
4274 | { | 4330 | { |
@@ -4328,9 +4384,9 @@ void wear_attachments_on_avatar(const LLInventoryModel::item_array_t& items, BOO | |||
4328 | msg->addUUIDFast(_PREHASH_CompoundMsgID, compound_msg_id ); | 4384 | msg->addUUIDFast(_PREHASH_CompoundMsgID, compound_msg_id ); |
4329 | msg->addU8Fast(_PREHASH_TotalObjects, count ); | 4385 | msg->addU8Fast(_PREHASH_TotalObjects, count ); |
4330 | // msg->addBOOLFast(_PREHASH_FirstDetachAll, remove ); | 4386 | // msg->addBOOLFast(_PREHASH_FirstDetachAll, remove ); |
4331 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Added: RLVa-0.2.2a | 4387 | // [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Added: RLVa-1.0.5a |
4332 | // This really should just *always* be FALSE since TRUE can result in loss of the current asset state | 4388 | // This really should just *always* be FALSE since TRUE can result in loss of the current asset state |
4333 | msg->addBOOLFast(_PREHASH_FirstDetachAll, remove && (!gRlvHandler.hasLockedAttachment()) ); | 4389 | msg->addBOOLFast(_PREHASH_FirstDetachAll, remove && (!gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) ); |
4334 | // [/RLVa:KB] | 4390 | // [/RLVa:KB] |
4335 | } | 4391 | } |
4336 | 4392 | ||
@@ -4339,9 +4395,9 @@ void wear_attachments_on_avatar(const LLInventoryModel::item_array_t& items, BOO | |||
4339 | msg->addUUIDFast(_PREHASH_ItemID, item->getUUID() ); | 4395 | msg->addUUIDFast(_PREHASH_ItemID, item->getUUID() ); |
4340 | msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); | 4396 | msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); |
4341 | // msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point | 4397 | // msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point |
4342 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Added: RLVa-0.2.2a | 4398 | // [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Added: RLVa-1.0.5a |
4343 | msg->addU8Fast(_PREHASH_AttachmentPt, | 4399 | msg->addU8Fast(_PREHASH_AttachmentPt, |
4344 | ( (!rlv_handler_t::isEnabled()) || (RlvSettings::getEnableWear()) || (!gRlvHandler.hasLockedAttachment()) ) | 4400 | ( (!rlv_handler_t::isEnabled()) || (RlvSettings::getEnableWear()) || (!gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) ) |
4345 | ? 0 | 4401 | ? 0 |
4346 | : gRlvHandler.getAttachPointIndex(gRlvHandler.getAttachPoint(item, true))); | 4402 | : gRlvHandler.getAttachPointIndex(gRlvHandler.getAttachPoint(item, true))); |
4347 | // [/RLVa:KB] | 4403 | // [/RLVa:KB] |
@@ -4447,13 +4503,12 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata) | |||
4447 | { | 4503 | { |
4448 | for(i = 0; i < obj_count; ++i) | 4504 | for(i = 0; i < obj_count; ++i) |
4449 | { | 4505 | { |
4450 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.2a | 4506 | // [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a |
4451 | // TODO-RLVa: is there a reason why LL doesn't bother checking to see if you're actually wearing the object? | 4507 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment(RLV_LOCK_REMOVE)) ) |
4452 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) ) | ||
4453 | { | 4508 | { |
4454 | LLVOAvatar* pAvatar = gAgent.getAvatarObject(); | 4509 | LLVOAvatar* pAvatar = gAgent.getAvatarObject(); |
4455 | if ( (!pAvatar) || (!pAvatar->isWearingAttachment(obj_item_array.get(i)->getUUID())) || | 4510 | if ( (!pAvatar) || (!pAvatar->isWearingAttachment(obj_item_array.get(i)->getUUID())) || |
4456 | (!gRlvHandler.isDetachable(obj_item_array.get(i).get())) ) // Why does LLPointer have a cast to BOOL aka S32??? | 4511 | (gRlvHandler.isLockedAttachment(obj_item_array.get(i).get(), RLV_LOCK_REMOVE)) ) |
4457 | { | 4512 | { |
4458 | continue; | 4513 | continue; |
4459 | } | 4514 | } |