From bf1c1947d752e1f4d18d77b3190691d8244bc91f Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 25 Jun 2012 14:28:21 -0700 Subject: PATH-743: Updating the cursors for path testing mode to final designs. --- indra/newview/llpathfindingpathtool.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpathfindingpathtool.cpp') diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp index 82426920d8..fde2257777 100644 --- a/indra/newview/llpathfindingpathtool.cpp +++ b/indra/newview/llpathfindingpathtool.cpp @@ -72,11 +72,11 @@ BOOL LLPathfindingPathTool::handleMouseDown(S32 pX, S32 pY, MASK pMask) { if (isPointAModKeys(pMask)) { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START); + gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD); } else if (isPointBModKeys(pMask)) { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END); + gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD); } computeFinalPoints(pX, pY, pMask); mIsLeftMouseButtonHeld = true; @@ -169,11 +169,25 @@ BOOL LLPathfindingPathTool::handleHover(S32 pX, S32 pY, MASK pMask) { if (isPointAModKeys(pMask)) { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START); + if (mIsLeftMouseButtonHeld) + { + gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD); + } + else + { + gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START); + } } else if (isPointBModKeys(pMask)) { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END); + if (mIsLeftMouseButtonHeld) + { + gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD); + } + else + { + gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END); + } } computeTempPoints(pX, pY, pMask); returnVal = TRUE; -- cgit v1.2.3 From 9b46e116a92ee4d005ae3e1d66a4fbaa270770ec Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 25 Jun 2012 14:44:09 -0700 Subject: PATH-743: Small code refactoring for clean-up. --- indra/newview/llpathfindingpathtool.cpp | 36 ++++++--------------------------- 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'indra/newview/llpathfindingpathtool.cpp') diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp index fde2257777..6cf90addab 100644 --- a/indra/newview/llpathfindingpathtool.cpp +++ b/indra/newview/llpathfindingpathtool.cpp @@ -70,14 +70,9 @@ BOOL LLPathfindingPathTool::handleMouseDown(S32 pX, S32 pY, MASK pMask) { if (isAnyPathToolModKeys(pMask)) { - if (isPointAModKeys(pMask)) - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD); - } - else if (isPointBModKeys(pMask)) - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD); - } + gViewerWindow->setCursor(isPointAModKeys(pMask) + ? UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD + : UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD); computeFinalPoints(pX, pY, pMask); mIsLeftMouseButtonHeld = true; setMouseCapture(TRUE); @@ -167,28 +162,9 @@ BOOL LLPathfindingPathTool::handleHover(S32 pX, S32 pY, MASK pMask) if (!mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld && isAnyPathToolModKeys(pMask)) { - if (isPointAModKeys(pMask)) - { - if (mIsLeftMouseButtonHeld) - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD); - } - else - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START); - } - } - else if (isPointBModKeys(pMask)) - { - if (mIsLeftMouseButtonHeld) - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD); - } - else - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END); - } - } + gViewerWindow->setCursor(isPointAModKeys(pMask) + ? (mIsLeftMouseButtonHeld ? UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD : UI_CURSOR_TOOLPATHFINDING_PATH_START) + : (mIsLeftMouseButtonHeld ? UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD : UI_CURSOR_TOOLPATHFINDING_PATH_END)); computeTempPoints(pX, pY, pMask); returnVal = TRUE; } -- cgit v1.2.3