diff options
author | McCabe Maxsted | 2009-01-14 07:51:24 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-01-14 07:51:24 -0700 |
commit | 15249add53e27895fa9a7884adafad1bd319ae4e (patch) | |
tree | 4743a5fdf592d537c70aa3308e3de22dc8a492bc /linden/indra/newview | |
parent | Added text to IM window about inventory transfers (diff) | |
download | meta-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')
-rw-r--r-- | linden/indra/newview/llinventorybridge.cpp | 47 | ||||
-rw-r--r-- | linden/indra/newview/llinventorybridge.h | 3 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/menu_inventory.xml | 4 |
3 files changed, 52 insertions, 2 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 | ||
819 | void 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 | |||
815 | LLUIImagePtr LLItemBridge::getIcon() const | 860 | LLUIImagePtr 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")); |
diff --git a/linden/indra/newview/llinventorybridge.h b/linden/indra/newview/llinventorybridge.h index 329e57f..eb17432 100644 --- a/linden/indra/newview/llinventorybridge.h +++ b/linden/indra/newview/llinventorybridge.h | |||
@@ -159,6 +159,7 @@ public: | |||
159 | 159 | ||
160 | virtual const std::string& getPrefix() { return LLStringUtil::null; } | 160 | virtual const std::string& getPrefix() { return LLStringUtil::null; } |
161 | virtual void restoreItem() {} | 161 | virtual void restoreItem() {} |
162 | virtual void restoreToWorld() {} | ||
162 | 163 | ||
163 | // LLFolderViewEventListener functions | 164 | // LLFolderViewEventListener functions |
164 | virtual const std::string& getName() const; | 165 | virtual const std::string& getName() const; |
@@ -243,6 +244,7 @@ public: | |||
243 | 244 | ||
244 | virtual void selectItem(); | 245 | virtual void selectItem(); |
245 | virtual void restoreItem(); | 246 | virtual void restoreItem(); |
247 | virtual void restoreToWorld(); | ||
246 | 248 | ||
247 | virtual LLUIImagePtr getIcon() const; | 249 | virtual LLUIImagePtr getIcon() const; |
248 | virtual const std::string& getDisplayName() const; | 250 | virtual const std::string& getDisplayName() const; |
@@ -283,7 +285,6 @@ public: | |||
283 | virtual void selectItem(); | 285 | virtual void selectItem(); |
284 | virtual void restoreItem(); | 286 | virtual void restoreItem(); |
285 | 287 | ||
286 | |||
287 | virtual LLUIImagePtr getIcon() const; | 288 | virtual LLUIImagePtr getIcon() const; |
288 | virtual BOOL renameItem(const std::string& new_name); | 289 | virtual BOOL renameItem(const std::string& new_name); |
289 | virtual BOOL removeItem(); | 290 | virtual BOOL removeItem(); |
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_inventory.xml b/linden/indra/newview/skins/default/xui/en-us/menu_inventory.xml index 31288ac..aa61e77 100644 --- a/linden/indra/newview/skins/default/xui/en-us/menu_inventory.xml +++ b/linden/indra/newview/skins/default/xui/en-us/menu_inventory.xml | |||
@@ -223,6 +223,10 @@ | |||
223 | mouse_opaque="true" name="Detach From Yourself" width="128"> | 223 | mouse_opaque="true" name="Detach From Yourself" width="128"> |
224 | <on_click filter="" function="Inventory.DoToSelected" userdata="detach" /> | 224 | <on_click filter="" function="Inventory.DoToSelected" userdata="detach" /> |
225 | </menu_item_call> | 225 | </menu_item_call> |
226 | <menu_item_call bottom_delta="-18" height="18" label="Restore to Last Position" left="0" mouse_opaque="true" | ||
227 | name="Restore to Last Position" width="128"> | ||
228 | <on_click filter="" function="Inventory.DoToSelected" userdata="restoreToWorld" /> | ||
229 | </menu_item_call> | ||
226 | <menu_item_call bottom_delta="-18" height="18" label="Wear" left="0" mouse_opaque="true" | 230 | <menu_item_call bottom_delta="-18" height="18" label="Wear" left="0" mouse_opaque="true" |
227 | name="Object Wear" width="128"> | 231 | name="Object Wear" width="128"> |
228 | <on_click filter="" function="Inventory.DoToSelected" userdata="attach" /> | 232 | <on_click filter="" function="Inventory.DoToSelected" userdata="attach" /> |