本文整理汇总了C++中LLObjectSelectionHandle类的典型用法代码示例。如果您正苦于以下问题:C++ LLObjectSelectionHandle类的具体用法?C++ LLObjectSelectionHandle怎么用?C++ LLObjectSelectionHandle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLObjectSelectionHandle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: start
BOOL LLFloaterScriptQueue::start()
{
//llinfos << "LLFloaterCompileQueue::start()" << llendl;
std::string buffer;
LLSelectMgr *mgr = LLSelectMgr::getInstance();
LLObjectSelectionHandle selectHandle = mgr->getSelection();
U32 n_objects = 0;
if (gSavedSettings.getBOOL("EditLinkedParts"))
{
n_objects = selectHandle->getObjectCount();
}
else
{
n_objects = selectHandle->getRootObjectCount();
}
LLStringUtil::format_map_t args;
args["[START]"] = mStartString;
args["[COUNT]"] = llformat ("%d", mObjectIDs.count());
buffer = getString ("Starting", args);
getChild<LLScrollListCtrl>("queue output")->setCommentText(buffer);
return nextObject();
}
示例2: get_selection_axis_aligned_bbox
void QToolAlign::render()
{
mBBox = get_selection_axis_aligned_bbox();
// Draw bounding box
LLGLSUIDefault gls_ui;
LLGLEnable gl_blend(GL_BLEND);
LLGLEnable gls_alpha_test(GL_ALPHA_TEST);
LLGLDepthTest gls_depth(GL_FALSE);
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
// render box
LLColor4 default_normal_color( 0.7f, 0.7f, 0.7f, 0.1f );
gGL.color4fv( default_normal_color.mV );
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getEditSelection();
BOOL can_move = selection->getObjectCount() != 0;
if (can_move)
{
struct f : public LLSelectedObjectFunctor
{
virtual bool apply(LLViewerObject* objectp)
{
return objectp->permMove() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
}
} func;
can_move = selection->applyToObjects(&func);
}
if (can_move)
{
render_bbox(mBBox);
renderManipulators();
}
}
示例3: onClickJellyRoll
void LLFloaterTexturePicker::onClickJellyRoll(void* userdata)
{
std::string hover_text;
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
LLObjectSelection::valid_iterator sel_it = selection->valid_begin();
LLObjectSelection::valid_iterator sel_end = selection->valid_end();
for( ; sel_it != sel_end; ++sel_it)
{
LLViewerObject* objectp = (*sel_it)->getObject();
hover_text = objectp->getDebugText();
if(hover_text != "")
{
break;
}
}
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
// LLScrollListCtrl* list = floater->getChild<LLScrollListCtrl>("anim_list");
LLUUID asset_id = self->mImageAssetID;
LLFloaterNewLocalInventory* createy = new LLFloaterNewLocalInventory();
createy->childSetText("name_line", hover_text);
createy->childSetText("asset_id_line", asset_id.asString());
createy->childSetValue("type_combo", "animatn");
createy->childSetText("creator_id_line", LLFloaterNewLocalInventory::sLastCreatorId.asString());
}
示例4: handle_media_click
static bool handle_media_click(const LLPickInfo& pick)
{
//FIXME: how do we handle object in different parcel than us?
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
LLPointer<LLViewerObject> objectp = pick.getObject();
if (!parcel ||
objectp.isNull() ||
pick.mObjectFace < 0 ||
pick.mObjectFace >= objectp->getNumTEs())
{
LLSelectMgr::getInstance()->deselect();
LLViewerMediaFocus::getInstance()->clearFocus();
return false;
}
// HACK: This is directly referencing an impl name. BAD!
// This can be removed when we have a truly generic media browser that only
// builds an impl based on the type of url it is passed.
// is media playing on this face?
const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace);
viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(tep->getID());
if (tep
&& media_impl.notNull()
&& media_impl->hasMedia()
&& gSavedSettings.getBOOL("MediaOnAPrimUI"))
{
LLObjectSelectionHandle selection = LLViewerMediaFocus::getInstance()->getSelection();
if (! selection->contains(pick.getObject(), pick.mObjectFace))
{
LLViewerMediaFocus::getInstance()->setFocusFace(TRUE, pick.getObject(), pick.mObjectFace, media_impl);
}
else
{
media_impl->mouseDown(pick.mXYCoords.mX, pick.mXYCoords.mY);
media_impl->mouseCapture(); // the mouse-up will happen when capture is lost
}
return true;
}
LLSelectMgr::getInstance()->deselect();
LLViewerMediaFocus::getInstance()->clearFocus();
return false;
}
示例5: rlvCanDeleteOrReturn
// Checked: 2011-05-28 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a
bool rlvCanDeleteOrReturn()
{
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) )
{
struct RlvCanDeleteOrReturn : public LLSelectedObjectFunctor
{
/*virtual*/ bool apply(LLViewerObject* pObj) { return pObj->isReturnable(); }
} f;
LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection();
return (hSel.notNull()) && (0 != hSel->getRootObjectCount()) && (hSel->applyToRootObjects(&f, false));
}
return true;
}
示例6: show
// static
void LLFloaterBuyContents::show(const LLSaleInfo& sale_info)
{
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
if (selection->getRootObjectCount() != 1)
{
LLNotificationsUtil::add("BuyContentsOneOnly");
return;
}
LLFloaterBuyContents* floater = LLFloaterReg::showTypedInstance<LLFloaterBuyContents>("buy_object_contents");
if (!floater)
return;
LLScrollListCtrl* list = floater->getChild<LLScrollListCtrl>("item_list");
if (list)
list->deleteAllItems();
floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
LLUUID owner_id;
std::string owner_name;
BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
if (!owners_identical)
{
LLNotificationsUtil::add("BuyContentsOneOwner");
return;
}
floater->mSaleInfo = sale_info;
// Update the display
LLSelectNode* node = selection->getFirstRootNode();
if (!node) return;
if(node->mPermissions->isGroupOwned())
{
gCacheName->getGroupName(owner_id, owner_name);
}
floater->getChild<LLUICtrl>("contains_text")->setTextArg("[NAME]", node->mName);
floater->getChild<LLUICtrl>("buy_text")->setTextArg("[AMOUNT]", llformat("%d", sale_info.getSalePrice()));
floater->getChild<LLUICtrl>("buy_text")->setTextArg("[NAME]", owner_name);
std::string type_currency = LLGridManager::getInstance()->getCurrency();
floater->getChild<LLUICtrl>("buy_text")->setTextArg("[CUR]", type_currency);
// Must do this after the floater is created, because
// sometimes the inventory is already there and
// the callback is called immediately.
LLViewerObject* obj = selection->getFirstRootObject();
floater->registerVOInventoryListener(obj,NULL);
floater->requestVOInventory();
}
示例7: exportSelection
void FSExport::exportSelection()
{
LLObjectSelectionHandle selection = LLSelectMgr::instance().getSelection();
LLObjectSelection::valid_root_iterator iter = selection->valid_root_begin();
LLSelectNode* node = *iter;
LLFilePicker& file_picker = LLFilePicker::instance();
if(!file_picker.getSaveFile(LLFilePicker::FFSAVE_EXPORT, LLDir::getScrubbedFileName(node->mName + ".oxp")))
{
return;
}
mFileName = file_picker.getFirstFile();
mFilePath = gDirUtilp->getDirName(mFileName);
mFile.clear();
mRequestedTexture.clear();
mExported = false;
mAborted = false;
mInventoryRequests.clear();
mAssetRequests.clear();
mTextureChecked.clear();
mFile["format_version"] = 1;
mFile["client"] = LLAppViewer::instance()->getSecondLifeTitle() + LLVersionInfo::getChannel();
mFile["client_version"] = LLVersionInfo::getVersion();
mFile["grid"] = LLGridManager::getInstance()->getGridLabel();
for ( ; iter != selection->valid_root_end(); ++iter)
{
mFile["linkset"].append(getLinkSet((*iter)));
}
if (mExported && !mAborted)
{
mWaitTimer.start();
mLastRequest = mInventoryRequests.size();
mExportState = INVENTORY_DOWNLOAD;
gIdleCallbacks.addFunction(onIdle, this);
}
else
{
LL_WARNS("export") << "Nothing was exported. File not created." << LL_ENDL;
}
}
示例8: showFloaterWithSelectionObjects
void LLFloaterPathfindingObjects::showFloaterWithSelectionObjects()
{
mObjectsToBeSelected.clear();
LLObjectSelectionHandle selectedObjectsHandle = LLSelectMgr::getInstance()->getSelection();
if (selectedObjectsHandle.notNull())
{
LLObjectSelection *selectedObjects = selectedObjectsHandle.get();
if (!selectedObjects->isEmpty())
{
for (LLObjectSelection::valid_iterator objectIter = selectedObjects->valid_begin();
objectIter != selectedObjects->valid_end(); ++objectIter)
{
LLSelectNode *object = *objectIter;
LLViewerObject *viewerObject = object->getObject();
mObjectsToBeSelected.push_back(viewerObject->getID());
}
}
}
mHasObjectsToBeSelected = true;
if (!getVisible())
{
open();
setVisibleAndFrontmost();
}
else
{
rebuildObjectsScrollList();
if (isMinimized())
{
setMinimized(FALSE);
}
setVisibleAndFrontmost();
}
setFocus(TRUE);
}
示例9: start
BOOL LLFloaterScriptQueue::start()
{
//llinfos << "LLFloaterCompileQueue::start()" << llendl;
std::string buffer;
LLSelectMgr *mgr = LLSelectMgr::getInstance();
LLObjectSelectionHandle selectHandle = mgr->getSelection();
U32 n_objects = 0;
if (gSavedSettings.getBOOL("EditLinkedParts"))
{
n_objects = selectHandle->getObjectCount();
}
else
{
n_objects = selectHandle->getRootObjectCount();
}
buffer = llformat("Starting %s of %d items.", mStartString.c_str(), n_objects); // *TODO: Translate
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
list->addCommentText(buffer);
return nextObject();
}
示例10: rlvCanDeleteOrReturn
// Checked: 2010-04-11 (RLVa-1.2.0b) | Modified: RLVa-0.2.0g
bool rlvCanDeleteOrReturn()
{
bool fIsAllowed = true;
if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ))
{
// We'll allow if none of the prims are owned by the avie or group owned
LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection();
RlvSelectIsOwnedByOrGroupOwned f(gAgent.getID());
if ( (handleSel.notNull()) && ((0 == handleSel->getRootObjectCount()) || (NULL != handleSel->getFirstRootNode(&f, FALSE))) )
fIsAllowed = false;
}
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) )
{
// We'll allow if the avie isn't sitting on any of the selected objects
LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection();
RlvSelectIsSittingOn f(gAgent.getAvatarObject()->getRoot());
if ( (handleSel.notNull()) && (handleSel->getFirstRootNode(&f, TRUE)) )
fIsAllowed = false;
}
return fIsAllowed;
}
示例11: pickCallback
void LLToolCamera::pickCallback(const LLPickInfo& pick_info)
{
if (!LLToolCamera::getInstance()->hasMouseCapture())
{
return;
}
LLToolCamera::getInstance()->mMouseDownX = pick_info.mMousePt.mX;
LLToolCamera::getInstance()->mMouseDownY = pick_info.mMousePt.mY;
gViewerWindow->moveCursorToCenter();
// Potentially recenter if click outside rectangle
LLViewerObject* hit_obj = pick_info.getObject();
// Check for hit the sky, or some other invalid point
if (!hit_obj && pick_info.mPosGlobal.isExactlyZero())
{
LLToolCamera::getInstance()->mValidClickPoint = FALSE;
return;
}
// check for hud attachments
if (hit_obj && hit_obj->isHUDAttachment())
{
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
if (!selection->getObjectCount() || selection->getSelectType() != SELECT_TYPE_HUD)
{
LLToolCamera::getInstance()->mValidClickPoint = FALSE;
return;
}
}
if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgent.getCameraMode() )
{
BOOL good_customize_avatar_hit = FALSE;
if( hit_obj )
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
if( hit_obj == avatar)
{
// It's you
good_customize_avatar_hit = TRUE;
}
else
if( hit_obj->isAttachment() && hit_obj->permYouOwner() )
{
// It's an attachment that you're wearing
good_customize_avatar_hit = TRUE;
}
}
if( !good_customize_avatar_hit )
{
LLToolCamera::getInstance()->mValidClickPoint = FALSE;
return;
}
if( gMorphView )
{
gMorphView->setCameraDrivenByKeys( FALSE );
}
}
//RN: check to see if this is mouse-driving as opposed to ALT-zoom or Focus tool
else if (pick_info.mKeyMask & MASK_ALT ||
(LLToolMgr::getInstance()->getCurrentTool()->getName() == "Camera"))
{
LLViewerObject* hit_obj = pick_info.getObject();
if (hit_obj)
{
// ...clicked on a world object, so focus at its position
if (!hit_obj->isHUDAttachment())
{
gAgent.setFocusOnAvatar(FALSE, ANIMATE);
gAgent.setFocusGlobal(pick_info);
}
}
else if (!pick_info.mPosGlobal.isExactlyZero())
{
// Hit the ground
gAgent.setFocusOnAvatar(FALSE, ANIMATE);
gAgent.setFocusGlobal(pick_info);
}
static const LLCachedControl<bool> freeze_time("FreezeTime",0);
if (!(pick_info.mKeyMask & MASK_ALT) &&
gAgent.cameraThirdPerson() &&
gViewerWindow->getLeftMouseDown() &&
!freeze_time &&
(hit_obj == gAgent.getAvatarObject() ||
(hit_obj && hit_obj->isAttachment() && LLVOAvatar::findAvatarFromAttachment(hit_obj)->isSelf())))
{
LLToolCamera::getInstance()->mMouseSteering = TRUE;
}
}
LLToolCamera::getInstance()->mValidClickPoint = TRUE;
if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgent.getCameraMode() )
//.........这里部分代码省略.........
示例12: if
// static
LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pick, BOOL ignore_group, BOOL temp_select, BOOL select_root)
{
LLViewerObject* object = pick.getObject();
if (select_root)
{
object = object->getRootEdit();
}
// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f
if (rlv_handler_t::isEnabled())
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT))
{
if (!temp_select)
{
return LLSelectMgr::getInstance()->getSelection();
}
else
{
// Temporary selection, but if the build floater is open then it'll be permanent so get rid of the floater
if (gFloaterTools->getVisible())
{
// Copy/paste from toggle_build_mode()
gAgent.resetView(false);
gFloaterTools->close();
gViewerWindow->showCursor();
}
}
}
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (object) && ((!object->isAttachment()) || (!object->permYouOwner())) &&
(dist_vec_squared(gAgent.getPositionAgent(), object->getPositionRegion()) > 1.5f * 1.5f) )
{
// NOTE-RLVa: see behaviour notes for a rather lengthy explanation of why we're doing things this way
//if (dist_vec_squared(gAgent.getPositionAgent(), object->getPositionRegion() + pick.mObjectOffset) > 1.5f * 1.5f)
if (dist_vec_squared(gAgent.getPositionAgent(), pick.mIntersection) > 1.5f * 1.5f)
{
if ( (gFloaterTools->getVisible()) && (pick.mKeyMask != MASK_SHIFT) && (pick.mKeyMask != MASK_CONTROL) )
LLSelectMgr::getInstance()->deselectAll();
return LLSelectMgr::getInstance()->getSelection();
}
else if (gFloaterTools->getVisible())
{
// Copy/paste from toggle_build_mode()
gAgent.resetView(false);
gFloaterTools->close();
gViewerWindow->showCursor();
}
}
}
// [/RLVa:KB]
BOOL select_owned = gSavedSettings.getBOOL("SelectOwnedOnly");
BOOL select_movable = gSavedSettings.getBOOL("SelectMovableOnly");
BOOL select_region = gSavedSettings.getBOOL("SelectThisRegionOnly");
// *NOTE: These settings must be cleaned up at bottom of function.
if (temp_select || gAllowSelectAvatar)
{
gSavedSettings.setBOOL("SelectOwnedOnly", FALSE);
gSavedSettings.setBOOL("SelectMovableOnly", FALSE);
gSavedSettings.setBOOL("SelectThisRegionOnly", TRUE);
LLSelectMgr::getInstance()->setForceSelection(TRUE);
}
BOOL extend_select = (pick.mKeyMask == MASK_SHIFT) || (pick.mKeyMask == MASK_CONTROL);
// If no object, check for icon, then just deselect
if (!object)
{
LLHUDIcon* last_hit_hud_icon = pick.mHUDIcon;
if (last_hit_hud_icon && last_hit_hud_icon->getSourceObject())
{
LLFloaterScriptDebug::show(last_hit_hud_icon->getSourceObject()->getID());
}
else if (!extend_select)
{
LLSelectMgr::getInstance()->deselectAll();
}
}
else
{
BOOL already_selected = object->isSelected();
if ( extend_select )
{
if ( already_selected )
{
if ( ignore_group )
{
LLSelectMgr::getInstance()->deselectObjectOnly(object);
}
else
{
LLSelectMgr::getInstance()->deselectObjectAndFamily(object, TRUE, TRUE);
}
}
else
//.........这里部分代码省略.........
示例13: show
// static
void LLFloaterBuy::show(const LLSaleInfo& sale_info)
{
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
if (selection->getRootObjectCount() != 1)
{
LLNotificationsUtil::add("BuyOneObjectOnly");
return;
}
LLFloaterBuy* floater = LLFloaterReg::showTypedInstance<LLFloaterBuy>("buy_object");
if (!floater)
return;
// Clean up the lists...
floater->reset();
floater->mSaleInfo = sale_info;
floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
LLSelectNode* node = selection->getFirstRootNode();
if (!node)
return;
// Set title based on sale type
LLUIString title;
switch (sale_info.getSaleType())
{
case LLSaleInfo::FS_ORIGINAL:
title = floater->getString("title_buy_text");
break;
case LLSaleInfo::FS_COPY:
default:
title = floater->getString("title_buy_copy_text");
break;
}
title.setArg("[NAME]", node->mName);
floater->setTitle(title);
LLUUID owner_id;
std::string owner_name;
BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
if (!owners_identical)
{
LLNotificationsUtil::add("BuyObjectOneOwner");
return;
}
LLCtrlListInterface *object_list = floater->childGetListInterface("object_list");
if (!object_list)
{
return;
}
// Update the display
// Display next owner permissions
LLSD row;
// Compute icon for this item
std::string icon_name = LLInventoryIcon::getIconName(LLAssetType::AT_OBJECT,
LLInventoryType::IT_OBJECT);
row["columns"][0]["column"] = "icon";
row["columns"][0]["type"] = "icon";
row["columns"][0]["value"] = icon_name;
// Append the permissions that you will acquire (not the current
// permissions).
U32 next_owner_mask = node->mPermissions->getMaskNextOwner();
std::string text = node->mName;
if (!(next_owner_mask & PERM_COPY))
{
text.append(floater->getString("no_copy_text"));
}
if (!(next_owner_mask & PERM_MODIFY))
{
text.append(floater->getString("no_modify_text"));
}
if (!(next_owner_mask & PERM_TRANSFER))
{
text.append(floater->getString("no_transfer_text"));
}
row["columns"][1]["column"] = "text";
row["columns"][1]["value"] = text;
row["columns"][1]["font"] = "SANSSERIF";
// Add after columns added so appropriate heights are correct.
object_list->addElement(row);
floater->getChild<LLUICtrl>("buy_text")->setTextArg("[AMOUNT]", llformat("%d", sale_info.getSalePrice()));
floater->getChild<LLUICtrl>("buy_name_text")->setTextArg("[NAME]", owner_name);
// Must do this after the floater is created, because
// sometimes the inventory is already there and
// the callback is called immediately.
LLViewerObject* obj = selection->getFirstRootObject();
floater->registerVOInventoryListener(obj,NULL);
floater->requestVOInventory();
}
示例14: show
// static
void LLFloaterBuyContents::show(const LLSaleInfo& sale_info)
{
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
if (selection->getRootObjectCount() != 1)
{
LLNotifications::instance().add("BuyContentsOneOnly");
return;
}
// Create a new instance only if needed
if (sInstance)
{
LLScrollListCtrl* list = sInstance->getChild<LLScrollListCtrl>("item_list");
if (list) list->deleteAllItems();
}
else
{
sInstance = new LLFloaterBuyContents();
}
sInstance->open(); /*Flawfinder: ignore*/
sInstance->setFocus(TRUE);
sInstance->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
// Always center the dialog. User can change the size,
// but purchases are important and should be center screen.
// This also avoids problems where the user resizes the application window
// mid-session and the saved rect is off-center.
sInstance->center();
LLUUID owner_id;
std::string owner_name;
BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
if (!owners_identical)
{
LLNotifications::instance().add("BuyContentsOneOwner");
return;
}
sInstance->mSaleInfo = sale_info;
// Update the display
LLSelectNode* node = selection->getFirstRootNode();
if (!node) return;
if(node->mPermissions->isGroupOwned())
{
gCacheName->getGroupName(owner_id, owner_name);
}
sInstance->childSetTextArg("contains_text", "[NAME]", node->mName);
sInstance->childSetTextArg("buy_text", "[AMOUNT]", llformat("%d", sale_info.getSalePrice()));
sInstance->childSetTextArg("buy_text", "[NAME]", owner_name);
// Must do this after the floater is created, because
// sometimes the inventory is already there and
// the callback is called immediately.
LLViewerObject* obj = selection->getFirstRootObject();
sInstance->registerVOInventoryListener(obj,NULL);
sInstance->requestVOInventory();
}
示例15: show
// static
void LLFloaterBuy::show(const LLSaleInfo& sale_info)
{
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
if (selection->getRootObjectCount() != 1)
{
LLNotifications::instance().add("BuyOneObjectOnly");
return;
}
// Create a new instance only if one doesn't exist
if (sInstance)
{
// Clean up the lists...
sInstance->reset();
}
else
{
sInstance = new LLFloaterBuy();
}
sInstance->open(); /*Flawfinder: ignore*/
sInstance->setFocus(TRUE);
sInstance->mSaleInfo = sale_info;
sInstance->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
// Always center the dialog. User can change the size,
// but purchases are important and should be center screen.
// This also avoids problems where the user resizes the application window
// mid-session and the saved rect is off-center.
sInstance->center();
LLSelectNode* node = selection->getFirstRootNode();
if (!node)
return;
// Set title based on sale type
LLUIString title;
switch (sale_info.getSaleType())
{
case LLSaleInfo::FS_ORIGINAL:
title = sInstance->getString("title_buy_text");
break;
case LLSaleInfo::FS_COPY:
default:
title = sInstance->getString("title_buy_copy_text");
break;
}
title.setArg("[NAME]", node->mName);
sInstance->setTitle(title);
LLUUID owner_id;
std::string owner_name;
BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
if (!owners_identical)
{
LLNotifications::instance().add("BuyObjectOneOwner");
return;
}
LLCtrlListInterface *object_list = sInstance->childGetListInterface("object_list");
if (!object_list)
{
return;
}
// Update the display
// Display next owner permissions
LLSD row;
// Compute icon for this item
std::string icon_name = get_item_icon_name(LLAssetType::AT_OBJECT,
LLInventoryType::IT_OBJECT,
0x0, FALSE);
row["columns"][0]["column"] = "icon";
row["columns"][0]["type"] = "icon";
row["columns"][0]["color"] = gColors.getColor("DefaultListIcon").getValue();
row["columns"][0]["value"] = icon_name;
// Append the permissions that you will acquire (not the current
// permissions).
U32 next_owner_mask = node->mPermissions->getMaskNextOwner();
std::string text = node->mName;
if (!(next_owner_mask & PERM_COPY))
{
text.append(sInstance->getString("no_copy_text"));
}
if (!(next_owner_mask & PERM_MODIFY))
{
text.append(sInstance->getString("no_modify_text"));
}
if (!(next_owner_mask & PERM_TRANSFER))
{
text.append(sInstance->getString("no_transfer_text"));
}
row["columns"][1]["column"] = "text";
row["columns"][1]["color"] = gColors.getColor("DefaultListText").getValue();
//.........这里部分代码省略.........