FIRE-8140: Fix camming in minimap
parent
7012ee6877
commit
30840bdf4e
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
// <FS:Ansariel> Avatar tracking feature
|
||||
void LLNetMap::handleStartTracking()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -94,9 +94,9 @@ public:
|
|||
// </FS:Ansariel> 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();
|
||||
|
||||
// <FS:Ansariel> 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]
|
||||
// <FS:Ansariel> 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;
|
||||
// </FS:CR>
|
||||
void startTracking();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue