From fb7c7043a467d0d6c2b741ca603b6b1c57a52ae9 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 1 Jun 2012 16:50:28 -0700 Subject: PATH-668: Eating the escape key in the pathfinding path tool to avoid certain bad behaviors. --- indra/newview/llpathfindingpathtool.cpp | 9 +++++++++ indra/newview/llpathfindingpathtool.h | 2 ++ 2 files changed, 11 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp index 1e327a3ba7..bc5a265111 100644 --- a/indra/newview/llpathfindingpathtool.cpp +++ b/indra/newview/llpathfindingpathtool.cpp @@ -162,6 +162,15 @@ BOOL LLPathfindingPathTool::handleHover(S32 pX, S32 pY, MASK pMask) return returnVal; } +BOOL LLPathfindingPathTool::handleKey(KEY pKey, MASK pMask) +{ + // Eat the escape key or else the camera tool will pick up and reset to default view. This, + // in turn, will cause some other methods to get called. And one of those methods will reset + // the current toolset back to the basic toolset. This means that the pathfinding path toolset + // will no longer be active, but typically with pathfinding path elements on screen. + return (pKey == KEY_ESCAPE); +} + LLPathfindingPathTool::EPathStatus LLPathfindingPathTool::getPathStatus() const { EPathStatus status = kPathStatusUnknown; diff --git a/indra/newview/llpathfindingpathtool.h b/indra/newview/llpathfindingpathtool.h index 0294111ccf..671f5bef95 100644 --- a/indra/newview/llpathfindingpathtool.h +++ b/indra/newview/llpathfindingpathtool.h @@ -77,6 +77,8 @@ public: virtual BOOL handleHover(S32 pX, S32 pY, MASK pMask); + virtual BOOL handleKey(KEY pKey, MASK pMask); + EPathStatus getPathStatus() const; F32 getCharacterWidth() const; -- cgit v1.2.3