diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-12-11 19:31:36 +0200 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-12-11 19:31:36 +0200 |
commit | 4133caebe36b3433036c6b7a4301288f0f695de9 (patch) | |
tree | d3b44e620cd3b3b95729308184b840acb0596294 /indra/newview | |
parent | d86616cc6670882da2ecd23c3089d71869bb7c2c (diff) |
MAINT-2177 User was able to create a landmark for remote location
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpanelplaces.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llpanelplaces.h | 4 |
2 files changed, 24 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. diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index c3d1b9bc53..27f991c202 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -146,6 +146,10 @@ private: // Information type currently shown in Place Information panel std::string mPlaceInfoType; + // Region and parcel ids, to detect location changes in case of AGENT_INFO_TYPE + LLUUID mRegionId; + S32 mParcelLocalId; + bool isLandmarkEditModeOn; // Holds info whether "My Landmarks" and "Teleport History" tabs have been created. |