diff options
Diffstat (limited to 'indra/newview/lltoolpie.cpp')
-rwxr-xr-x | indra/newview/lltoolpie.cpp | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index abb9a63238..e17651dc91 100755 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -86,7 +86,8 @@ LLToolPie::LLToolPie() mBlockClickToWalk(false), mClickAction(0), mClickActionBuyEnabled( gSavedSettings.getBOOL("ClickActionBuyEnabled") ), - mClickActionPayEnabled( gSavedSettings.getBOOL("ClickActionPayEnabled") ) + mClickActionPayEnabled( gSavedSettings.getBOOL("ClickActionPayEnabled") ), + mDoubleClickTimer() { } @@ -102,7 +103,12 @@ BOOL LLToolPie::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktyp BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) { - mMouseOutsideSlop = FALSE; + if (mDoubleClickTimer.getStarted()) + { + mDoubleClickTimer.stop(); + } + + mMouseOutsideSlop = FALSE; mMouseDownX = x; mMouseDownY = y; @@ -644,7 +650,15 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask) { - LLViewerObject* obj = mPick.getObject(); + if (!mDoubleClickTimer.getStarted()) + { + mDoubleClickTimer.start(); + } + else + { + mDoubleClickTimer.reset(); + } + LLViewerObject* obj = mPick.getObject(); U8 click_action = final_click_action(obj); // let media have first pass at click @@ -738,10 +752,17 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) LL_INFOS() << "LLToolPie handleDoubleClick (becoming mouseDown)" << LL_ENDL; } - if (handleMediaDblClick(mPick)) - { - return TRUE; - } + if (handleMediaDblClick(mPick)) + { + return TRUE; + } + + if (!mDoubleClickTimer.getStarted() || (mDoubleClickTimer.getElapsedTimeF32() > 0.3f)) + { + mDoubleClickTimer.stop(); + return FALSE; + } + mDoubleClickTimer.stop(); if (gSavedSettings.getBOOL("DoubleClickAutoPilot")) { @@ -754,6 +775,15 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) FALSE /* ignore transparent */, FALSE /* ignore particles */); + if(mPick.mPickType == LLPickInfo::PICK_OBJECT) + { + if (mPick.getObject() && mPick.getObject()->isHUDAttachment()) + { + mPick = savedPick; + return FALSE; + } + } + if ((mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) || (mPick.mObjectID.notNull() && !mPick.mPosGlobal.isExactlyZero())) { |