From 8215fff0c2a1c895ef916837847cf7526ae61ef9 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Fri, 2 Apr 2021 19:55:34 +0300 Subject: SL-14717 Ability to trigger left clicks (and more) on animesh objects Contribution by Rohacan Hirons SL-14717 Follow ups SL-14717 Using the cached setting in LLToolPie::handleHover() --- indra/newview/lltoolpie.cpp | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'indra/newview/lltoolpie.cpp') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 322d0bc727..c3f85c0008 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -78,6 +78,10 @@ static void handle_click_action_play(); static void handle_click_action_open_media(LLPointer objectp); static ECursorType cursor_from_parcel_media(U8 click_action); +BOOL rigged_hovering_keep_hand = false; +U64 last_rigged_hovering_check_clock_count = 0; +U64 last_rigged_pick_clock_count = 0; + LLToolPie::LLToolPie() : LLTool(std::string("Pie")), mMouseButtonDown( false ), @@ -112,7 +116,7 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) mMouseDownX = x; mMouseDownY = y; LLTimer pick_timer; - BOOL pick_rigged = false; //gSavedSettings.getBOOL("AnimatedObjectsAllowLeftClick"); + BOOL pick_rigged = gSavedSettings.getBOOL("AnimatedObjectsAllowLeftClick"); LLPickInfo transparent_pick = gViewerWindow->pickImmediate(x, y, TRUE /*includes transparent*/, pick_rigged); LLPickInfo visible_pick = gViewerWindow->pickImmediate(x, y, FALSE, pick_rigged); LLViewerObject *transp_object = transparent_pick.getObject(); @@ -173,7 +177,9 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) mMouseButtonDown = true; - return handleLeftClickPick(); + handleLeftClickPick(); + + return TRUE; } // Spawn context menus on right mouse down so you can drag over and select @@ -722,7 +728,21 @@ void LLToolPie::selectionPropertiesReceived() BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) { - BOOL pick_rigged = false; //gSavedSettings.getBOOL("AnimatedObjectsAllowLeftClick"); + // prevent rigged item hovering causing FPS to drop by faking we're still hovering it for 0.25 seconds + U64 current_clock_count = LLTimer::getCurrentClockCount(); + if (current_clock_count - last_rigged_pick_clock_count < 2500000) { + if(rigged_hovering_keep_hand) gViewerWindow->setCursor(UI_CURSOR_HAND); + return TRUE; + } + rigged_hovering_keep_hand = 0; + + static LLCachedControl pick_rigged_setting(gSavedSettings, "AnimatedObjectsAllowLeftClick"); + BOOL pick_rigged = pick_rigged_setting; + if (pick_rigged) { + pick_rigged = (current_clock_count - last_rigged_hovering_check_clock_count > 1000000); // only 10 per seconds + if (pick_rigged) last_rigged_hovering_check_clock_count = current_clock_count; + } + mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE, pick_rigged); LLViewerObject *parent = NULL; LLViewerObject *object = mHoverPick.getObject(); @@ -730,6 +750,10 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) if (object) { parent = object->getRootEdit(); + // Update gLastRiggedPickClockCount if we're hovering a rigged item + if (object->isRiggedMesh()) { + last_rigged_pick_clock_count = current_clock_count; + } } // Show screen-space highlight glow effect @@ -794,6 +818,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) { show_highlight = true; gViewerWindow->setCursor(UI_CURSOR_HAND); + rigged_hovering_keep_hand = true; LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL; } else -- cgit v1.2.3 From 0814ba33222fa86e73ca3e5351175ba4b7b545e8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 15 Jul 2021 17:34:16 +0300 Subject: SL-443 Keybindings: Support reassigment of script interaction button --- indra/newview/lltoolpie.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/lltoolpie.cpp') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 322d0bc727..543a93bf9b 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -746,7 +746,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) else if (!mMouseOutsideSlop && mMouseButtonDown // disable camera steering if click on land is not used for moving - && gViewerInput.isMouseBindUsed(CLICK_LEFT)) + && gViewerInput.isMouseBindUsed(CLICK_LEFT, MASK_NONE, MODE_THIRD_PERSON)) { S32 delta_x = x - mMouseDownX; S32 delta_y = y - mMouseDownY; -- cgit v1.2.3 From acf771a47e0f41e2a2e62d51b243d79b40a5d680 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 19 Oct 2021 23:11:10 +0300 Subject: SL-14457 Resolve click-to-move conflict with SL-14717 --- indra/newview/lltoolpie.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/lltoolpie.cpp') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index dc13e19dd8..7750a3b084 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -177,9 +177,9 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) mMouseButtonDown = true; - handleLeftClickPick(); - - return TRUE; + // If nothing clickable is picked, needs to return + // false for click-to-walk or click-to-teleport to work. + return handleLeftClickPick(); } // Spawn context menus on right mouse down so you can drag over and select -- cgit v1.2.3 From ee2d618706a8803372b92dbe47a165c70be6cef9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sun, 19 Dec 2021 14:00:33 +0200 Subject: SL-16564 'Click to' action 'None' doesn't work as intended There shouldn't be any differences for 'None' between normal objects and attachments --- indra/newview/lltoolpie.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/lltoolpie.cpp') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 54ff7d295e..848b5eae1d 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -791,7 +791,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB); LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL; } - else if ((!object || !object->isAttachment() || object->getClickAction() != CLICK_ACTION_DISABLED) + else if ((!object || object->getClickAction() != CLICK_ACTION_DISABLED) && ((object && object->flagHandleTouch()) || (parent && parent->flagHandleTouch())) && (!object || !object->isAvatar())) { -- cgit v1.2.3 From bc78cf0b5111c3f6588877e56239030f6e92b55a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 6 Jan 2022 21:54:10 +0200 Subject: SL-16604 Double click teleport should ignore clicking yourself --- indra/newview/lltoolpie.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/lltoolpie.cpp') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 15d5473c41..4f7511294d 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -654,6 +654,12 @@ bool LLToolPie::teleportToClickedLocation() LLViewerObject* objp = mHoverPick.getObject(); LLViewerObject* parentp = objp ? objp->getRootEdit() : NULL; + if (objp->getAvatar() == gAgentAvatarp) + { + // Don't teleport to self, teleporting to other avatars is fine + return false; + } + bool is_in_world = mHoverPick.mObjectID.notNull() && objp && !objp->isHUDAttachment(); bool is_land = mHoverPick.mPickType == LLPickInfo::PICK_LAND; bool pos_non_zero = !mHoverPick.mPosGlobal.isExactlyZero(); -- cgit v1.2.3 From 82a3c185cd39646af861fe8355fa9539f7d3441e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 6 Jan 2022 23:28:36 +0200 Subject: SL-16604 Double click teleport should ignore clicking own nametag --- indra/newview/lltoolpie.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/lltoolpie.cpp') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 4f7511294d..6efed98fff 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -654,7 +654,8 @@ bool LLToolPie::teleportToClickedLocation() LLViewerObject* objp = mHoverPick.getObject(); LLViewerObject* parentp = objp ? objp->getRootEdit() : NULL; - if (objp->getAvatar() == gAgentAvatarp) + if (objp->getAvatar() == gAgentAvatarp + || objp == gAgentAvatarp) // ex: nametag { // Don't teleport to self, teleporting to other avatars is fine return false; -- cgit v1.2.3 From 0bef5e553e5234b9373507341e3b001f4f4e54e7 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Fri, 21 Jan 2022 19:13:28 +0200 Subject: Revert "SL-14717 Ability to trigger left clicks (and more) on animesh objects" This reverts commit 8215fff0c2a1c895ef916837847cf7526ae61ef9. # Conflicts: # indra/newview/lltoolpie.cpp --- indra/newview/lltoolpie.cpp | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'indra/newview/lltoolpie.cpp') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 1e960ed536..b4736841d6 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -78,10 +78,6 @@ static void handle_click_action_play(); static void handle_click_action_open_media(LLPointer objectp); static ECursorType cursor_from_parcel_media(U8 click_action); -BOOL rigged_hovering_keep_hand = false; -U64 last_rigged_hovering_check_clock_count = 0; -U64 last_rigged_pick_clock_count = 0; - LLToolPie::LLToolPie() : LLTool(std::string("Pie")), mMouseButtonDown( false ), @@ -116,7 +112,7 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) mMouseDownX = x; mMouseDownY = y; LLTimer pick_timer; - BOOL pick_rigged = gSavedSettings.getBOOL("AnimatedObjectsAllowLeftClick"); + BOOL pick_rigged = false; //gSavedSettings.getBOOL("AnimatedObjectsAllowLeftClick"); LLPickInfo transparent_pick = gViewerWindow->pickImmediate(x, y, TRUE /*includes transparent*/, pick_rigged); LLPickInfo visible_pick = gViewerWindow->pickImmediate(x, y, FALSE, pick_rigged); LLViewerObject *transp_object = transparent_pick.getObject(); @@ -730,21 +726,7 @@ void LLToolPie::selectionPropertiesReceived() BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) { - // prevent rigged item hovering causing FPS to drop by faking we're still hovering it for 0.25 seconds - U64 current_clock_count = LLTimer::getCurrentClockCount(); - if (current_clock_count - last_rigged_pick_clock_count < 2500000) { - if(rigged_hovering_keep_hand) gViewerWindow->setCursor(UI_CURSOR_HAND); - return TRUE; - } - rigged_hovering_keep_hand = 0; - - static LLCachedControl pick_rigged_setting(gSavedSettings, "AnimatedObjectsAllowLeftClick"); - BOOL pick_rigged = pick_rigged_setting; - if (pick_rigged) { - pick_rigged = (current_clock_count - last_rigged_hovering_check_clock_count > 1000000); // only 10 per seconds - if (pick_rigged) last_rigged_hovering_check_clock_count = current_clock_count; - } - + BOOL pick_rigged = false; //gSavedSettings.getBOOL("AnimatedObjectsAllowLeftClick"); mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE, pick_rigged); LLViewerObject *parent = NULL; LLViewerObject *object = mHoverPick.getObject(); @@ -752,10 +734,6 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) if (object) { parent = object->getRootEdit(); - // Update gLastRiggedPickClockCount if we're hovering a rigged item - if (object->isRiggedMesh()) { - last_rigged_pick_clock_count = current_clock_count; - } } // Show screen-space highlight glow effect @@ -821,7 +799,6 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) { show_highlight = true; gViewerWindow->setCursor(UI_CURSOR_HAND); - rigged_hovering_keep_hand = true; LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL; } else -- cgit v1.2.3 From 921fe18f8bccdbc5df2123368fef2b8599c80a0e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sun, 19 Dec 2021 14:00:33 +0200 Subject: SL-16564 'Click to' action 'None' doesn't work as intended There shouldn't be any differences for 'None' between normal objects and attachments --- indra/newview/lltoolpie.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/lltoolpie.cpp') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 6efed98fff..95552b6771 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -798,7 +798,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB); LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL; } - else if ((!object || !object->isAttachment() || object->getClickAction() != CLICK_ACTION_DISABLED) + else if ((!object || object->getClickAction() != CLICK_ACTION_DISABLED) && ((object && object->flagHandleTouch()) || (parent && parent->flagHandleTouch())) && (!object || !object->isAvatar())) { -- cgit v1.2.3 From ce6dd53f9c364f46e30d0eedb1c6a701fbad8885 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 15 Feb 2022 14:41:22 +0200 Subject: SL-16564 'Click to' action 'None' doesn't work as intended #2 --- indra/newview/lltoolpie.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/lltoolpie.cpp') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 95552b6771..7e560f7972 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -392,8 +392,9 @@ BOOL LLToolPie::handleLeftClickPick() gFocusMgr.setKeyboardFocus(NULL); } - BOOL touchable = (object && object->flagHandleTouch()) - || (parent && parent->flagHandleTouch()); + bool touchable = object + && (object->getClickAction() != CLICK_ACTION_DISABLED) + && (object->flagHandleTouch() || (parent && parent->flagHandleTouch())); // Switch to grab tool if physical or triggerable if (object && -- cgit v1.2.3 From 76a1b181e6fd6ddaf89b53eab4de80477e11fa3d Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 3 Mar 2022 16:40:00 +0200 Subject: SL-16970 FIXED Crash in LLToolPie::teleportToClickedLocation --- indra/newview/lltoolpie.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/lltoolpie.cpp') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 5e86c290cd..43deac60d9 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -657,8 +657,7 @@ bool LLToolPie::teleportToClickedLocation() LLViewerObject* objp = mHoverPick.getObject(); LLViewerObject* parentp = objp ? objp->getRootEdit() : NULL; - if (objp->getAvatar() == gAgentAvatarp - || objp == gAgentAvatarp) // ex: nametag + if (objp && (objp->getAvatar() == gAgentAvatarp || objp == gAgentAvatarp)) // ex: nametag { // Don't teleport to self, teleporting to other avatars is fine return false; -- cgit v1.2.3