Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions indra/newview/llfavoritesbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1398,9 +1398,15 @@ bool LLFavoritesBarCtrl::enableSelected(const LLSD& userdata)
else if (param == "copy_slurl"
|| param == "show_on_map")
{
LLVector3d posGlobal;
LLLandmarkActions::getLandmarkGlobalPos(mSelectedItemID, posGlobal);
return !posGlobal.isExactlyZero();
LLViewerInventoryItem* item = gInventory.getItem(mSelectedItemID);
if (nullptr == item)
return false; // shouldn't happen as it is selected from existing items

const LLUUID& asset_id = item->getAssetUUID();

// Favorites are supposed to be loaded first, it should be here already
LLLandmark* landmark = gLandmarkList.getAsset(asset_id, NULL /*callback*/);
return nullptr != landmark;
}

return false;
Expand Down Expand Up @@ -1432,10 +1438,17 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
LLVector3d posGlobal;
LLLandmarkActions::getLandmarkGlobalPos(mSelectedItemID, posGlobal);

// inventory item and asset exist, otherwise
// enableSelected wouldn't have let it get here,
// only need to check location validity
if (!posGlobal.isExactlyZero())
{
LLLandmarkActions::getSLURLfromPosGlobal(posGlobal, copy_slurl_to_clipboard_cb);
}
else
{
LLNotificationsUtil::add("LandmarkLocationUnknown");
}
}
else if (action == "show_on_map")
{
Expand All @@ -1444,10 +1457,20 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
LLVector3d posGlobal;
LLLandmarkActions::getLandmarkGlobalPos(mSelectedItemID, posGlobal);

if (!posGlobal.isExactlyZero() && worldmap_instance)
if (worldmap_instance)
{
worldmap_instance->trackLocation(posGlobal);
LLFloaterReg::showInstance("world_map", "center");
// inventory item and asset exist, otherwise
// enableSelected wouldn't have let it get here,
// only need to check location validity
if (!posGlobal.isExactlyZero())
{
worldmap_instance->trackLocation(posGlobal);
LLFloaterReg::showInstance("world_map", "center");
}
else
{
LLNotificationsUtil::add("LandmarkLocationUnknown");
}
}
}
else if (action == "create_pick")
Expand Down
11 changes: 11 additions & 0 deletions indra/newview/skins/default/xui/en/notifications.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2465,6 +2465,17 @@ You already have a landmark for this location.
<tag>fail</tag>
</notification>

<notification
icon="alert.tga"
name="LandmarkLocationUnknown"
type="alert">
Viewer wasn't able to get region's location. Region might be temporarily unavailable or was removed.
<usetemplate
name="okbutton"
yestext="OK"/>
<tag>fail</tag>
</notification>

<notification
icon="alertmodal.tga"
name="CannotCreateLandmarkNotOwner"
Expand Down