diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 52d18f9160..05364a9cbf 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -202,6 +202,7 @@ BOOL LLFloaterMap::handleRightMouseDown(S32 x, S32 y, MASK mask) if (mPopupMenu) { // [SL:KB] - Patch: World-MiniMap | Checked: 2012-07-08 (Catznip-3.3.0) + mMap->mClosestAgentRightClick = mMap->getClosestAgentToCursor(); mMap->mPosGlobalRightClick = mMap->viewPosToGlobal(x, y); mPopupMenu->setItemVisible("View Profile", mMap->mClosestAgentsToCursor.size() == 1); @@ -235,9 +236,7 @@ BOOL LLFloaterMap::handleRightMouseDown(S32 x, S32 y, MASK mask) pProfilesMenu->getBranch()->addChild(pMenuItem); } } - F32 range = dist_vec(mMap->getClosestAgentPosition(), gAgent.getPositionGlobal()); - mPopupMenu->setItemVisible("Cam", (range < gSavedSettings.getF32("RenderFarClip") - || gObjectList.findObject(mMap->getClosestAgentRightClick()) != NULL)); + mPopupMenu->setItemVisible("Cam", mMap->isZoomable()); mPopupMenu->setItemVisible("MarkAvatar", mMap->getClosestAgentToCursor().notNull()); mPopupMenu->setItemVisible("Start Tracking", mMap->getClosestAgentToCursor().notNull()); mPopupMenu->setItemVisible("Profile Separator", (mMap->mClosestAgentsToCursor.size() >= 1 @@ -465,7 +464,7 @@ void LLFloaterMap::handleShowProfile(const LLSD& sdParam) const const std::string strParam = sdParam.asString(); if ("closest" == strParam) { - LLAvatarActions::showProfile(mMap->getClosestAgentRightClick()); + LLAvatarActions::showProfile(mMap->mClosestAgentRightClick); } else if ("place" == strParam) { diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 9a118a4b49..1de86937da 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -1490,9 +1490,7 @@ BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask) pProfilesMenu->getBranch()->addChild(pMenuItem); } } - F32 range = dist_vec(mClosestAgentPosition, gAgent.getPositionGlobal()); - mPopupMenu->setItemVisible("Cam", (range < gSavedSettings.getF32("RenderFarClip") - || gObjectList.findObject(mClosestAgentRightClick) != NULL)); + mPopupMenu->setItemVisible("Cam", isZoomable()); mPopupMenu->setItemVisible("MarkAvatar", mClosestAgentToCursor.notNull()); mPopupMenu->setItemVisible("Start Tracking", mClosestAgentToCursor.notNull()); mPopupMenu->setItemVisible("Profile Separator", (mClosestAgentsToCursor.size() >= 1 @@ -1680,7 +1678,14 @@ void LLNetMap::clearAvatarMarks() void LLNetMap::camAvatar() { - LLAvatarActions::zoomIn(mClosestAgentRightClick); + if (isZoomable()) + { + LLAvatarActions::zoomIn(mClosestAgentRightClick); + } + else + { + reportToNearbyChat(LLTrans::getString("minimap_no_focus")); + } } void LLNetMap::handleCam() @@ -1688,6 +1693,13 @@ void LLNetMap::handleCam() camAvatar(); } +bool LLNetMap::isZoomable() +{ + F32 range = dist_vec(gAgent.getPositionGlobal(), mClosestAgentPosition); + bool is_zoomable = (range < gSavedSettings.getF32("RenderFarClip") || gObjectList.findObject(mClosestAgentRightClick) != NULL); + return is_zoomable; +} + // Avatar tracking feature void LLNetMap::handleStartTracking() { diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 9e3f4bcb09..114afaa264 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -94,9 +94,9 @@ public: // Synchronize tooltips throughout instances void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius ); LLVector3d viewPosToGlobal(S32 x,S32 y); - LLUUID getClosestAgentRightClick() const { return mClosestAgentRightClick; } LLUUID getClosestAgentToCursor() const { return mClosestAgentToCursor; } LLVector3d getClosestAgentPosition() const { return mClosestAgentPosition; } + bool isZoomable(); // Synchronize double click handling throughout instances void performDoubleClickAction(LLVector3d pos_global); @@ -160,7 +160,6 @@ private: LLUUID mClosestAgentToCursor; // [SL:KB] - Patch: World-MiniMap | Checked: 2012-07-08 (Catznip-3.3.0) LLVector3d mClosestAgentPosition; - LLUUID mClosestAgentRightClick; // [/SL:KB] // Synchronize tooltips throughout instances //std::string mToolTipMsg; @@ -178,6 +177,7 @@ public: void handleShowProfile(const LLSD& sdParam) const; uuid_vec_t mClosestAgentsToCursor; LLVector3d mPosGlobalRightClick; + LLUUID mClosestAgentRightClick; // void startTracking();