本文整理汇总了C++中LLViewerObject::flagHandleTouch方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerObject::flagHandleTouch方法的具体用法?C++ LLViewerObject::flagHandleTouch怎么用?C++ LLViewerObject::flagHandleTouch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerObject
的用法示例。
在下文中一共展示了LLViewerObject::flagHandleTouch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: needs_tooltip
static bool needs_tooltip(LLSelectNode* nodep)
{
if (!nodep)
return false;
LLViewerObject* object = nodep->getObject();
LLViewerObject *parent = (LLViewerObject *)object->getParent();
if (object->flagHandleTouch()
|| (parent && parent->flagHandleTouch())
|| object->flagTakesMoney()
|| (parent && parent->flagTakesMoney())
|| object->flagAllowInventoryAdd()
)
{
return true;
}
U8 click_action = final_click_action(object);
if (click_action != 0)
{
return true;
}
if (nodep->mValid)
{
bool anyone_copy = anyone_copy_selection(nodep);
bool for_sale = for_sale_selection(nodep);
if (anyone_copy || for_sale)
{
return true;
}
}
return false;
}
示例2: handleHover
BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
{
/*
// If auto-rotate occurs, tag mouse-outside-slop to make sure the drag
// gets started.
const S32 ROTATE_H_MARGIN = (S32) (0.1f * gViewerWindow->getWindowWidth() );
const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD;
const F32 rotate_angle = ROTATE_ANGLE_PER_SECOND / gFPSClamped;
// ...normal modes can only yaw
if (x < ROTATE_H_MARGIN)
{
gAgent.yaw(rotate_angle);
mMouseOutsideSlop = TRUE;
}
else if (x > gViewerWindow->getWindowWidth() - ROTATE_H_MARGIN)
{
gAgent.yaw(-rotate_angle);
mMouseOutsideSlop = TRUE;
}
*/
LLViewerObject *object = NULL;
LLViewerObject *parent = NULL;
if (gHoverView)
{
object = gViewerWindow->getHoverPick().getObject();
}
if (object)
{
parent = object->getRootEdit();
}
if (object && useClickAction(FALSE, mask, object, parent))
{
ECursorType cursor = cursor_from_object(object);
gViewerWindow->getWindow()->setCursor(cursor);
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
}
else if ((object && !object->isAvatar() && object->usePhysics())
|| (parent && !parent->isAvatar() && parent->usePhysics()))
{
gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLGRAB);
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
}
else if ( (object && object->flagHandleTouch())
|| (parent && parent->flagHandleTouch()))
{
gViewerWindow->getWindow()->setCursor(UI_CURSOR_HAND);
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
}
else
{
gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
}
return TRUE;
}
示例3: updateButtons
// Choose the "most relevant" operation for this object, and show a button for
// that operation as the left-most button in the inspector.
void LLInspectObject::updateButtons(LLSelectNode* nodep)
{
// We'll start with everyone hidden and show the ones we need
hideButtons();
LLViewerObject* object = nodep->getObject();
LLViewerObject *parent = (LLViewerObject*)object->getParent();
bool for_copy = anyone_copy_selection(nodep);
bool for_sale = enable_buy_object();
S32 price = nodep->mSaleInfo.getSalePrice();
U8 click_action = final_click_action(object);
if (for_copy
|| (for_sale && price == 0))
{
// Free copies have priority over other operations
getChild<LLUICtrl>("take_free_copy_btn")->setVisible(true);
}
else if (for_sale)
{
getChild<LLUICtrl>("buy_btn")->setVisible(true);
}
else if ( enable_pay_object() )
{
getChild<LLUICtrl>("pay_btn")->setVisible(true);
}
else if (click_action == CLICK_ACTION_SIT)
{
// Click-action sit must come before "open" because many objects on
// which you can sit have scripts, and hence can be opened
getChild<LLUICtrl>("sit_btn")->setVisible(true);
updateSitLabel(nodep);
}
else if (object->flagHandleTouch()
|| (parent && parent->flagHandleTouch()))
{
getChild<LLUICtrl>("touch_btn")->setVisible(true);
updateTouchLabel(nodep);
}
else if ( enable_object_open() )
{
// Open is last because anything with a script in it can be opened
getChild<LLUICtrl>("open_btn")->setVisible(true);
}
else
{
// By default, we can sit on anything
getChild<LLUICtrl>("sit_btn")->setVisible(true);
updateSitLabel(nodep);
}
// No flash
focusFirstItem(FALSE, FALSE);
}
示例4: handleDoubleClick
BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
{
if (gDebugClicks)
{
llinfos << "LLToolPie handleDoubleClick (becoming mouseDown)" << llendl;
}
if (gSavedSettings.getBOOL("DoubleClickAutoPilot"))
{
if (mPick.mPickType == LLPickInfo::PICK_LAND
&& !mPick.mPosGlobal.isExactlyZero())
{
handle_go_to();
return TRUE;
}
else if (mPick.mObjectID.notNull()
&& !mPick.mPosGlobal.isExactlyZero())
{
// Hit an object
// HACK: Call the last hit position the point we hit on the object
//gLastHitPosGlobal += gLastHitObjectOffset;
handle_go_to();
return TRUE;
}
} else
/* code added to support double click teleports */
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());
bool has_click_action = final_click_action(objp);
if (pos_non_zero && (is_land || (is_in_world && !has_touch_handler && !has_click_action)))
{
LLVector3d pos = mPick.mPosGlobal;
pos.mdV[VZ] += gAgent.getAvatarObject()->getPelvisToFoot();
gAgent.teleportViaLocationLookAt(pos);
return TRUE;
}
}
return FALSE;
}
示例5: handleDoubleClick
BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
{
if (gDebugClicks)
{
llinfos << "LLToolPie handleDoubleClick (becoming mouseDown)" << llendl;
}
/* code added to support double click teleports */
if (gSavedSettings.getBOOL("EmeraldDoubleClickTeleport"))
{
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());
bool is_click_action_attachment = objp && objp->flagHandleTouch() && objp->isAttachment() ;
if (pos_non_zero && (is_land || is_in_world) && !is_click_action_attachment) //&& !has_touch_handler && !has_click_action
{
LLVector3d pos = mPick.mPosGlobal;
//handle_go_to();
//LLViewerRegion* regionp = gAgent.getRegion();
//bool isLocal = regionp->getHandle() == to_region_handle_global((F32)pos.mdV[VX], (F32)pos.mdV[VY]);
bool calc = gSavedSettings.getBOOL("EmeraldDoubleClickTeleportAvCalc");
bool vel = gSavedSettings.getBOOL("EmeraldVelocityDoubleClickTeleport");
LLVector3 offset = LLVector3(0.f,0.f,gSavedSettings.getF32("EmeraldDoubleClickZOffset"));
if(vel)offset += gAgent.getVelocity() * 0.25;
if(calc)offset += LLVector3(0.f,0.f,gAgent.getAvatarObject()->getPelvisToFoot());//LLVector3(0.f,0.f,gAgent.getAvatarObject()->getScale().mV[2] / 2);
pos.mdV[VX] += offset.mV[VX];
pos.mdV[VY] += offset.mV[VY];
pos.mdV[VZ] += offset.mV[VZ];
gAgent.teleportViaLocation(pos);
return TRUE;
}
}else
if (gSavedSettings.getBOOL("DoubleClickAutoPilot"))
{
if (mPick.mPickType == LLPickInfo::PICK_LAND
&& !mPick.mPosGlobal.isExactlyZero())
{
handle_go_to();
return TRUE;
}
else if (mPick.mObjectID.notNull()
&& !mPick.mPosGlobal.isExactlyZero())
{
// Hit an object
// HACK: Call the last hit position the point we hit on the object
//gLastHitPosGlobal += gLastHitObjectOffset;
handle_go_to();
return TRUE;
}
}
return FALSE;
/* JC - don't do go-there, because then double-clicking on physical
objects gets you into trouble.
// If double-click on object or land, go there.
LLViewerObject *object = gViewerWindow->getLastPick().getObject();
if (object)
{
if (object->isAvatar())
{
LLFloaterAvatarInfo::showFromAvatar(object->getID());
}
else
{
handle_go_to(NULL);
}
}
else if (!gLastHitPosGlobal.isExactlyZero())
{
handle_go_to(NULL);
}
return TRUE;
*/
}
示例6: handleHover
BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
{
/*
// If auto-rotate occurs, tag mouse-outside-slop to make sure the drag
// gets started.
const S32 ROTATE_H_MARGIN = (S32) (0.1f * gViewerWindow->getWindowWidth() );
const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD;
const F32 rotate_angle = ROTATE_ANGLE_PER_SECOND / gFPSClamped;
// ...normal modes can only yaw
if (x < ROTATE_H_MARGIN)
{
gAgent.yaw(rotate_angle);
mMouseOutsideSlop = TRUE;
}
else if (x > gViewerWindow->getWindowWidth() - ROTATE_H_MARGIN)
{
gAgent.yaw(-rotate_angle);
mMouseOutsideSlop = TRUE;
}
*/
LLViewerObject *object = NULL;
LLViewerObject *parent = NULL;
// object = gViewerWindow->getHoverPick().getObject();
// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l
// Block all special click action cursors when:
// - @fartouch=n restricted and the object is out of range
// - @interact=n restricted and the object isn't a HUD attachment
const LLPickInfo& pick = gViewerWindow->getHoverPick();
object = pick.getObject();
if ( (object) && (rlv_handler_t::isEnabled()) &&
( ((gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH))) && (!gRlvHandler.canTouch(object, pick.mObjectOffset)) ||
((gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) && (!object->isHUDAttachment())) ) )
{
gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
return TRUE;
}
// [/RLVa:KB]
if (object)
{
parent = object->getRootEdit();
if (object && useClickAction(FALSE, mask, object, parent))
{
ECursorType cursor = cursor_from_object(object);
gViewerWindow->getWindow()->setCursor(cursor);
}
else if (handle_media_hover(gViewerWindow->getHoverPick()))
{
// cursor set by media object
}
// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Added: RLVa-1.1.0l
else if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(object)) )
{
// Block showing the "grab" or "touch" cursor if we can't touch the object (@fartouch=n is handled above)
gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
}
// [/RLVa:KB]
else if ((object && !object->isAvatar() && object->usePhysics())
|| (parent && !parent->isAvatar() && parent->usePhysics()))
{
gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLGRAB);
}
else if ( (object && object->flagHandleTouch())
|| (parent && parent->flagHandleTouch()))
{
gViewerWindow->getWindow()->setCursor(UI_CURSOR_HAND);
}
else
{
gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
}
}
else
{
gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
// We need to clear media hover flag
if (LLViewerMediaFocus::getInstance()->getMouseOverFlag())
{
LLViewerMediaFocus::getInstance()->setMouseOverFlag(false);
}
}
return TRUE;
}
示例7: pickAndShowMenu
// True if you selected an object.
BOOL LLToolPie::pickAndShowMenu(BOOL always_show)
{
S32 x = mPick.mMousePt.mX;
S32 y = mPick.mMousePt.mY;
MASK mask = mPick.mKeyMask;
if (!always_show && mPick.mPickType == LLPickInfo::PICK_PARCEL_WALL)
{
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getCollisionParcel();
if (parcel)
{
LLViewerParcelMgr::getInstance()->selectCollisionParcel();
if (parcel->getParcelFlag(PF_USE_PASS_LIST)
&& !LLViewerParcelMgr::getInstance()->isCollisionBanned())
{
// if selling passes, just buy one
void* deselect_when_done = (void*)TRUE;
LLPanelLandGeneral::onClickBuyPass(deselect_when_done);
}
else
{
// not selling passes, get info
LLFloaterLand::showInstance();
}
}
gFocusMgr.setKeyboardFocus(NULL);
return LLTool::handleMouseDown(x, y, mask);
}
// didn't click in any UI object, so must have clicked in the world
LLViewerObject *object = mPick.getObject();
LLViewerObject *parent = NULL;
if (mPick.mPickType != LLPickInfo::PICK_LAND)
{
if (!LLFloaterLand::isOpen())
{
LLViewerParcelMgr::getInstance()->deselectLand();
}
}
if (object)
{
parent = object->getRootEdit();
}
BOOL touchable = (object && object->flagHandleTouch())
|| (parent && parent->flagHandleTouch());
// If it's a left-click, and we have a special action, do it.
if (useClickAction(always_show, mask, object, parent))
{
// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l
// Block left-click special actions when fartouch restricted
if ( (rlv_handler_t::isEnabled()) &&
(gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (!gRlvHandler.canTouch(object, mPick.mObjectOffset)) )
{
return TRUE;
}
// [/RLVa:KB]
mClickAction = 0;
if (object && object->getClickAction())
{
mClickAction = object->getClickAction();
}
else if (parent && parent->getClickAction())
{
mClickAction = parent->getClickAction();
}
switch(mClickAction)
{
case CLICK_ACTION_TOUCH:
// touch behavior down below...
break;
case CLICK_ACTION_SIT:
if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting) && !gSavedSettings.getBOOL("EmeraldBlockClickSit")) // agent not already sitting
{
handle_sit_or_stand();
// put focus in world when sitting on an object
gFocusMgr.setKeyboardFocus(NULL);
return TRUE;
} // else nothing (fall through to touch)
case CLICK_ACTION_PAY:
if ((object && object->flagTakesMoney())
|| (parent && parent->flagTakesMoney()))
{
// pay event goes to object actually clicked on
mClickActionObject = object;
mLeftClickSelection = LLToolSelect::handleObjectSelection(mPick, FALSE, TRUE);
if (LLSelectMgr::getInstance()->selectGetAllValid())
{
// call this right away, since we have all the info we need to continue the action
selectionPropertiesReceived();
}
return TRUE;
}
//.........这里部分代码省略.........
示例8: handleHover
BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
{
mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE);
// perform a separate pick that detects transparent objects since they respond to 1-click actions
LLPickInfo click_action_pick = gViewerWindow->pickImmediate(x, y, TRUE);
// Show screen-space highlight glow effect
bool show_highlight = false;
LLViewerObject *parent = NULL;
LLViewerObject *object = mHoverPick.getObject();
if (object)
{
parent = object->getRootEdit();
}
LLViewerObject* click_action_object = click_action_pick.getObject();
if (handleMediaHover(mHoverPick))
{
// *NOTE: If you think the hover glow conflicts with the media outline, you
// could disable it here.
show_highlight = true;
// cursor set by media object
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
}
else if (click_action_object && useClickAction(mask, click_action_object, click_action_object->getRootEdit()))
{
show_highlight = true;
ECursorType cursor = cursor_from_object(click_action_object);
gViewerWindow->setCursor(cursor);
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
}
else if ((object && !object->isAvatar() && object->usePhysics())
|| (parent && !parent->isAvatar() && parent->usePhysics()))
{
show_highlight = true;
gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB);
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
}
else if ( (object && object->flagHandleTouch())
|| (parent && parent->flagHandleTouch()))
{
show_highlight = true;
gViewerWindow->setCursor(UI_CURSOR_HAND);
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
}
else
{
gViewerWindow->setCursor(UI_CURSOR_ARROW);
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
if(!object)
{
LLViewerMediaFocus::getInstance()->clearHover();
}
}
static LLCachedControl<bool> enable_highlight(
gSavedSettings, "RenderHoverGlowEnable", false);
LLDrawable* drawable = NULL;
if (enable_highlight && show_highlight && object)
{
drawable = object->mDrawable;
}
gPipeline.setHighlightObject(drawable);
return TRUE;
}
示例9: pickLeftMouseDownCallback
//.........这里部分代码省略.........
return TRUE;
case CLICK_ACTION_ZOOM:
{
const F32 PADDING_FACTOR = 2.f;
LLViewerObject* object = gObjectList.findObject(mPick.mObjectID);
if (object)
{
gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
LLBBox bbox = object->getBoundingBoxAgent() ;
F32 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getAspect() > 1.f ? LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect() : LLViewerCamera::getInstance()->getView());
F32 distance = bbox.getExtentLocal().magVec() * PADDING_FACTOR / atan(angle_of_view);
LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - bbox.getCenterAgent();
obj_to_cam.normVec();
LLVector3d object_center_global = gAgent.getPosGlobalFromAgent(bbox.getCenterAgent());
gAgentCamera.setCameraPosAndFocusGlobal(object_center_global + LLVector3d(obj_to_cam * distance),
object_center_global,
mPick.mObjectID );
}
}
return TRUE;
default:
// nothing
break;
}
}
// put focus back "in world"
gFocusMgr.setKeyboardFocus(NULL);
BOOL touchable = (object && object->flagHandleTouch())
|| (parent && parent->flagHandleTouch());
// Switch to grab tool if physical or triggerable
if (object &&
!object->isAvatar() &&
((object->usePhysics() || (parent && !parent->isAvatar() && parent->usePhysics())) || touchable)
)
{
gGrabTransientTool = this;
LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() );
return LLToolGrab::getInstance()->handleObjectHit( mPick );
}
LLHUDIcon* last_hit_hud_icon = mPick.mHUDIcon;
if (!object && last_hit_hud_icon && last_hit_hud_icon->getSourceObject())
{
LLFloaterScriptDebug::show(last_hit_hud_icon->getSourceObject()->getID());
}
// If left-click never selects or spawns a menu
// Eat the event.
if (!gSavedSettings.getBOOL("LeftClickShowMenu"))
{
// mouse already released
if (!mGrabMouseButtonDown)
{
return TRUE;
}
while( object && object->isAttachment() && !object->flagHandleTouch())
{
// don't pick avatar through hud attachment
示例10: handleObjectHit
BOOL LLToolGrab::handleObjectHit(const LLPickInfo& info)
{
mGrabPick = info;
LLViewerObject* objectp = mGrabPick.getObject();
if (gDebugClicks)
{
llinfos << "LLToolGrab handleObjectHit " << info.mMousePt.mX << "," << info.mMousePt.mY << llendl;
}
if (NULL == objectp) // unexpected
{
llwarns << "objectp was NULL; returning FALSE" << llendl;
return FALSE;
}
//if (objectp->isAvatar())
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f
if ( (objectp->isAvatar()) ||
( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!objectp->isAttachment()) || (!objectp->permYouOwner())) &&
(dist_vec_squared(gAgent.getPositionAgent(), mGrabPick.mIntersection) > 1.5f * 1.5f) ) )
// [/RLVa:KB]
{
if (gGrabTransientTool)
{
gBasicToolset->selectTool( gGrabTransientTool );
gGrabTransientTool = NULL;
}
return TRUE;
}
setMouseCapture( TRUE );
// Grabs always start from the root
// objectp = (LLViewerObject *)objectp->getRoot();
LLViewerObject* parent = objectp->getRootEdit();
BOOL script_touch = (objectp->flagHandleTouch()) || (parent && parent->flagHandleTouch());
// Clicks on scripted or physical objects are temporary grabs, so
// not "Build mode"
mHideBuildHighlight = script_touch || objectp->usePhysics();
if (!objectp->usePhysics())
{
// In mouselook, we shouldn't be able to grab non-physical,
// non-touchable objects. If it has a touch handler, we
// do grab it (so llDetectedGrab works), but movement is
// blocked on the server side. JC
if (gAgent.cameraMouselook() && !script_touch)
{
mMode = GRAB_LOCKED;
gViewerWindow->hideCursor();
gViewerWindow->moveCursorToCenter();
}
else
{
mMode = GRAB_NONPHYSICAL;
}
// Don't bail out here, go on and grab so buttons can get
// their "touched" event.
}
else if( !objectp->permMove() )
{
// if mouse is over a physical object without move permission, show feedback if user tries to move it.
mMode = GRAB_LOCKED;
// Don't bail out here, go on and grab so buttons can get
// their "touched" event.
}
else
{
// if mouse is over a physical object with move permission,
// select it and enter "grab" mode (hiding cursor, etc.)
mMode = GRAB_ACTIVE_CENTER;
gViewerWindow->hideCursor();
gViewerWindow->moveCursorToCenter();
}
// Always send "touched" message
mLastMouseX = gViewerWindow->getCurrentMouseX();
mLastMouseY = gViewerWindow->getCurrentMouseY();
mAccumDeltaX = 0;
mAccumDeltaY = 0;
mHasMoved = FALSE;
mOutsideSlop = FALSE;
mVerticalDragging = (info.mKeyMask == MASK_VERTICAL) || gGrabBtnVertical;
startGrab();
if ((info.mKeyMask == MASK_SPIN) || gGrabBtnSpin)
{
startSpin();
}
LLSelectMgr::getInstance()->updateSelectionCenter(); // update selection beam
//.........这里部分代码省略.........
示例11: handleDoubleClick
BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
{
if (gDebugClicks)
{
llinfos << "LLToolPie handleDoubleClick (becoming mouseDown)" << llendl;
}
if (gSavedSettings.getBOOL("DoubleClickAutoPilot") || gSavedSettings.getBOOL("DoubleClickTeleport"))
{
if (mPick.mPickType == LLPickInfo::PICK_LAND
&& !mPick.mPosGlobal.isExactlyZero())
{
handle_go_to();
return TRUE;
}
else if (mPick.mObjectID.notNull()
&& !mPick.mPosGlobal.isExactlyZero())
{
// Hit an object
// Do not go to attachments...
if (mPick.getObject() && !mPick.getObject()->isHUDAttachment())
{
// HACK: Call the last hit position the point we hit on the object
//gLastHitPosGlobal += gLastHitObjectOffset;
handle_go_to();
return TRUE;
}
}
} else
/* code added to support double click teleports */
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());
bool has_click_action = final_click_action(objp);
if (pos_non_zero && (is_land || (is_in_world && !has_touch_handler && !has_click_action)))
{
LLVector3d pos = mPick.mPosGlobal;
pos.mdV[VZ] += gAgentAvatarp->getPelvisToFoot();
gAgent.teleportViaLocationLookAt(pos);
return TRUE;
}
}
return FALSE;
/* JC - don't do go-there, because then double-clicking on physical
objects gets you into trouble.
// If double-click on object or land, go there.
LLViewerObject *object = gViewerWindow->getLastPick().getObject();
if (object)
{
if (object->isAvatar())
{
LLFloaterAvatarInfo::showFromAvatar(object->getID());
}
else
{
handle_go_to(NULL);
}
}
else if (!gLastHitPosGlobal.isExactlyZero())
{
handle_go_to(NULL);
}
return TRUE;
*/
}
示例12: updateText
//.........这里部分代码省略.........
else
{
line.append(LLTrans::getString("RetrievingData"));
}
}
else
{
std::string name;
owner = nodep->mPermissions->getGroup();
if (gCacheName->getGroupName(owner, name))
{
line.append(name);
line.append(LLTrans::getString("TooltipIsGroup"));
}
else
{
line.append(LLTrans::getString("RetrievingData"));
}
}
}
else
{
line.append(LLTrans::getString("RetrievingData"));
}
mText.push_back(line);
// Build a line describing any special properties of this object.
LLViewerObject *object = hit_object;
LLViewerObject *parent = (LLViewerObject *)object->getParent();
if (object &&
(object->usePhysics() ||
object->flagScripted() ||
object->flagHandleTouch() || (parent && parent->flagHandleTouch()) ||
object->flagTakesMoney() || (parent && parent->flagTakesMoney()) ||
object->flagAllowInventoryAdd() ||
object->flagTemporary() ||
object->flagPhantom()) )
{
line.clear();
if (object->flagScripted())
{
line.append(LLTrans::getString("TooltipFlagScript") + " ");
}
if (object->usePhysics())
{
line.append(LLTrans::getString("TooltipFlagPhysics") + " ");
}
if (object->flagHandleTouch() || (parent && parent->flagHandleTouch()) )
{
line.append(LLTrans::getString("TooltipFlagTouch") + " ");
suppressObjectHoverDisplay = FALSE; // Show tip
}
if (object->flagTakesMoney() || (parent && parent->flagTakesMoney()) )
{
line.append(LLTrans::getString("TooltipFlagL$") + " ");
suppressObjectHoverDisplay = FALSE; // Show tip
}
if (object->flagAllowInventoryAdd())
{
line.append(LLTrans::getString("TooltipFlagDropInventory") + " ");
示例13: updateText
//.........这里部分代码省略.........
retrieving_data = true;
}
}
else
{
std::string name;
owner = nodep->mPermissions->getGroup();
if (gCacheName->getGroupName(owner, name))
{
line.append(name);
line.append(LLTrans::getString("TooltipIsGroup"));
}
else
{
line.append(LLTrans::getString("RetrievingData"));
retrieving_data = true;
}
}
}
else
{
line.append(LLTrans::getString("RetrievingData"));
retrieving_data = true;
}
mText.push_back(line);
// Build a line describing any special properties of this object.
LLViewerObject *object = hit_object;
LLViewerObject *parent = (LLViewerObject *)object->getParent();
if (object &&
(object->flagUsePhysics() ||
object->flagScripted() ||
object->flagHandleTouch() || (parent && parent->flagHandleTouch()) ||
object->flagTakesMoney() || (parent && parent->flagTakesMoney()) ||
object->flagAllowInventoryAdd() ||
object->flagTemporary() ||
object->flagPhantom()) )
{
line.clear();
if (object->flagScripted())
{
line.append(LLTrans::getString("TooltipFlagScript") + " ");
}
if (object->flagUsePhysics())
{
line.append(LLTrans::getString("TooltipFlagPhysics") + " ");
}
if (object->flagHandleTouch() || (parent && parent->flagHandleTouch()) )
{
line.append(LLTrans::getString("TooltipFlagTouch") + " ");
suppressObjectHoverDisplay = FALSE; // Show tip
}
if (object->flagTakesMoney() || (parent && parent->flagTakesMoney()) )
{
line.append(gHippoGridManager->getConnectedGrid()->getCurrencySymbol() + " ");
suppressObjectHoverDisplay = FALSE; // Show tip
}
if (object->flagAllowInventoryAdd())
{
line.append(LLTrans::getString("TooltipFlagDropInventory") + " ");
示例14: handleDoubleClick
BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
{
if (gDebugClicks)
{
llinfos << "LLToolPie handleDoubleClick (becoming mouseDown)" << llendl;
}
LLViewerObject *object = mPick.getObject();
if(object)
{
//Zwagoth: No more teleport to HUD attachments. >:o
if (object->isHUDAttachment())
{
LL_DEBUGS("DoubleClicks") << "Double clicked HUD" << LL_ENDL;
return FALSE;
}
//Armin: No more teleport to other attachments or Avatars including self ...
if (object->isAttachment())
{
LL_DEBUGS("DoubleClicks") << "Double clicked attachment (not HUD)" << LL_ENDL;
return FALSE;
}
if (object->isAvatar()&& object == gAgent.getAvatarObject() )
{
LL_DEBUGS("DoubleClicks") << "Double clicked self" << LL_ENDL;
return FALSE;
}
if (object->isAvatar())
{
LL_DEBUGS("DoubleClicks") << "Double clicked other Avatar" << LL_ENDL;
return FALSE;// or what about open profile or IM session or ...
}
if (final_click_action(object))
{
LL_DEBUGS("DoubleClicks") << "Double clicked an object with a click action" << LL_ENDL;
return FALSE;
}
LLViewerObject* parent = object->getRootEdit();
if (object->flagHandleTouch() || (parent && parent->flagHandleTouch()))
{
LL_DEBUGS("DoubleClicks") << "Double clicked a touch-scripted object" << LL_ENDL;
return FALSE;
}
const LLTextureEntry* tep = object->getTE(mPick.mObjectFace);
viewer_media_t media_impl = tep ? LLViewerMedia::getMediaImplFromTextureID(tep->getID()) : NULL;
if (media_impl.notNull() && media_impl->hasMedia())
{
LL_DEBUGS("DoubleClicks") << "Double clicked running parcel media" << LL_ENDL;
return FALSE;
}
}
std::string action = gSavedSettings.getString("DoubleClickAction");
LLStringUtil::toLower(action);
if (action == "none")
{
return FALSE;
}
else if (action == "go")
{
if (mPick.mPickType == LLPickInfo::PICK_LAND
&& !mPick.mPosGlobal.isExactlyZero())
{
handle_go_to_confirm();
return TRUE;
}
else if (mPick.mObjectID.notNull()
&& !mPick.mPosGlobal.isExactlyZero())
{
handle_go_to_confirm();
return TRUE;
}
}
else
{
llwarns << "Unhandled DoubleClickAction setting: " << action << llendl;
}
return FALSE;
}
示例15: handleHover
BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
{
/*
// If auto-rotate occurs, tag mouse-outside-slop to make sure the drag
// gets started.
const S32 ROTATE_H_MARGIN = (S32) (0.1f * gViewerWindow->getWindowWidth() );
const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD;
const F32 rotate_angle = ROTATE_ANGLE_PER_SECOND / gFPSClamped;
// ...normal modes can only yaw
if (x < ROTATE_H_MARGIN)
{
gAgent.yaw(rotate_angle);
mMouseOutsideSlop = TRUE;
}
else if (x > gViewerWindow->getWindowWidth() - ROTATE_H_MARGIN)
{
gAgent.yaw(-rotate_angle);
mMouseOutsideSlop = TRUE;
}
*/
gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
LLViewerObject *object = NULL;
LLViewerObject *parent = NULL;
object = gViewerWindow->getHoverPick().getObject();
if (object)
{
parent = object->getRootEdit();
if (object && useClickAction(FALSE, mask, object, parent))
{
ECursorType cursor = cursor_from_object(object);
gViewerWindow->getWindow()->setCursor(cursor);
}
else if (handle_media_hover(gViewerWindow->getHoverPick()))
{
// cursor set by media object
}
else if ((object && !object->isAvatar() && object->usePhysics())
|| (parent && !parent->isAvatar() && parent->usePhysics()))
{
gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLGRAB);
}
else if ( (object && object->flagHandleTouch())
|| (parent && parent->flagHandleTouch()))
{
gViewerWindow->getWindow()->setCursor(UI_CURSOR_HAND);
}
}
else
{
// We need to clear media hover flag
if (LLViewerMediaFocus::getInstance()->getMouseOverFlag())
{
LLViewerMediaFocus::getInstance()->setMouseOverFlag(false);
}
}
return TRUE;
}