diff options
| author | Todd Stinson <stinson@lindenlab.com> | 2012-06-21 16:39:35 -0700 | 
|---|---|---|
| committer | Todd Stinson <stinson@lindenlab.com> | 2012-06-21 16:39:35 -0700 | 
| commit | 11b6e272abf05c5429865aaa1366bd450b8bc218 (patch) | |
| tree | 6e583f9538d550f5cc4403a9d17039fea7db50f2 | |
| parent | fb1fa8434a1a84105f67e72fdf72d300be2951bb (diff) | |
PATH-743: Altering the mouse cursor to give more feed back when in path testing mode.
| -rw-r--r-- | indra/llcommon/llcursortypes.cpp | 2 | ||||
| -rw-r--r-- | indra/llcommon/llcursortypes.h | 2 | ||||
| -rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | indra/newview/llpathfindingpathtool.cpp | 49 | ||||
| -rw-r--r-- | indra/newview/llpathfindingpathtool.h | 1 | ||||
| -rw-r--r-- | indra/newview/res/lltoolpathfinding.cur | bin | 326 -> 4286 bytes | |||
| -rw-r--r-- | indra/newview/res/lltoolpathfindingpathend.cur | bin | 0 -> 326 bytes | |||
| -rw-r--r-- | indra/newview/res/lltoolpathfindingpathstart.cur | bin | 0 -> 326 bytes | |||
| -rw-r--r-- | indra/newview/res/viewerRes.rc | 2 | 
10 files changed, 53 insertions, 7 deletions
| diff --git a/indra/llcommon/llcursortypes.cpp b/indra/llcommon/llcursortypes.cpp index 0367e6e622..c0676f8c13 100644 --- a/indra/llcommon/llcursortypes.cpp +++ b/indra/llcommon/llcursortypes.cpp @@ -70,6 +70,8 @@ ECursorType getCursorFromString(const std::string& cursor_string)  		cursor_string_table["UI_CURSOR_TOOLBUY"] = UI_CURSOR_TOOLBUY;  		cursor_string_table["UI_CURSOR_TOOLOPEN"] = UI_CURSOR_TOOLOPEN;  		cursor_string_table["UI_CURSOR_TOOLPATHFINDING"] = UI_CURSOR_TOOLPATHFINDING; +		cursor_string_table["UI_CURSOR_TOOLPATHFINDINGPATHSTART"] = UI_CURSOR_TOOLPATHFINDING_PATH_START; +		cursor_string_table["UI_CURSOR_TOOLPATHFINDINGPATHEND"] = UI_CURSOR_TOOLPATHFINDING_PATH_END;  		cursor_string_table["UI_CURSOR_TOOLNO"] = UI_CURSOR_TOOLNO;  	} diff --git a/indra/llcommon/llcursortypes.h b/indra/llcommon/llcursortypes.h index 4662e90975..f47a328f77 100644 --- a/indra/llcommon/llcursortypes.h +++ b/indra/llcommon/llcursortypes.h @@ -66,6 +66,8 @@ enum ECursorType {  	UI_CURSOR_TOOLBUY,  	UI_CURSOR_TOOLOPEN,  	UI_CURSOR_TOOLPATHFINDING, +	UI_CURSOR_TOOLPATHFINDING_PATH_START, +	UI_CURSOR_TOOLPATHFINDING_PATH_END,  	UI_CURSOR_TOOLNO,  	UI_CURSOR_COUNT			// Number of elements in this enum (NOT a cursor)  }; diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index a332bfddc4..9a52b7c09a 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1698,6 +1698,8 @@ void LLWindowWin32::initCursors()  	mCursor[ UI_CURSOR_TOOLBUY ]	= LoadCursor(module, TEXT("TOOLBUY"));  	mCursor[ UI_CURSOR_TOOLOPEN ]	= LoadCursor(module, TEXT("TOOLOPEN"));  	mCursor[ UI_CURSOR_TOOLPATHFINDING ]	= LoadCursor(module, TEXT("TOOLPATHFINDING")); +	mCursor[ UI_CURSOR_TOOLPATHFINDING_PATH_START ]	= LoadCursor(module, TEXT("TOOLPATHFINDINGPATHSTART")); +	mCursor[ UI_CURSOR_TOOLPATHFINDING_PATH_END ]	= LoadCursor(module, TEXT("TOOLPATHFINDINGPATHEND"));  	mCursor[ UI_CURSOR_TOOLNO ]	= LoadCursor(module, TEXT("TOOLNO"));  	// Color cursors 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.curBinary files differ index 2df80de0a6..acf5184227 100644 --- a/indra/newview/res/lltoolpathfinding.cur +++ b/indra/newview/res/lltoolpathfinding.cur diff --git a/indra/newview/res/lltoolpathfindingpathend.cur b/indra/newview/res/lltoolpathfindingpathend.curBinary files differ new file mode 100644 index 0000000000..6a1e007a67 --- /dev/null +++ b/indra/newview/res/lltoolpathfindingpathend.cur diff --git a/indra/newview/res/lltoolpathfindingpathstart.cur b/indra/newview/res/lltoolpathfindingpathstart.curBinary files differ new file mode 100644 index 0000000000..4446c491c4 --- /dev/null +++ b/indra/newview/res/lltoolpathfindingpathstart.cur 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"  ///////////////////////////////////////////////////////////////////////////// | 
