summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolpie.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltoolpie.cpp')
-rw-r--r--indra/newview/lltoolpie.cpp73
1 files changed, 62 insertions, 11 deletions
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index 9e37ca0394..2a87bce134 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -111,11 +111,64 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask)
mMouseOutsideSlop = FALSE;
mMouseDownX = x;
mMouseDownY = y;
- LLTimer pick_timer;
- BOOL pick_rigged = false; //gSavedSettings.getBOOL("AnimatedObjectsAllowLeftClick");
- //left mouse down always picks transparent (but see handleMouseUp)
- mPick = gViewerWindow->pickImmediate(x, y, TRUE, pick_rigged);
- LL_INFOS() << "pick_rigged is " << (S32) pick_rigged << " pick time elapsed " << pick_timer.getElapsedTimeF32() << LL_ENDL;
+ LLTimer pick_timer;
+ 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();
+ LLViewerObject *visible_object = visible_pick.getObject();
+
+ // Current set of priorities
+ // 1. Transparent attachment pick
+ // 2. Transparent actionable pick
+ // 3. Visible attachment pick (e.x we click on attachment under invisible floor)
+ // 4. Visible actionable pick
+ // 5. Transparent pick (e.x. movement on transparent object/floor, our default pick)
+ // left mouse down always picks transparent (but see handleMouseUp).
+ // Also see LLToolPie::handleHover() - priorities are a bit different there.
+ // Todo: we need a more consistent set of rules to work with
+ if (transp_object == visible_object || !visible_object)
+ {
+ // Note: if transparent object is null, then visible object is also null
+ // since transparent pick includes non-tranpsarent one.
+ // !transparent_object check will be covered by transparent_object == visible_object.
+ mPick = transparent_pick;
+ }
+ else
+ {
+ // Select between two non-null picks
+ LLViewerObject *transp_parent = transp_object->getRootEdit();
+ LLViewerObject *visible_parent = visible_object->getRootEdit();
+ if (transp_object->isAttachment())
+ {
+ // 1. Transparent attachment
+ mPick = transparent_pick;
+ }
+ else if (transp_object->getClickAction() != CLICK_ACTION_DISABLED
+ && (useClickAction(mask, transp_object, transp_parent) || transp_object->flagHandleTouch() || (transp_parent && transp_parent->flagHandleTouch())))
+ {
+ // 2. Transparent actionable pick
+ mPick = transparent_pick;
+ }
+ else if (visible_object->isAttachment())
+ {
+ // 3. Visible attachment pick
+ mPick = visible_pick;
+ }
+ else if (visible_object->getClickAction() != CLICK_ACTION_DISABLED
+ && (useClickAction(mask, visible_object, visible_parent) || visible_object->flagHandleTouch() || (visible_parent && visible_parent->flagHandleTouch())))
+ {
+ // 4. Visible actionable pick
+ mPick = visible_pick;
+ }
+ else
+ {
+ // 5. Default: transparent
+ mPick = transparent_pick;
+ }
+ }
+ LL_INFOS() << "pick_rigged is " << (S32) pick_rigged << " pick time elapsed " << pick_timer.getElapsedTimeF32() << LL_ENDL;
+
mPick.mKeyMask = mask;
mMouseButtonDown = true;
@@ -857,13 +910,11 @@ static bool needs_tooltip(LLSelectNode* nodep)
BOOL LLToolPie::handleTooltipLand(std::string line, std::string tooltip_msg)
{
- LLViewerParcelMgr::getInstance()->setHoverParcel( mHoverPick.mPosGlobal );
- //
- // Do not show hover for land unless prefs are set to allow it.
- //
-
+ // Do not show hover for land unless prefs are set to allow it.
if (!gSavedSettings.getBOOL("ShowLandHoverTip")) return TRUE;
-
+
+ LLViewerParcelMgr::getInstance()->setHoverParcel( mHoverPick.mPosGlobal );
+
// Didn't hit an object, but since we have a land point we
// must be hovering over land.