本文整理汇总了C++中LLObjectSelectionHandle::getFirstRootObject方法的典型用法代码示例。如果您正苦于以下问题:C++ LLObjectSelectionHandle::getFirstRootObject方法的具体用法?C++ LLObjectSelectionHandle::getFirstRootObject怎么用?C++ LLObjectSelectionHandle::getFirstRootObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLObjectSelectionHandle
的用法示例。
在下文中一共展示了LLObjectSelectionHandle::getFirstRootObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: 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();
}
示例4: show
//.........这里部分代码省略.........
}
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();
row["columns"][1]["value"] = text;
row["columns"][1]["font"] = "SANSSERIF";
// Add after columns added so appropriate heights are correct.
object_list->addElement(row);
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();
}