diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index fb11ecb883..4d655736e5 100755 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -1487,7 +1487,7 @@ BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask) pProfilesMenu->getBranch()->addChild(pMenuItem); } } - mPopupMenu->setItemVisible("Cam", isZoomable()); + mPopupMenu->setItemVisible("Cam", LLAvatarActions::canZoomIn(mClosestAgentToCursor)); mPopupMenu->setItemVisible("MarkAvatar", mClosestAgentToCursor.notNull()); mPopupMenu->setItemVisible("Start Tracking", mClosestAgentToCursor.notNull()); mPopupMenu->setItemVisible("Profile Separator", (mClosestAgentsToCursor.size() >= 1 @@ -1636,46 +1636,27 @@ void LLNetMap::handleZoom(const LLSD& userdata) } } -void LLNetMap::handleStopTracking (const LLSD& userdata) -{ - if (mPopupMenu) - { - mPopupMenu->setItemEnabled ("Stop Tracking", false); - LLTracker::stopTracking ((void*)(ptrdiff_t)LLTracker::isTracking(NULL)); - } -} - -// additional functions +// Mark avatar feature void LLNetMap::handleMark(const LLSD& userdata) -{ - setAvatarMark(userdata); -} - -void LLNetMap::handleClearMarks() -{ - clearAvatarMarks(); -} - -void LLNetMap::setAvatarMark(const LLSD& userdata) { if (mClosestAgentRightClick.notNull()) { // Use the name as color definition name from colors.xml LLColor4 color = LLUIColorTable::instance().getColor(userdata.asString(), LLColor4::green); LLNetMap::sAvatarMarksMap[mClosestAgentRightClick] = color; - llinfos << "Minimap: Marking " << mClosestAgentRightClick.asString() << " in " << userdata.asString() << llendl; + LL_INFOS("NetMap") << "Minimap: Marking " << mClosestAgentRightClick.asString() << " in " << userdata.asString() << LL_ENDL; } } -void LLNetMap::clearAvatarMarks() +void LLNetMap::handleClearMarks() { LLNetMap::sAvatarMarksMap.clear(); } // -void LLNetMap::camAvatar() +void LLNetMap::handleCam() { - if (isZoomable()) + if (LLAvatarActions::canZoomIn(mClosestAgentRightClick)) { LLAvatarActions::zoomIn(mClosestAgentRightClick); } @@ -1685,25 +1666,8 @@ void LLNetMap::camAvatar() } } -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() -{ - startTracking(); -} - -void LLNetMap::startTracking() { if (mClosestAgentRightClick.notNull()) { @@ -1716,6 +1680,15 @@ void LLNetMap::startTracking() } // Avatar tracking feature +void LLNetMap::handleStopTracking (const LLSD& userdata) +{ + if (mPopupMenu) + { + mPopupMenu->setItemEnabled ("Stop Tracking", false); + LLTracker::stopTracking ((void*)(ptrdiff_t)LLTracker::isTracking(NULL)); + } +} + // Synchronize tooltips throughout instances // static void LLNetMap::updateToolTipMsg() diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 114afaa264..696f03f2e9 100755 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -96,7 +96,6 @@ public: LLVector3d viewPosToGlobal(S32 x,S32 y); LLUUID getClosestAgentToCursor() const { return mClosestAgentToCursor; } LLVector3d getClosestAgentPosition() const { return mClosestAgentPosition; } - bool isZoomable(); // Synchronize double click handling throughout instances void performDoubleClickAction(LLVector3d pos_global); @@ -135,7 +134,7 @@ private: LLUIColor mBackgroundColor; F32 mScale; // Size of a region in pixels - static F32 sScale; // Used to synchronize netmaps throughout instances + static F32 sScale; // Used to synchronize netmaps throughout instances F32 mPixelsPerMeter; // world meters to map pixels F32 mObjectMapTPM; // texels per meter on map @@ -166,28 +165,25 @@ private: static std::string sToolTipMsg; // Synchronize tooltips throughout instances + // Mark avatar feature static std::map sAvatarMarksMap; public: void setSelected(uuid_vec_t uuids) { gmSelected=uuids; }; - void setAvatarMark(const LLSD& userdata); - void clearAvatarMarks(); - void camAvatar(); // Minimap improvements void handleShowProfile(const LLSD& sdParam) const; uuid_vec_t mClosestAgentsToCursor; LLVector3d mPosGlobalRightClick; LLUUID mClosestAgentRightClick; // - void startTracking(); private: void handleZoom(const LLSD& userdata); - void handleStopTracking(const LLSD& userdata); + void handleStopTracking (const LLSD& userdata); + void handleStartTracking(); void handleMark(const LLSD& userdata); void handleClearMarks(); void handleCam(); - void handleStartTracking(); // [SL:KB] - Patch: World-MiniMap | Checked: 2012-07-08 (Catznip-3.3.0) void handleOverlayToggle(const LLSD& sdParam); bool checkTextureType(const LLSD& sdParam) const;