summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-06-21 16:39:35 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-06-21 16:39:35 -0700
commit11b6e272abf05c5429865aaa1366bd450b8bc218 (patch)
tree6e583f9538d550f5cc4403a9d17039fea7db50f2 /indra/newview
parentfb1fa8434a1a84105f67e72fdf72d300be2951bb (diff)
PATH-743: Altering the mouse cursor to give more feed back when in path testing mode.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/CMakeLists.txt2
-rw-r--r--indra/newview/llpathfindingpathtool.cpp49
-rw-r--r--indra/newview/llpathfindingpathtool.h1
-rw-r--r--indra/newview/res/lltoolpathfinding.curbin326 -> 4286 bytes
-rw-r--r--indra/newview/res/lltoolpathfindingpathend.curbin0 -> 326 bytes
-rw-r--r--indra/newview/res/lltoolpathfindingpathstart.curbin0 -> 326 bytes
-rw-r--r--indra/newview/res/viewerRes.rc2
7 files changed, 47 insertions, 7 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 04d67b5108..ac78377abd 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1339,6 +1339,8 @@ if (WINDOWS)
res/lltoolland.cur
res/lltoolpan.cur
res/lltoolpathfinding.cur
+ res/lltoolpathfindingpathend.cur
+ res/lltoolpathfindingpathstart.cur
res/lltoolpipette.cur
res/lltoolrotate.cur
res/lltoolscale.cur
diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp
index 5567869a1c..82426920d8 100644
--- a/indra/newview/llpathfindingpathtool.cpp
+++ b/indra/newview/llpathfindingpathtool.cpp
@@ -66,12 +66,30 @@ BOOL LLPathfindingPathTool::handleMouseDown(S32 pX, S32 pY, MASK pMask)
{
BOOL returnVal = FALSE;
- if (!mIsLeftMouseButtonHeld && !mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld && isAnyPathToolModKeys(pMask))
+ if (!mIsLeftMouseButtonHeld && !mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld)
{
- computeFinalPoints(pX, pY, pMask);
- mIsLeftMouseButtonHeld = true;
- setMouseCapture(TRUE);
- returnVal = TRUE;
+ if (isAnyPathToolModKeys(pMask))
+ {
+ if (isPointAModKeys(pMask))
+ {
+ gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START);
+ }
+ else if (isPointBModKeys(pMask))
+ {
+ gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END);
+ }
+ computeFinalPoints(pX, pY, pMask);
+ mIsLeftMouseButtonHeld = true;
+ setMouseCapture(TRUE);
+ returnVal = TRUE;
+ }
+ else if (!isCameraModKeys(pMask))
+ {
+ gViewerWindow->setCursor(UI_CURSOR_TOOLNO);
+ mIsLeftMouseButtonHeld = true;
+ setMouseCapture(TRUE);
+ returnVal = TRUE;
+ }
}
mIsLeftMouseButtonHeld = true;
@@ -82,7 +100,7 @@ BOOL LLPathfindingPathTool::handleMouseUp(S32 pX, S32 pY, MASK pMask)
{
BOOL returnVal = FALSE;
- if (mIsLeftMouseButtonHeld && !mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld && isAnyPathToolModKeys(pMask))
+ if (mIsLeftMouseButtonHeld && !mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld)
{
computeFinalPoints(pX, pY, pMask);
setMouseCapture(FALSE);
@@ -142,9 +160,21 @@ BOOL LLPathfindingPathTool::handleHover(S32 pX, S32 pY, MASK pMask)
{
BOOL returnVal = FALSE;
- if (!mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld && isAnyPathToolModKeys(pMask))
+ if (!mIsLeftMouseButtonHeld && !mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld && !isAnyPathToolModKeys(pMask))
{
gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING);
+ }
+
+ if (!mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld && isAnyPathToolModKeys(pMask))
+ {
+ if (isPointAModKeys(pMask))
+ {
+ gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START);
+ }
+ else if (isPointBModKeys(pMask))
+ {
+ gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END);
+ }
computeTempPoints(pX, pY, pMask);
returnVal = TRUE;
}
@@ -291,6 +321,11 @@ bool LLPathfindingPathTool::isPointBModKeys(MASK pMask) const
return ((pMask & MASK_SHIFT) != 0);
}
+bool LLPathfindingPathTool::isCameraModKeys(MASK pMask) const
+{
+ return ((pMask & MASK_ALT) != 0);
+}
+
void LLPathfindingPathTool::getRayPoints(S32 pX, S32 pY, LLVector3 &pRayStart, LLVector3 &pRayEnd) const
{
LLVector3 dv = gViewerWindow->mouseDirectionGlobal(pX, pY);
diff --git a/indra/newview/llpathfindingpathtool.h b/indra/newview/llpathfindingpathtool.h
index 671f5bef95..8a79da43c9 100644
--- a/indra/newview/llpathfindingpathtool.h
+++ b/indra/newview/llpathfindingpathtool.h
@@ -98,6 +98,7 @@ private:
bool isAnyPathToolModKeys(MASK pMask) const;
bool isPointAModKeys(MASK pMask) const;
bool isPointBModKeys(MASK pMask) const;
+ bool isCameraModKeys(MASK pMask) const;
void getRayPoints(S32 pX, S32 pY, LLVector3 &pRayStart, LLVector3 &pRayEnd) const;
void computeFinalPoints(S32 pX, S32 pY, MASK pMask);
diff --git a/indra/newview/res/lltoolpathfinding.cur b/indra/newview/res/lltoolpathfinding.cur
index 2df80de0a6..acf5184227 100644
--- a/indra/newview/res/lltoolpathfinding.cur
+++ b/indra/newview/res/lltoolpathfinding.cur
Binary files differ
diff --git a/indra/newview/res/lltoolpathfindingpathend.cur b/indra/newview/res/lltoolpathfindingpathend.cur
new file mode 100644
index 0000000000..6a1e007a67
--- /dev/null
+++ b/indra/newview/res/lltoolpathfindingpathend.cur
Binary files differ
diff --git a/indra/newview/res/lltoolpathfindingpathstart.cur b/indra/newview/res/lltoolpathfindingpathstart.cur
new file mode 100644
index 0000000000..4446c491c4
--- /dev/null
+++ b/indra/newview/res/lltoolpathfindingpathstart.cur
Binary files differ
diff --git a/indra/newview/res/viewerRes.rc b/indra/newview/res/viewerRes.rc
index 686de0e7d5..0b469c8d81 100644
--- a/indra/newview/res/viewerRes.rc
+++ b/indra/newview/res/viewerRes.rc
@@ -123,6 +123,8 @@ TOOLBUY CURSOR "toolbuy.cur"
TOOLOPEN CURSOR "toolopen.cur"
TOOLSIT CURSOR "toolsit.cur"
TOOLPATHFINDING CURSOR "lltoolpathfinding.cur"
+TOOLPATHFINDINGPATHSTART CURSOR "lltoolpathfindingpathstart.cur"
+TOOLPATHFINDINGPATHEND CURSOR "lltoolpathfindingpathend.cur"
TOOLNO CURSOR "llno.cur"
/////////////////////////////////////////////////////////////////////////////