summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolgrab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltoolgrab.cpp')
-rwxr-xr-xindra/newview/lltoolgrab.cpp57
1 files changed, 39 insertions, 18 deletions
diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp
index 9907da0f0e..fa6694b93b 100755
--- a/indra/newview/lltoolgrab.cpp
+++ b/indra/newview/lltoolgrab.cpp
@@ -56,6 +56,7 @@
#include "llviewerregion.h"
#include "llvoavatarself.h"
#include "llworld.h"
+#include "llmenugl.h"
const S32 SLOP_DIST_SQ = 4;
@@ -83,6 +84,7 @@ LLToolGrab::LLToolGrab( LLToolComposite* composite )
mLastFace(0),
mSpinGrabbing( FALSE ),
mSpinRotation(),
+ mClickedInMouselook( FALSE ),
mHideBuildHighlight(FALSE)
{ }
@@ -97,6 +99,8 @@ void LLToolGrab::handleSelect()
{
// viewer can crash during startup if we don't check.
gFloaterTools->setStatusText("grab");
+ // in case we start from tools floater, we count any selection as valid
+ mValidSelection = gFloaterTools->getVisible();
}
gGrabBtnVertical = FALSE;
gGrabBtnSpin = FALSE;
@@ -109,13 +113,21 @@ void LLToolGrab::handleDeselect()
setMouseCapture( FALSE );
}
+ // Make sure that temporary(invalid) selection won't pass anywhere except pie tool.
+ MASK override_mask = gKeyboard ? gKeyboard->currentMask(TRUE) : 0;
+ if (!mValidSelection && (override_mask != MASK_NONE || (gFloaterTools && gFloaterTools->getVisible())))
+ {
+ LLMenuGL::sMenuContainer->hideMenus();
+ LLSelectMgr::getInstance()->validateSelection();
+ }
+
}
BOOL LLToolGrab::handleDoubleClick(S32 x, S32 y, MASK mask)
{
if (gDebugClicks)
{
- llinfos << "LLToolGrab handleDoubleClick (becoming mouseDown)" << llendl;
+ LL_INFOS() << "LLToolGrab handleDoubleClick (becoming mouseDown)" << LL_ENDL;
}
return FALSE;
@@ -125,7 +137,7 @@ BOOL LLToolGrab::handleMouseDown(S32 x, S32 y, MASK mask)
{
if (gDebugClicks)
{
- llinfos << "LLToolGrab handleMouseDown" << llendl;
+ LL_INFOS() << "LLToolGrab handleMouseDown" << LL_ENDL;
}
// call the base class to propogate info to sim
@@ -136,6 +148,7 @@ BOOL LLToolGrab::handleMouseDown(S32 x, S32 y, MASK mask)
// can grab transparent objects (how touch event propagates, scripters rely on this)
gViewerWindow->pickAsync(x, y, mask, pickCallback, TRUE);
}
+ mClickedInMouselook = gAgentCamera.cameraMouselook();
return TRUE;
}
@@ -176,12 +189,12 @@ BOOL LLToolGrab::handleObjectHit(const LLPickInfo& info)
if (gDebugClicks)
{
- llinfos << "LLToolGrab handleObjectHit " << info.mMousePt.mX << "," << info.mMousePt.mY << llendl;
+ LL_INFOS() << "LLToolGrab handleObjectHit " << info.mMousePt.mX << "," << info.mMousePt.mY << LL_ENDL;
}
if (NULL == objectp) // unexpected
{
- llwarns << "objectp was NULL; returning FALSE" << llendl;
+ LL_WARNS() << "objectp was NULL; returning FALSE" << LL_ENDL;
return FALSE;
}
@@ -707,7 +720,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
// HACK to avoid assert: error checking system makes sure that the cursor is set during every handleHover. This is actually a no-op since the cursor is hidden.
gViewerWindow->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (active) [cursor hidden]" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolGrab (active) [cursor hidden]" << LL_ENDL;
}
@@ -871,7 +884,7 @@ void LLToolGrab::handleHoverNonPhysical(S32 x, S32 y, MASK mask)
void LLToolGrab::handleHoverInactive(S32 x, S32 y, MASK mask)
{
// JC - TODO - change cursor based on gGrabBtnVertical, gGrabBtnSpin
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (inactive-not over editable object)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolGrab (inactive-not over editable object)" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB);
}
@@ -881,7 +894,7 @@ void LLToolGrab::handleHoverFailed(S32 x, S32 y, MASK mask)
if( GRAB_NOOBJECT == mMode )
{
gViewerWindow->setCursor(UI_CURSOR_NO);
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (not on object)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolGrab (not on object)" << LL_ENDL;
}
else
{
@@ -894,13 +907,13 @@ void LLToolGrab::handleHoverFailed(S32 x, S32 y, MASK mask)
{
case GRAB_LOCKED:
gViewerWindow->setCursor(UI_CURSOR_GRABLOCKED);
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (grab failed, no move permission)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolGrab (grab failed, no move permission)" << LL_ENDL;
break;
// Non physical now handled by handleHoverActive - CRO
// case GRAB_NONPHYSICAL:
// gViewerWindow->setCursor(UI_CURSOR_ARROW);
-// lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (grab failed, nonphysical)" << llendl;
+// LL_DEBUGS("UserInput") << "hover handled by LLToolGrab (grab failed, nonphysical)" << LL_ENDL;
// break;
default:
llassert(0);
@@ -909,7 +922,7 @@ void LLToolGrab::handleHoverFailed(S32 x, S32 y, MASK mask)
else
{
gViewerWindow->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (grab failed but within slop)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolGrab (grab failed but within slop)" << LL_ENDL;
}
}
}
@@ -926,13 +939,21 @@ BOOL LLToolGrab::handleMouseUp(S32 x, S32 y, MASK mask)
{
setMouseCapture( FALSE );
}
+
mMode = GRAB_INACTIVE;
- // HACK: Make some grabs temporary
- if (gGrabTransientTool)
+ if(mClickedInMouselook && !gAgentCamera.cameraMouselook())
{
- gBasicToolset->selectTool( gGrabTransientTool );
- gGrabTransientTool = NULL;
+ mClickedInMouselook = FALSE;
+ }
+ else
+ {
+ // HACK: Make some grabs temporary
+ if (gGrabTransientTool)
+ {
+ gBasicToolset->selectTool( gGrabTransientTool );
+ gGrabTransientTool = NULL;
+ }
}
//gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject"));
@@ -1108,16 +1129,16 @@ void send_ObjectGrab_message(LLViewerObject* object, const LLPickInfo & pick, co
msg->sendMessage( object->getRegion()->getHost());
/* Diagnostic code
- llinfos << "mUVCoords: " << pick.mUVCoords
+ LL_INFOS() << "mUVCoords: " << pick.mUVCoords
<< ", mSTCoords: " << pick.mSTCoords
<< ", mObjectFace: " << pick.mObjectFace
<< ", mIntersection: " << pick.mIntersection
<< ", mNormal: " << pick.mNormal
<< ", mBinormal: " << pick.mBinormal
- << llendl;
+ << LL_ENDL;
- llinfos << "Avatar pos: " << gAgent.getPositionAgent() << llendl;
- llinfos << "Object pos: " << object->getPosition() << llendl;
+ LL_INFOS() << "Avatar pos: " << gAgent.getPositionAgent() << LL_ENDL;
+ LL_INFOS() << "Object pos: " << object->getPosition() << LL_ENDL;
*/
}