summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelplaces.cpp
diff options
context:
space:
mode:
authorGraham Madarasz <graham@lindenlab.com>2018-03-06 09:48:44 -0800
committerGraham Madarasz <graham@lindenlab.com>2018-03-06 09:48:44 -0800
commitb9016f99f3abf8b135942e60a5a2d8cd8f0f4e75 (patch)
tree7e0dc18306309254b5d8cd5f40ac6ce897409242 /indra/newview/llpanelplaces.cpp
parentf8134b152d1a7273e27a224eac11d52c0a6f94c9 (diff)
parentaf9069edbff9df73cd75753b696aabd1ae8769b5 (diff)
Merged lindenlab/viewer-cougar into default
Diffstat (limited to 'indra/newview/llpanelplaces.cpp')
-rw-r--r--indra/newview/llpanelplaces.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp
index ed942fc7fc..48dd45480e 100644
--- a/indra/newview/llpanelplaces.cpp
+++ b/indra/newview/llpanelplaces.cpp
@@ -395,11 +395,16 @@ void LLPanelPlaces::onOpen(const LLSD& key)
mPlaceInfoType = key_type;
mPosGlobal.setZero();
mItem = NULL;
+ mRegionId.setNull();
togglePlaceInfoPanel(TRUE);
if (mPlaceInfoType == AGENT_INFO_TYPE)
{
mPlaceProfile->setInfoType(LLPanelPlaceInfo::AGENT);
+ if (gAgent.getRegion())
+ {
+ mRegionId = gAgent.getRegion()->getRegionID();
+ }
}
else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE)
{
@@ -472,6 +477,8 @@ void LLPanelPlaces::onOpen(const LLSD& key)
if (!parcel_mgr)
return;
+ mParcelLocalId = parcel_mgr->getAgentParcel()->getLocalID();
+
// Start using LLViewerParcelMgr for land selection if
// information about nearby land is requested.
// Otherwise stop using land selection and deselect land.
@@ -828,10 +835,21 @@ void LLPanelPlaces::onOverflowButtonClicked()
{
menu = mPlaceMenu;
+ bool landmark_item_enabled = false;
+ LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
+ if (is_agent_place_info_visible
+ && gAgent.getRegion()
+ && mRegionId == gAgent.getRegion()->getRegionID()
+ && parcel_mgr
+ && parcel_mgr->getAgentParcel()->getLocalID() == mParcelLocalId)
+ {
+ // Floater still shows location identical to agent's position
+ landmark_item_enabled = !LLLandmarkActions::landmarkAlreadyExists();
+ }
+
// Enable adding a landmark only for agent current parcel and if
// there is no landmark already pointing to that parcel in agent's inventory.
- menu->getChild<LLMenuItemCallGL>("landmark")->setEnabled(is_agent_place_info_visible &&
- !LLLandmarkActions::landmarkAlreadyExists());
+ menu->getChild<LLMenuItemCallGL>("landmark")->setEnabled(landmark_item_enabled);
// STORM-411
// Creating landmarks for remote locations is impossible.
// So hide menu item "Make a Landmark" in "Teleport History Profile" panel.