本文整理汇总了C++中LLViewerInventoryItem::getSaleInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerInventoryItem::getSaleInfo方法的具体用法?C++ LLViewerInventoryItem::getSaleInfo怎么用?C++ LLViewerInventoryItem::getSaleInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerInventoryItem
的用法示例。
在下文中一共展示了LLViewerInventoryItem::getSaleInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateSaleInfo
void LLFloaterProperties::updateSaleInfo()
{
LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem();
if(!item) return;
LLSaleInfo sale_info(item->getSaleInfo());
if(!gAgent.allowOperation(PERM_TRANSFER, item->getPermissions(), GP_OBJECT_SET_SALE))
{
getChild<LLUICtrl>("CheckPurchase")->setValue(LLSD((BOOL)FALSE));
}
if((BOOL)getChild<LLUICtrl>("CheckPurchase")->getValue())
{
// turn on sale info
LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY;
LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("RadioSaleType");
if(RadioSaleType)
{
switch (RadioSaleType->getSelectedIndex())
{
case 0:
sale_type = LLSaleInfo::FS_ORIGINAL;
break;
case 1:
sale_type = LLSaleInfo::FS_COPY;
break;
case 2:
sale_type = LLSaleInfo::FS_CONTENTS;
break;
default:
sale_type = LLSaleInfo::FS_COPY;
break;
}
}
if (sale_type == LLSaleInfo::FS_COPY
&& !gAgent.allowOperation(PERM_COPY, item->getPermissions(),
GP_OBJECT_SET_SALE))
{
sale_type = LLSaleInfo::FS_ORIGINAL;
}
S32 price = -1;
price = getChild<LLUICtrl>("Edit Cost")->getValue().asInteger();;
// Invalid data - turn off the sale
if (price < 0)
{
sale_type = LLSaleInfo::FS_NOT;
price = 0;
}
sale_info.setSaleType(sale_type);
sale_info.setSalePrice(price);
}
else
{
sale_info.setSaleType(LLSaleInfo::FS_NOT);
}
if(sale_info != item->getSaleInfo()
&& item->isFinished())
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
// Force an update on the sale price at rez
if (item->getType() == LLAssetType::AT_OBJECT)
{
U32 flags = new_item->getFlags();
flags |= LLInventoryItemFlags::II_FLAGS_OBJECT_SLAM_SALE;
new_item->setFlags(flags);
}
new_item->setSaleInfo(sale_info);
if(mObjectID.isNull())
{
// This is in the agent's inventory.
new_item->updateServer(FALSE);
gInventory.updateItem(new_item);
gInventory.notifyObservers();
}
else
{
// This is in an object's contents.
LLViewerObject* object = gObjectList.findObject(mObjectID);
if(object)
{
object->updateInventory(
new_item,
TASK_INVENTORY_ITEM_KEY,
false);
}
}
}
else
{
// need to make sure we don't just follow the click
refresh();
}
//.........这里部分代码省略.........