本文整理汇总了C++中LLViewerObject::allowOpen方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerObject::allowOpen方法的具体用法?C++ LLViewerObject::allowOpen怎么用?C++ LLViewerObject::allowOpen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerObject
的用法示例。
在下文中一共展示了LLViewerObject::allowOpen方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cursor_from_object
ECursorType cursor_from_object(LLViewerObject* object)
{
LLViewerObject* parent = NULL;
if (object)
{
parent = object->getRootEdit();
}
U8 click_action = final_click_action(object);
ECursorType cursor = UI_CURSOR_ARROW;
switch(click_action)
{
case CLICK_ACTION_SIT:
{
if (isAgentAvatarValid() && !gAgentAvatarp->isSitting()) // not already sitting?
{
cursor = UI_CURSOR_TOOLSIT;
}
}
break;
case CLICK_ACTION_BUY:
cursor = UI_CURSOR_TOOLBUY;
break;
case CLICK_ACTION_OPEN:
// Open always opens the parent.
if (parent && parent->allowOpen())
{
cursor = UI_CURSOR_TOOLOPEN;
}
break;
case CLICK_ACTION_PAY:
if ((object && object->flagTakesMoney())
|| (parent && parent->flagTakesMoney()))
{
cursor = UI_CURSOR_TOOLBUY;
}
break;
case CLICK_ACTION_ZOOM:
cursor = UI_CURSOR_TOOLZOOMIN;
break;
case CLICK_ACTION_PLAY:
case CLICK_ACTION_OPEN_MEDIA:
cursor = cursor_from_parcel_media(click_action);
break;
default:
break;
}
return cursor;
}
示例2: cursor_from_object
ECursorType cursor_from_object(LLViewerObject* object)
{
LLViewerObject* parent = NULL;
if (object)
{
parent = object->getRootEdit();
}
U8 click_action = final_click_action(object);
ECursorType cursor = UI_CURSOR_ARROW;
switch(click_action)
{
case CLICK_ACTION_SIT:
// if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting)) // not already sitting?
// [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Added: RLVa-1.1.0j
if ( ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting)) && // not already sitting?
((!rlv_handler_t::isEnabled()) || (gRlvHandler.canSit(object, gViewerWindow->getHoverPick().mObjectOffset))) )
// [/RLVa:KB]
{
cursor = UI_CURSOR_TOOLSIT;
}
break;
case CLICK_ACTION_BUY:
cursor = UI_CURSOR_TOOLBUY;
break;
case CLICK_ACTION_OPEN:
// Open always opens the parent.
if (parent && parent->allowOpen())
{
cursor = UI_CURSOR_TOOLOPEN;
}
break;
case CLICK_ACTION_PAY:
if ((object && object->flagTakesMoney())
|| (parent && parent->flagTakesMoney()))
{
cursor = UI_CURSOR_TOOLPAY;
}
break;
case CLICK_ACTION_PLAY:
case CLICK_ACTION_OPEN_MEDIA:
cursor = cursor_from_parcel_media(click_action);
break;
default:
break;
}
return cursor;
}
示例3: pickAndShowMenu
//.........这里部分代码省略.........
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;
}
break;
case CLICK_ACTION_BUY:
mClickActionObject = parent;
mLeftClickSelection = LLToolSelect::handleObjectSelection(mPick, FALSE, TRUE, TRUE);
if (LLSelectMgr::getInstance()->selectGetAllValid())
{
// call this right away, since we have all the info we need to continue the action
selectionPropertiesReceived();
}
return TRUE;
case CLICK_ACTION_OPEN:
if (parent && parent->allowOpen())
{
mClickActionObject = parent;
mLeftClickSelection = LLToolSelect::handleObjectSelection(mPick, FALSE, TRUE, TRUE);
if (LLSelectMgr::getInstance()->selectGetAllValid())
{
// call this right away, since we have all the info we need to continue the action
selectionPropertiesReceived();
}
}
return TRUE;
case CLICK_ACTION_PLAY:
handle_click_action_play();
return TRUE;
case CLICK_ACTION_OPEN_MEDIA:
// mClickActionObject = object;
handle_click_action_open_media(object);
return TRUE;
default:
// nothing
break;
}
}
if (!always_show && handle_media_click(mPick))
{
return FALSE;
}
// put focus back "in world"
gFocusMgr.setKeyboardFocus(NULL);
// Switch to grab tool if physical or triggerable
示例4: pickLeftMouseDownCallback
//.........这里部分代码省略.........
if (isAgentAvatarValid() && !gAgentAvatarp->isSitting()) // agent not already sitting
{
handle_object_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;
}
break;
case CLICK_ACTION_BUY:
mClickActionObject = parent;
mLeftClickSelection = LLToolSelect::handleObjectSelection(mPick, FALSE, TRUE, TRUE);
if (LLSelectMgr::getInstance()->selectGetAllValid())
{
// call this right away, since we have all the info we need to continue the action
selectionPropertiesReceived();
}
return TRUE;
case CLICK_ACTION_OPEN:
if (parent && parent->allowOpen())
{
mClickActionObject = parent;
mLeftClickSelection = LLToolSelect::handleObjectSelection(mPick, FALSE, TRUE, TRUE);
if (LLSelectMgr::getInstance()->selectGetAllValid())
{
// call this right away, since we have all the info we need to continue the action
selectionPropertiesReceived();
}
}
return TRUE;
case CLICK_ACTION_PLAY:
handle_click_action_play();
return TRUE;
case CLICK_ACTION_OPEN_MEDIA:
// mClickActionObject = object;
handle_click_action_open_media(object);
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();
示例5: pickAndShowMenu
//.........这里部分代码省略.........
if(!gSavedSettings.getBOOL("DisableClickSit"))
// </edit>
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;
}
break;
case CLICK_ACTION_BUY:
mClickActionObject = parent;
mLeftClickSelection = LLToolSelect::handleObjectSelection(mPick, FALSE, TRUE, TRUE);
if (LLSelectMgr::getInstance()->selectGetAllValid())
{
// call this right away, since we have all the info we need to continue the action
selectionPropertiesReceived();
}
return TRUE;
case CLICK_ACTION_OPEN:
if (parent && parent->allowOpen())
{
mClickActionObject = parent;
mLeftClickSelection = LLToolSelect::handleObjectSelection(mPick, FALSE, TRUE, TRUE);
if (LLSelectMgr::getInstance()->selectGetAllValid())
{
// call this right away, since we have all the info we need to continue the action
selectionPropertiesReceived();
}
}
return TRUE;
case CLICK_ACTION_PLAY:
handle_click_action_play();
return TRUE;
case CLICK_ACTION_OPEN_MEDIA:
// mClickActionObject = object;
handle_click_action_open_media(object);
return TRUE;
default:
// nothing
break;
}
}
if (!always_show && handle_media_click(mPick))
{
return FALSE;
}
// put focus back "in world"
gFocusMgr.setKeyboardFocus(NULL);
// Switch to grab tool if physical or triggerable