diff options
author | Jonathan Yap <none@none> | 2013-11-26 19:43:15 -0500 |
---|---|---|
committer | Jonathan Yap <none@none> | 2013-11-26 19:43:15 -0500 |
commit | db8e4824e7f00516142461fa25616e3527007d66 (patch) | |
tree | d67669bbbf1261e2d9403fc6523e88b0caac32c0 /indra/newview/llinventorybridge.cpp | |
parent | 787ccaf297e81291469aaf269f563d862fb150a3 (diff) |
STORM-1986 Added right click Show on Map context menu for Inventory floater landmarks
Possible fix for BUG-4593
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rwxr-xr-x | indra/newview/llinventorybridge.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
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 |