summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolcomp.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2014-10-13 17:13:15 -0400
committerOz Linden <oz@lindenlab.com>2014-10-13 17:13:15 -0400
commit852426d71e5b192a003d01d128799c2b702c69b1 (patch)
tree66a31f735c3dd92f557a9026cf359ef000d548e9 /indra/newview/lltoolcomp.cpp
parent08a4d7a27743792a644c46f8163d973d0524cd79 (diff)
parent788ce7a8cdbbbf98566ce75ec281ec00c21dc6d8 (diff)
merge changes for 3.7.17-release
Diffstat (limited to 'indra/newview/lltoolcomp.cpp')
-rwxr-xr-xindra/newview/lltoolcomp.cpp89
1 files changed, 71 insertions, 18 deletions
diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp
index b75d6b3dcb..4bda9072d0 100755
--- a/indra/newview/lltoolcomp.cpp
+++ b/indra/newview/lltoolcomp.cpp
@@ -126,12 +126,20 @@ void LLToolComposite::handleSelect()
mSelected = TRUE;
}
+void LLToolComposite::handleDeselect()
+{
+ mCur->handleDeselect();
+ mCur = mDefault;
+ mSelected = FALSE;
+}
+
//----------------------------------------------------------------------------
// LLToolCompInspect
//----------------------------------------------------------------------------
LLToolCompInspect::LLToolCompInspect()
-: LLToolComposite(std::string("Inspect"))
+: LLToolComposite(std::string("Inspect")),
+ mIsToolCameraActive(FALSE)
{
mSelectRect = new LLToolSelectRect(this);
mDefault = mSelectRect;
@@ -146,42 +154,87 @@ LLToolCompInspect::~LLToolCompInspect()
BOOL LLToolCompInspect::handleMouseDown(S32 x, S32 y, MASK mask)
{
- mMouseDown = TRUE;
- gViewerWindow->pickAsync(x, y, mask, pickCallback);
- return TRUE;
+ BOOL handled = FALSE;
+
+ if (mCur == LLToolCamera::getInstance())
+ {
+ handled = mCur->handleMouseDown(x, y, mask);
+ }
+ else
+ {
+ mMouseDown = TRUE;
+ gViewerWindow->pickAsync(x, y, mask, pickCallback);
+ handled = TRUE;
+ }
+
+ return handled;
+}
+
+BOOL LLToolCompInspect::handleMouseUp(S32 x, S32 y, MASK mask)
+{
+ BOOL handled = LLToolComposite::handleMouseUp(x, y, mask);
+ mIsToolCameraActive = getCurrentTool() == LLToolCamera::getInstance();
+ return handled;
}
void LLToolCompInspect::pickCallback(const LLPickInfo& pick_info)
{
LLViewerObject* hit_obj = pick_info.getObject();
+ LLToolCompInspect * tool_inspectp = LLToolCompInspect::getInstance();
- if (!LLToolCompInspect::getInstance()->mMouseDown)
+ if (!tool_inspectp->mMouseDown)
{
// fast click on object, but mouse is already up...just do select
- LLToolCompInspect::getInstance()->mSelectRect->handleObjectSelection(pick_info, gSavedSettings.getBOOL("EditLinkedParts"), FALSE);
+ tool_inspectp->mSelectRect->handleObjectSelection(pick_info, gSavedSettings.getBOOL("EditLinkedParts"), FALSE);
return;
}
- if( hit_obj )
- {
- if (LLSelectMgr::getInstance()->getSelection()->getObjectCount())
- {
- LLEditMenuHandler::gEditMenuHandler = LLSelectMgr::getInstance();
- }
- LLToolCompInspect::getInstance()->setCurrentTool( LLToolCompInspect::getInstance()->mSelectRect );
- LLToolCompInspect::getInstance()->mSelectRect->handlePick( pick_info );
+ LLSelectMgr * mgr_selectp = LLSelectMgr::getInstance();
+ if( hit_obj && mgr_selectp->getSelection()->getObjectCount()) {
+ LLEditMenuHandler::gEditMenuHandler = mgr_selectp;
+ }
+
+ tool_inspectp->setCurrentTool( tool_inspectp->mSelectRect );
+ tool_inspectp->mIsToolCameraActive = FALSE;
+ tool_inspectp->mSelectRect->handlePick( pick_info );
+}
+
+BOOL LLToolCompInspect::handleDoubleClick(S32 x, S32 y, MASK mask)
+{
+ return TRUE;
+}
+
+BOOL LLToolCompInspect::handleKey(KEY key, MASK mask)
+{
+ BOOL handled = FALSE;
+ if(KEY_ALT == key)
+ {
+ setCurrentTool(LLToolCamera::getInstance());
+ mIsToolCameraActive = TRUE;
+ handled = TRUE;
}
else
{
- LLToolCompInspect::getInstance()->setCurrentTool( LLToolCompInspect::getInstance()->mSelectRect );
- LLToolCompInspect::getInstance()->mSelectRect->handlePick( pick_info );
+ handled = LLToolComposite::handleKey(key, mask);
}
+
+ return handled;
}
-BOOL LLToolCompInspect::handleDoubleClick(S32 x, S32 y, MASK mask)
+void LLToolCompInspect::onMouseCaptureLost()
{
- return TRUE;
+ LLToolComposite::onMouseCaptureLost();
+ mIsToolCameraActive = FALSE;
+}
+
+void LLToolCompInspect::keyUp(KEY key, MASK mask)
+{
+ if (KEY_ALT == key && mCur == LLToolCamera::getInstance())
+ {
+ setCurrentTool(mDefault);
+ mIsToolCameraActive = FALSE;
+ }
}
//----------------------------------------------------------------------------