summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-04-10 18:42:36 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-04-10 18:42:36 -0700
commit1f09812ad23208016f0046ef2d1187f15958a822 (patch)
tree2aa7098588e4bd6d570c3ea8db5e98b0a3729195 /indra
parentba0e3c3c6485fefbe273b6fa8f9121850166b2cc (diff)
Modifying the behavior so that the user is able to drag the start/end points, but holding ctrl/shift while hovering will still not be destructive to the old values.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpathfindingpathtool.cpp62
-rw-r--r--indra/newview/llpathfindingpathtool.h7
2 files changed, 69 insertions, 0 deletions
diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp
index 594682c530..4eb6068e42 100644
--- a/indra/newview/llpathfindingpathtool.cpp
+++ b/indra/newview/llpathfindingpathtool.cpp
@@ -83,11 +83,73 @@ BOOL LLPathfindingPathTool::handleMouseDown(S32 pX, S32 pY, MASK pMask)
computeFinalPath();
returnVal = TRUE;
+ setMouseCapture(TRUE);
}
return returnVal;
}
+BOOL LLPathfindingPathTool::handleMouseUp(S32 pX, S32 pY, MASK pMask)
+{
+ BOOL returnVal = FALSE;
+
+ if (isAnyPathToolModKeys(pMask))
+ {
+ LLVector3 dv = gViewerWindow->mouseDirectionGlobal(pX, pY);
+ LLVector3 mousePos = LLViewerCamera::getInstance()->getOrigin();
+ LLVector3 rayStart = mousePos;
+ LLVector3 rayEnd = mousePos + dv * 150;
+
+ if (isPointAModKeys(pMask))
+ {
+ setFinalA(rayStart, rayEnd);
+ }
+ else if (isPointBModKeys(pMask))
+ {
+ setFinalB(rayStart, rayEnd);
+ }
+ computeFinalPath();
+
+ setMouseCapture(FALSE);
+ returnVal = TRUE;
+ }
+
+ return returnVal;
+}
+
+BOOL LLPathfindingPathTool::handleMiddleMouseDown(S32 pX, S32 pY, MASK pMask)
+{
+ setMouseCapture(TRUE);
+
+ return TRUE;
+}
+
+BOOL LLPathfindingPathTool::handleMiddleMouseUp(S32 pX, S32 pY, MASK pMask)
+{
+ setMouseCapture(FALSE);
+
+ return TRUE;
+}
+
+BOOL LLPathfindingPathTool::handleRightMouseDown(S32 pX, S32 pY, MASK pMask)
+{
+ setMouseCapture(TRUE);
+
+ return TRUE;
+}
+
+BOOL LLPathfindingPathTool::handleRightMouseUp(S32 pX, S32 pY, MASK pMask)
+{
+ setMouseCapture(FALSE);
+
+ return TRUE;
+}
+
+BOOL LLPathfindingPathTool::handleDoubleClick(S32 pX, S32 pY, MASK pMask)
+{
+ return TRUE;
+}
+
BOOL LLPathfindingPathTool::handleHover(S32 pX, S32 pY, MASK pMask)
{
BOOL returnVal = FALSE;
diff --git a/indra/newview/llpathfindingpathtool.h b/indra/newview/llpathfindingpathtool.h
index 0ec22d959c..be2b90ee1a 100644
--- a/indra/newview/llpathfindingpathtool.h
+++ b/indra/newview/llpathfindingpathtool.h
@@ -68,6 +68,13 @@ public:
typedef boost::signals2::connection path_event_slot_t;
virtual BOOL handleMouseDown(S32 pX, S32 pY, MASK pMask);
+ virtual BOOL handleMouseUp(S32 pX, S32 pY, MASK pMask);
+ virtual BOOL handleMiddleMouseDown(S32 pX, S32 pY, MASK pMask);
+ virtual BOOL handleMiddleMouseUp(S32 pX, S32 pY, MASK pMask);
+ virtual BOOL handleRightMouseDown(S32 pX, S32 pY, MASK pMask);
+ virtual BOOL handleRightMouseUp(S32 pX, S32 pY, MASK pMask);
+ virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
+
virtual BOOL handleHover(S32 pX, S32 pY, MASK pMask);
EPathStatus getPathStatus() const;