From 16fa78b1499b6bb68f5038c124953046af690d6c Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 13 Feb 2012 17:58:19 -0800 Subject: PATH-284: Implementing the functionality for the new path generation of the new pathfinding console floater design. --- indra/newview/llviewerwindow.cpp | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') 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 pathfindingConsoleHandle = LLFloaterPathfindingConsole::getInstanceHandle(); + if (!pathfindingConsoleHandle.isDead()) { - LLFloaterPathfindingConsole* pFloater = LLFloaterReg::getTypedInstance("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; -- cgit v1.2.3