From 3882945fb9cfbe2710b8f05c7bf8b8c079272191 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 26 Jan 2013 07:00:44 -0500 Subject: STORM-1838 Add code for right click menu on inventory calling cards. Add initial support to insert teleport request into existing IM window. --- indra/newview/llinventorybridge.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 14a228df1c..8a57e00252 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4602,6 +4602,16 @@ void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string act LLAvatarActions::offerTeleport(item->getCreatorUUID()); } } + else if ("request_lure" == action) + { + LLViewerInventoryItem *item = getItem(); + if (item && (item->getCreatorUUID() != gAgent.getID()) && + (!item->getCreatorUUID().isNull())) + { + LLAvatarActions::teleportRequest(item->getCreatorUUID()); + } + } + else LLItemBridge::performAction(model, action); } @@ -4684,6 +4694,7 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Send Instant Message Separator")); items.push_back(std::string("Send Instant Message")); items.push_back(std::string("Offer Teleport...")); + items.push_back(std::string("Request Teleport...")); items.push_back(std::string("Conference Chat")); if (!good_card) @@ -4693,6 +4704,7 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (!good_card || !user_online) { disabled_items.push_back(std::string("Offer Teleport...")); + disabled_items.push_back(std::string("Request Teleport...")); disabled_items.push_back(std::string("Conference Chat")); } } -- cgit v1.2.3 From db8e4824e7f00516142461fa25616e3527007d66 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 26 Nov 2013 19:43:15 -0500 Subject: STORM-1986 Added right click Show on Map context menu for Inventory floater landmarks Possible fix for BUG-4593 --- indra/newview/llinventorybridge.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 80ef506272..f65e28a165 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -74,6 +74,7 @@ #include "llvoavatarself.h" #include "llwearablelist.h" #include "lllandmarkactions.h" +#include "llpanellandmarks.h" void copy_slurl_to_clipboard_callback_inv(const std::string& slurl); @@ -1449,6 +1450,40 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) } } } + else if ("show_on_map" == action) + { + doActionOnCurSelectedLandmark(boost::bind(&LLItemBridge::doShowOnMap, this, _1)); + } +} + +void LLItemBridge::doActionOnCurSelectedLandmark(LLLandmarkList::loaded_callback_t cb) +{ + LLViewerInventoryItem* cur_item = getItem(); + if(cur_item && cur_item->getInventoryType() == LLInventoryType::IT_LANDMARK) + { + LLLandmark* landmark = LLLandmarkActions::getLandmark(cur_item->getUUID(), cb); + if (landmark) + { + cb(landmark); + } + } +} + +void LLItemBridge::doShowOnMap(LLLandmark* landmark) +{ + LLVector3d landmark_global_pos; + // landmark has already been tested for NULL by calling routine + if (!landmark->getGlobalPos(landmark_global_pos)) + { + return; + } + + LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); + if (!landmark_global_pos.isExactlyZero() && worldmap_instance) + { + worldmap_instance->trackLocation(landmark_global_pos); + LLFloaterReg::showInstance("world_map", "center"); + } } void copy_slurl_to_clipboard_callback_inv(const std::string& slurl) @@ -4580,6 +4615,7 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Landmark Separator")); items.push_back(std::string("url_copy")); items.push_back(std::string("About Landmark")); + items.push_back(std::string("show_on_map")); } // Disable "About Landmark" menu item for -- cgit v1.2.3 From bb68d6a889b339690a90a7e622daa632c9e6fd7e Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 27 Nov 2013 10:43:02 -0500 Subject: STORM-1986 Eliminated early return per code review --- indra/newview/llinventorybridge.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index f65e28a165..44943d8722 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1473,16 +1473,14 @@ void LLItemBridge::doShowOnMap(LLLandmark* landmark) { LLVector3d landmark_global_pos; // landmark has already been tested for NULL by calling routine - if (!landmark->getGlobalPos(landmark_global_pos)) + if (landmark->getGlobalPos(landmark_global_pos)) { - return; - } - - LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); - if (!landmark_global_pos.isExactlyZero() && worldmap_instance) - { - worldmap_instance->trackLocation(landmark_global_pos); - LLFloaterReg::showInstance("world_map", "center"); + LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); + if (!landmark_global_pos.isExactlyZero() && worldmap_instance) + { + worldmap_instance->trackLocation(landmark_global_pos); + LLFloaterReg::showInstance("world_map", "center"); + } } } -- cgit v1.2.3