summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 8a713ae22c..04b687b42f 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -203,6 +203,8 @@
#include "llwindowlistener.h"
#include "llviewerwindowlistener.h"
#include "llpaneltopinfobar.h"
+#include "LLPathingLib.h"
+#include "llfloaterpathfindingsetup.h"
#if LL_WINDOWS
#include <tchar.h> // For Unicode conversion methods
@@ -836,6 +838,7 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK
x = llround((F32)x / mDisplayScale.mV[VX]);
y = llround((F32)y / mDisplayScale.mV[VY]);
+
// only send mouse clicks to UI if UI is visible
if(gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
@@ -949,6 +952,29 @@ 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 )
+ {
+ 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) )
+ {
+ LLFloaterPathfindingSetup* pFloater = LLFloaterReg::getTypedInstance<LLFloaterPathfindingSetup>("pathfinding_setup");
+ if ( pFloater )
+ {
+ //The floater takes care of determining what stage - essentially where the data goes into the pathing packet(start or end)
+ pFloater->providePathingData( rayStart, rayEnd );
+ }
+ }
+ }
+
// Do not allow tool manager to handle mouseclicks if we have disconnected
if(!gDisconnected && LLToolMgr::getInstance()->getCurrentTool()->handleAnyMouseClick( x, y, mask, clicktype, down ) )
{