Solve Issue 925: Add "Show on Map" to right-click menu for landmarks in inventory
This commit is contained in:
@@ -78,6 +78,7 @@
|
||||
#include "llviewerregion.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llvoavatar.h"
|
||||
#include "llworldmap.h"
|
||||
#include "llwearable.h"
|
||||
#include "llwearablelist.h"
|
||||
|
||||
@@ -4437,6 +4438,7 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
|
||||
items.push_back(std::string("Landmark Separator"));
|
||||
items.push_back(std::string("Teleport To Landmark"));
|
||||
items.push_back(std::string("Show On Map"));
|
||||
}
|
||||
|
||||
// Disable "About Landmark" menu item for
|
||||
@@ -4445,6 +4447,7 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
if ((flags & FIRST_SELECTED_ITEM) == 0)
|
||||
{
|
||||
disabled_items.push_back(std::string("Teleport To Landmark"));
|
||||
disabled_items.push_back(std::string("Show On Map"));
|
||||
}
|
||||
|
||||
hide_context_entries(menu, items, disabled_items);
|
||||
@@ -4484,6 +4487,14 @@ void LLLandmarkBridge::performAction(LLInventoryModel* model, std::string action
|
||||
open_landmark(item, std::string(" Landmark: ") + item->getName(), FALSE);
|
||||
}
|
||||
}
|
||||
else if ("show_on_map" == action)
|
||||
{
|
||||
if (const LLViewerInventoryItem* item = getItem())
|
||||
{
|
||||
gFloaterWorldMap->trackLandmark(item->getUUID());
|
||||
LLFloaterWorldMap::show(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LLItemBridge::performAction(model, action);
|
||||
|
||||
@@ -257,6 +257,9 @@
|
||||
mouse_opaque="true" name="Teleport To Landmark" width="128">
|
||||
<on_click filter="" function="Inventory.DoToSelected" userdata="about" />
|
||||
</menu_item_call>
|
||||
<menu_item_call label="Show On Map" name="Show On Map">
|
||||
<on_click function="Inventory.DoToSelected" userdata="show_on_map"/>
|
||||
</menu_item_call>
|
||||
<menu_item_separator name="Animation Separator" />
|
||||
<menu_item_call bottom_delta="-18" height="18" label="Play in World" left="0"
|
||||
mouse_opaque="true" name="Animation Play" width="128">
|
||||
|
||||
Reference in New Issue
Block a user