From d62017ddaaf8430e3f6887e687aa232578261b5e Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 14 Feb 2012 17:14:11 -0800 Subject: PATH-284: Refactoring the code for determining whether in path creation mode. --- indra/newview/llfloaterpathfindingconsole.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfloaterpathfindingconsole.cpp') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index e46a454e70..62f7b9c85c 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -105,9 +105,7 @@ BOOL LLFloaterPathfindingConsole::postBuild() BOOL LLFloaterPathfindingConsole::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down) { - if (down && (clicktype == LLMouseHandler::CLICK_LEFT) && - (((mask & MASK_CONTROL) && !(mask & (~MASK_CONTROL))) || - ((mask & MASK_SHIFT) && !(mask & (~MASK_SHIFT))))) + if (isGeneratePathMode(mask, clicktype, down)) { LLVector3 dv = gViewerWindow->mouseDirectionGlobal(x, y); LLVector3 mousePos = LLViewerCamera::getInstance()->getOrigin(); @@ -136,9 +134,12 @@ BOOL LLFloaterPathfindingConsole::handleAnyMouseClick(S32 x, S32 y, MASK mask, E } } -BOOL LLFloaterPathfindingConsole::isGeneratePathMode() const +BOOL LLFloaterPathfindingConsole::isGeneratePathMode(MASK mask, EClickType clicktype, BOOL down) const { - return (getVisible() && (mEditTestTabContainer->getCurrentPanelIndex() == 1)); + return (getVisible() && (mEditTestTabContainer->getCurrentPanelIndex() == 1) && + (clicktype == LLMouseHandler::CLICK_LEFT) && down && + (((mask & MASK_CONTROL) && !(mask & (~MASK_CONTROL))) || + ((mask & MASK_SHIFT) && !(mask & (~MASK_SHIFT))))); } LLHandle LLFloaterPathfindingConsole::getInstanceHandle() -- cgit v1.2.3