diff options
author | maksymsproductengine <maksymsproductengine@lindenlab.com> | 2014-07-07 22:44:04 +0300 |
---|---|---|
committer | maksymsproductengine <maksymsproductengine@lindenlab.com> | 2014-07-07 22:44:04 +0300 |
commit | 8f429fac242679cbbac8b6c33be0c593baac41c2 (patch) | |
tree | 4dca9cd54d3570263818bd089193942dbbdfe120 /indra/newview | |
parent | b17199f283bcb3278c1238b9ccec96a1723db442 (diff) |
MAINT-2953 FIXED When "Inspect Objects" floater has focus you cannot move the camera with ALT+Zoom or CTRL+ALT+Zoom
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/lltoolcomp.cpp | 89 | ||||
-rwxr-xr-x | indra/newview/lltoolcomp.h | 14 | ||||
-rwxr-xr-x | indra/newview/lltoolmgr.cpp | 16 | ||||
-rwxr-xr-x | indra/newview/llviewerwindow.cpp | 7 |
4 files changed, 105 insertions, 21 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; + } } //---------------------------------------------------------------------------- diff --git a/indra/newview/lltoolcomp.h b/indra/newview/lltoolcomp.h index bbb5ed5797..e75d3c22e2 100755 --- a/indra/newview/lltoolcomp.h +++ b/indra/newview/lltoolcomp.h @@ -62,7 +62,7 @@ public: virtual BOOL clipMouseWhenDown() { return mCur->clipMouseWhenDown(); } virtual void handleSelect(); - virtual void handleDeselect() { mCur->handleDeselect(); mCur = mDefault; mSelected = FALSE; } + virtual void handleDeselect(); virtual void render() { mCur->render(); } virtual void draw() { mCur->draw(); } @@ -78,9 +78,10 @@ public: { mCur->localPointToScreen(local_x, local_y, screen_x, screen_y); } BOOL isSelecting(); + LLTool* getCurrentTool() { return mCur; } + protected: void setCurrentTool( LLTool* new_tool ); - LLTool* getCurrentTool() { return mCur; } // In hover handler, call this to auto-switch tools void setToolFromMask( MASK mask, LLTool *normal ); @@ -108,9 +109,18 @@ public: // Overridden from LLToolComposite virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); + virtual BOOL handleKey(KEY key, MASK mask); + virtual void onMouseCaptureLost(); + void keyUp(KEY key, MASK mask); static void pickCallback(const LLPickInfo& pick_info); + + BOOL isToolCameraActive() const { return mIsToolCameraActive; } + +private: + BOOL mIsToolCameraActive; }; //----------------------------------------------------------------------- diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index aa55caf7ec..175227173f 100755 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -34,6 +34,7 @@ //#include "llfirstuse.h" // tools and manipulators +#include "llfloaterinspect.h" #include "lltool.h" #include "llmanipscale.h" #include "llselectmgr.h" @@ -218,7 +219,20 @@ LLTool* LLToolMgr::getCurrentTool() } if (cur_tool) { - cur_tool->handleSelect(); + if ( LLToolCompInspect::getInstance()->isToolCameraActive() + && prev_tool == LLToolCamera::getInstance() + && cur_tool == LLToolPie::getInstance() ) + { + LLFloaterInspect * inspect_instance = LLFloaterReg::getTypedInstance<LLFloaterInspect>("inspect"); + if(inspect_instance && inspect_instance->getVisible()) + { + setTransientTool(LLToolCompInspect::getInstance()); + } + } + else + { + cur_tool->handleSelect(); + } } } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 6ad1bfa50b..d042bd847e 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1392,6 +1392,13 @@ BOOL LLViewerWindow::handleTranslatedKeyUp(KEY key, MASK mask) // Let the voice chat code check for its PTT key. Note that this never affects event processing. LLVoiceClient::getInstance()->keyUp(key, mask); + // Let the inspect tool code check for ALT key to set LLToolSelectRect active instead LLToolCamera + LLToolCompInspect * tool_inspectp = LLToolCompInspect::getInstance(); + if (LLToolMgr::getInstance()->getCurrentTool() == tool_inspectp) + { + tool_inspectp->keyUp(key, mask); + } + return FALSE; } |