summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolpie.cpp
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2015-12-15 12:30:29 +0200
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2015-12-15 12:30:29 +0200
commit8a761993da9d8e7e8b0b8d0350c79c1e8c511e31 (patch)
treec3b7e96cf3c2b4f9f419ee64a0202842e27b6588 /indra/newview/lltoolpie.cpp
parent40699b96633e125846672c4639f04a05eb237712 (diff)
MAINT-957 Double-click Auto-pilot activates for clicks on UI elements, HUDs, some right-clicks
Diffstat (limited to 'indra/newview/lltoolpie.cpp')
-rwxr-xr-xindra/newview/lltoolpie.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index e400edec16..455a9951ac 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,6 +752,13 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
LL_INFOS() << "LLToolPie handleDoubleClick (becoming mouseDown)" << LL_ENDL;
}
+ if (!mDoubleClickTimer.getStarted() || (mDoubleClickTimer.getElapsedTimeF32() > 0.3f))
+ {
+ mDoubleClickTimer.stop();
+ return FALSE;
+ }
+ mDoubleClickTimer.stop();
+
if (gSavedSettings.getBOOL("DoubleClickAutoPilot"))
{
// We may be doing double click to walk, but we don't want to use a target on