diff options
author | Oz Linden <oz@lindenlab.com> | 2012-06-25 17:16:29 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2012-06-25 17:16:29 -0400 |
commit | 0f958faacd37461a26af76d34a6b29744a2cd1ec (patch) | |
tree | 2233d2143c3529a1ffd3b66ee9db5108abeb77f4 /indra/newview/llpathfindingpathtool.cpp | |
parent | 1b8bbc7b863ccfc25833dcdbbf0dd9e3e96dc0bb (diff) | |
parent | eff9be530805298339f656f86a52ade9efeba779 (diff) |
merge up to 3.3.3-release + pathfinding
Diffstat (limited to 'indra/newview/llpathfindingpathtool.cpp')
-rw-r--r-- | indra/newview/llpathfindingpathtool.cpp | 49 |
1 files changed, 42 insertions, 7 deletions
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); |