aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-01-14 07:51:24 -0700
committerMcCabe Maxsted2009-01-14 07:51:24 -0700
commit15249add53e27895fa9a7884adafad1bd319ae4e (patch)
tree4743a5fdf592d537c70aa3308e3de22dc8a492bc /linden/indra/newview/llinventorybridge.cpp
parentAdded text to IM window about inventory transfers (diff)
downloadmeta-impy-15249add53e27895fa9a7884adafad1bd319ae4e.zip
meta-impy-15249add53e27895fa9a7884adafad1bd319ae4e.tar.gz
meta-impy-15249add53e27895fa9a7884adafad1bd319ae4e.tar.bz2
meta-impy-15249add53e27895fa9a7884adafad1bd319ae4e.tar.xz
Added the 'Return to World' inventory option
Diffstat (limited to 'linden/indra/newview/llinventorybridge.cpp')
-rw-r--r--linden/indra/newview/llinventorybridge.cpp47
1 files changed, 46 insertions, 1 deletions
diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp
index bde36cc..34277f7 100644
--- a/linden/indra/newview/llinventorybridge.cpp
+++ b/linden/indra/newview/llinventorybridge.cpp
@@ -756,6 +756,10 @@ void LLItemBridge::performAction(LLFolderView* folder, LLInventoryModel* model,
756 model->deleteObject(mUUID); 756 model->deleteObject(mUUID);
757 model->notifyObservers(); 757 model->notifyObservers();
758 } 758 }
759 else if ("restoreToWorld" == action)
760 {
761 restoreToWorld();
762 }
759 else if ("restore" == action) 763 else if ("restore" == action)
760 { 764 {
761 restoreItem(); 765 restoreItem();
@@ -812,6 +816,47 @@ void LLItemBridge::restoreItem()
812 } 816 }
813} 817}
814 818
819void LLItemBridge::restoreToWorld()
820{
821 LLViewerInventoryItem* itemp = (LLViewerInventoryItem*)getItem();
822 if (itemp)
823 {
824 LLMessageSystem* msg = gMessageSystem;
825 msg->newMessage("RezRestoreToWorld");
826 msg->nextBlockFast(_PREHASH_AgentData);
827 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
828 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
829
830 msg->nextBlockFast(_PREHASH_InventoryData);
831 itemp->packMessage(msg);
832 msg->sendReliable(gAgent.getRegion()->getHost());
833 }
834
835 //Similar functionality to the drag and drop rez logic
836 BOOL remove_from_inventory = FALSE;
837
838 //remove local inventory copy, sim will deal with permissions and removing the item
839 //from the actual inventory if its a no-copy etc
840 if(!itemp->getPermissions().allowCopyBy(gAgent.getID()))
841 {
842 remove_from_inventory = TRUE;
843 }
844
845 // Check if it's in the trash. (again similar to the normal rez logic)
846 LLUUID trash_id;
847 trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
848 if(gInventory.isObjectDescendentOf(itemp->getUUID(), trash_id))
849 {
850 remove_from_inventory = TRUE;
851 }
852
853 if(remove_from_inventory)
854 {
855 gInventory.deleteObject(itemp->getUUID());
856 gInventory.notifyObservers();
857 }
858}
859
815LLUIImagePtr LLItemBridge::getIcon() const 860LLUIImagePtr LLItemBridge::getIcon() const
816{ 861{
817 return LLUI::getUIImage(ICON_NAME[OBJECT_ICON_NAME]); 862 return LLUI::getUIImage(ICON_NAME[OBJECT_ICON_NAME]);
@@ -3376,6 +3421,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
3376 items.push_back(std::string("Object Wear")); 3421 items.push_back(std::string("Object Wear"));
3377 items.push_back(std::string("Attach To")); 3422 items.push_back(std::string("Attach To"));
3378 items.push_back(std::string("Attach To HUD")); 3423 items.push_back(std::string("Attach To HUD"));
3424 items.push_back(std::string("Restore to Last Position"));
3379 3425
3380 LLMenuGL* attach_menu = menu.getChildMenuByName("Attach To", TRUE); 3426 LLMenuGL* attach_menu = menu.getChildMenuByName("Attach To", TRUE);
3381 LLMenuGL* attach_hud_menu = menu.getChildMenuByName("Attach To HUD", TRUE); 3427 LLMenuGL* attach_hud_menu = menu.getChildMenuByName("Attach To HUD", TRUE);
@@ -4364,7 +4410,6 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
4364 items.push_back(std::string("Wearable Wear")); 4410 items.push_back(std::string("Wearable Wear"));
4365 items.push_back(std::string("Wearable Edit")); 4411 items.push_back(std::string("Wearable Edit"));
4366 4412
4367
4368 if ((flags & FIRST_SELECTED_ITEM) == 0) 4413 if ((flags & FIRST_SELECTED_ITEM) == 0)
4369 { 4414 {
4370 disabled_items.push_back(std::string("Wearable Edit")); 4415 disabled_items.push_back(std::string("Wearable Edit"));