From 0812d81e7b64ef80f7ca832f7110f43f1ce9ff33 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 16 Nov 2020 22:06:17 +0200 Subject: SL-13287 Removed unused hack --- indra/newview/lltoolpie.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/newview/lltoolpie.cpp') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 864ce09430..f98f9c69f2 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1109,8 +1109,6 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l final_name = LLTrans::getString("TooltipPerson");; } - // *HACK: We may select this object, so pretend it was clicked - mPick = mHoverPick; LLInspector::Params p; p.fillFrom(LLUICtrlFactory::instance().getDefaultParams()); p.message(final_name); @@ -1222,8 +1220,6 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l if (show_all_object_tips || needs_tip) { - // We may select this object, so pretend it was clicked - mPick = mHoverPick; LLInspector::Params p; p.fillFrom(LLUICtrlFactory::instance().getDefaultParams()); p.message(tooltip_msg); -- cgit v1.2.3 From e3b910e14113030b79004bf216193c96c6fb9521 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 4 Dec 2020 17:02:22 +0200 Subject: SL-14462 FIXED The wrong mouse cursor is shown when sitting on a touch-scripted object --- 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 864ce09430..e9dda9a29c 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -691,7 +691,8 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL; } else if ((!object || !object->isAttachment() || object->getClickAction() != CLICK_ACTION_DISABLED) - && ((object && object->flagHandleTouch()) || (parent && parent->flagHandleTouch()))) + && ((object && object->flagHandleTouch()) || (parent && parent->flagHandleTouch())) + && (object && !object->isAvatar())) { show_highlight = true; gViewerWindow->setCursor(UI_CURSOR_HAND); -- cgit v1.2.3 From 9dd9af129b67be184dd66e2ee4b46bd815877e70 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 11 Dec 2020 23:07:49 +0200 Subject: SL-14461 Parent set to no click action should not override child's 'touch' action. --- indra/newview/lltoolpie.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'indra/newview/lltoolpie.cpp') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index e9dda9a29c..c6ee0daffe 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -465,8 +465,9 @@ BOOL LLToolPie::useClickAction(MASK mask, && object && !object->isAttachment() && LLPrimitive::isPrimitive(object->getPCode()) - && (object->getClickAction() - || parent->getClickAction()); + // useClickAction does not handle Touch (0) or Disabled action + && ((object->getClickAction() && object->getClickAction() != CLICK_ACTION_DISABLED) + || (parent->getClickAction() && parent->getClickAction() != CLICK_ACTION_DISABLED)); } @@ -480,13 +481,17 @@ U8 final_click_action(LLViewerObject* obj) if (obj->getClickAction() || (parent && parent->getClickAction())) { - if (obj->getClickAction()) + U8 object_action = obj->getClickAction(); + U8 parent_action = parent ? parent->getClickAction() : CLICK_ACTION_TOUCH; + if (parent_action == CLICK_ACTION_DISABLED || object_action) { - click_action = obj->getClickAction(); + // CLICK_ACTION_DISABLED ("None" in UI) is intended for child action to + // override parents action when assigned to parent or to child + click_action = object_action; } - else if (parent && parent->getClickAction()) + else if (parent_action) { - click_action = parent->getClickAction(); + click_action = parent_action; } } return click_action; @@ -692,7 +697,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) } else if ((!object || !object->isAttachment() || object->getClickAction() != CLICK_ACTION_DISABLED) && ((object && object->flagHandleTouch()) || (parent && parent->flagHandleTouch())) - && (object && !object->isAvatar())) + && (!object || !object->isAvatar())) { show_highlight = true; gViewerWindow->setCursor(UI_CURSOR_HAND); -- cgit v1.2.3 From 9407637c5383bd0c3739f1ff4e0ac6ceeb579208 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sun, 13 Dec 2020 13:06:47 +0200 Subject: SL-14461 Double click teleport should work on 'disabled' objects --- indra/newview/lltoolpie.cpp | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'indra/newview/lltoolpie.cpp') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index c6ee0daffe..05ace54074 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -467,7 +467,7 @@ BOOL LLToolPie::useClickAction(MASK mask, && LLPrimitive::isPrimitive(object->getPCode()) // useClickAction does not handle Touch (0) or Disabled action && ((object->getClickAction() && object->getClickAction() != CLICK_ACTION_DISABLED) - || (parent->getClickAction() && parent->getClickAction() != CLICK_ACTION_DISABLED)); + || (parent && parent->getClickAction() && parent->getClickAction() != CLICK_ACTION_DISABLED)); } @@ -478,22 +478,18 @@ U8 final_click_action(LLViewerObject* obj) U8 click_action = CLICK_ACTION_TOUCH; LLViewerObject* parent = obj->getRootEdit(); - if (obj->getClickAction() - || (parent && parent->getClickAction())) - { - U8 object_action = obj->getClickAction(); - U8 parent_action = parent ? parent->getClickAction() : CLICK_ACTION_TOUCH; - if (parent_action == CLICK_ACTION_DISABLED || object_action) - { - // CLICK_ACTION_DISABLED ("None" in UI) is intended for child action to - // override parents action when assigned to parent or to child - click_action = object_action; - } - else if (parent_action) - { - click_action = parent_action; - } - } + U8 object_action = obj->getClickAction(); + U8 parent_action = parent ? parent->getClickAction() : CLICK_ACTION_TOUCH; + if (parent_action == CLICK_ACTION_DISABLED || object_action) + { + // CLICK_ACTION_DISABLED ("None" in UI) is intended for child action to + // override parent's action when assigned to parent or to child + click_action = object_action; + } + else if (parent_action) + { + click_action = parent_action; + } return click_action; } @@ -886,9 +882,10 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) bool is_land = mPick.mPickType == LLPickInfo::PICK_LAND; bool pos_non_zero = !mPick.mPosGlobal.isExactlyZero(); bool has_touch_handler = (objp && objp->flagHandleTouch()) || (parentp && parentp->flagHandleTouch()); - bool has_click_action = final_click_action(objp); + U8 click_action = final_click_action(objp); // deault action: 0 - touch + bool has_click_action = (click_action || has_touch_handler) && click_action != CLICK_ACTION_DISABLED; - if (pos_non_zero && (is_land || (is_in_world && !has_touch_handler && !has_click_action))) + if (pos_non_zero && (is_land || (is_in_world && !has_click_action))) { LLVector3d pos = mPick.mPosGlobal; pos.mdV[VZ] += gAgentAvatarp->getPelvisToFoot(); -- cgit v1.2.3 From 5ab76453bb53424bbbc77a0d0b818ba05bceb92d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 5 Apr 2021 20:52:49 +0200 Subject: Fix merge errors --- indra/newview/lltoolpie.cpp | 59 +++------------------------------------------ 1 file changed, 3 insertions(+), 56 deletions(-) (limited to 'indra/newview/lltoolpie.cpp') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 5b6c540666..3628946260 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -658,9 +658,10 @@ bool LLToolPie::teleportToClickedLocation() bool is_land = mHoverPick.mPickType == LLPickInfo::PICK_LAND; bool pos_non_zero = !mHoverPick.mPosGlobal.isExactlyZero(); bool has_touch_handler = (objp && objp->flagHandleTouch()) || (parentp && parentp->flagHandleTouch()); - bool has_click_action = final_click_action(objp); + U8 click_action = final_click_action(objp); // default action: 0 - touch + bool has_click_action = (click_action || has_touch_handler) && click_action != CLICK_ACTION_DISABLED; - if (pos_non_zero && (is_land || (is_in_world && !has_touch_handler && !has_click_action))) + if (pos_non_zero && (is_land || (is_in_world && !has_click_action))) { LLVector3d pos = mHoverPick.mPosGlobal; pos.mdV[VZ] += gAgentAvatarp->getPelvisToFoot(); @@ -878,60 +879,6 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) } mDoubleClickTimer.stop(); - if (gSavedSettings.getBOOL("DoubleClickAutoPilot")) - { - // We may be doing double click to walk, but we don't want to use a target on - // a transparent object because the user thought they were clicking on - // whatever they were seeing through it, so recompute what was clicked on - // ignoring transparent objects - LLPickInfo savedPick = mPick; - mPick = gViewerWindow->pickImmediate(savedPick.mMousePt.mX, savedPick.mMousePt.mY, - FALSE /* ignore transparent */, - FALSE /* ignore rigged */, - 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())) - { - walkToClickedLocation(); - return TRUE; - } - else - { - // restore the original pick for any other purpose - mPick = savedPick; - } - } - else if (gSavedSettings.getBOOL("DoubleClickTeleport")) - { - LLViewerObject* objp = mPick.getObject(); - LLViewerObject* parentp = objp ? objp->getRootEdit() : NULL; - - bool is_in_world = mPick.mObjectID.notNull() && objp && !objp->isHUDAttachment(); - bool is_land = mPick.mPickType == LLPickInfo::PICK_LAND; - bool pos_non_zero = !mPick.mPosGlobal.isExactlyZero(); - bool has_touch_handler = (objp && objp->flagHandleTouch()) || (parentp && parentp->flagHandleTouch()); - U8 click_action = final_click_action(objp); // deault action: 0 - touch - bool has_click_action = (click_action || has_touch_handler) && click_action != CLICK_ACTION_DISABLED; - - if (pos_non_zero && (is_land || (is_in_world && !has_click_action))) - { - LLVector3d pos = mPick.mPosGlobal; - pos.mdV[VZ] += gAgentAvatarp->getPelvisToFoot(); - gAgent.teleportViaLocationLookAt(pos); - return TRUE; - } - } - return FALSE; } -- cgit v1.2.3