diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2014-02-11 16:04:31 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2014-02-11 16:04:31 -0500 |
commit | 969cb45920c568aeebf145480b7beacb2a157bcf (patch) | |
tree | 63dfb29d5e0226b054094d88358bec6ede68c197 /indra/newview/llinventorybridge.cpp | |
parent | d8f627d8bd45cc356583e2251500c23bed836b16 (diff) | |
parent | 413be91cf5044889ade97dcbec4b17fceff122e3 (diff) |
merge
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rwxr-xr-x | indra/newview/llinventorybridge.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1a98f293d1..90ef4806a8 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); @@ -1443,6 +1444,38 @@ 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)) + { + 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) @@ -4464,6 +4497,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 |