diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-02-13 17:58:19 -0800 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-02-13 17:58:19 -0800 |
commit | 16fa78b1499b6bb68f5038c124953046af690d6c (patch) | |
tree | 722026f483d27cab444dc1377a41a47743464dd1 /indra/newview/llviewerwindow.cpp | |
parent | 06ec2607ce9db7cecee7c76b52cca5f263ef7402 (diff) |
PATH-284: Implementing the functionality for the new path generation of the new pathfinding console floater design.
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 33d959f8de..e60bc66e82 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -952,25 +952,19 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK } } - //Determine if we have a pathing system and subsequently provide any mouse input - if ( LLPathingLib::getInstance() && mLeftMouseDown == down ) + if ((LLPathingLib::getInstance() != NULL) && + (clicktype == LLMouseHandler::CLICK_LEFT) && down && + (((mask & MASK_CONTROL) && !(mask & (~MASK_CONTROL))) || + ((mask & MASK_SHIFT) && !(mask & (~MASK_SHIFT))))) { - LLVector3 dv = mouseDirectionGlobal(x,y); - LLVector3 mousePos = LLViewerCamera::getInstance()->getOrigin(); - LLVector3 rayStart = mousePos; - LLVector3 rayEnd = mousePos + dv * 150; - - //Determine if alt is being held in conjunction with a lmb click, if alt is being held - //then do not provide any input to the pathingLib console - MASK currentKeyMask = gKeyboard->currentMask(TRUE); - if ( !(currentKeyMask & MASK_ALT) ) + LLHandle<LLFloaterPathfindingConsole> pathfindingConsoleHandle = LLFloaterPathfindingConsole::getInstanceHandle(); + if (!pathfindingConsoleHandle.isDead()) { - LLFloaterPathfindingConsole* pFloater = LLFloaterReg::getTypedInstance<LLFloaterPathfindingConsole>("pathfinding_console"); - if ( pFloater ) + LLFloaterPathfindingConsole *pathfindingConsoleFloater = pathfindingConsoleHandle.get(); + if (pathfindingConsoleFloater->isGeneratePathMode()) { - //The floater takes care of determining what stage - essentially where the data goes into the pathing packet(start or end) - pFloater->providePathingData( rayStart, rayEnd ); + return pathfindingConsoleFloater->handleAnyMouseClick(x, y, mask, clicktype, down); } } } @@ -981,7 +975,6 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK return TRUE; } - // If we got this far on a down-click, it wasn't handled. // Up-clicks, though, are always handled as far as the OS is concerned. BOOL default_rtn = !down; |