コード例 #1
0
void LLPanelOutfitEdit::onAddWearableClicked(void)
{
	LLPanelDummyClothingListItem* item = dynamic_cast<LLPanelDummyClothingListItem*>(mCOFWearables->getSelectedItem());

	if(item)
	{
		showFilteredWearablesListView(item->getWearableType());
	}
}
コード例 #2
0
	// Get wearable type of the given item.
	//
	// There is a special case: so-called "dummy items"
	// (i.e. the ones that are there just to indicate that you're not wearing
	// any wearables of the corresponding type. They are currently grayed out
	// and suffixed with "not worn").
	// Those items don't have an UUID, but they do have an associated wearable type.
	// If the user has invoked context menu for such item,
	// we ignore the passed item_id and retrieve wearable type from the item.
	LLWearableType::EType getWearableType(const LLUUID& item_id)
	{
		if (!isDummyItem(item_id))
		{
			LLViewerInventoryItem* item = gInventory.getLinkedItem(item_id);
			if (item && item->isWearableType())
			{
				return item->getWearableType();
			}
		}
		else if (mCOFWearables) // dummy item selected
		{
			LLPanelDummyClothingListItem* item;

			item = dynamic_cast<LLPanelDummyClothingListItem*>(mCOFWearables->getSelectedItem());
			if (item)
			{
				return item->getWearableType();
			}
		}

		return LLWearableType::WT_NONE;
	}