Exemple #1
0
void WearOnAvatarCallback::fire(const LLUUID& inv_item)
{
	if (inv_item.isNull())
		return;

	LLViewerInventoryItem *item = gInventory.getItem(inv_item);
	if (item)
	{
		wear_inventory_item_on_avatar(item);
	}
}
Exemple #2
0
// static
void LLFloaterClothing::onClickWear(void* data)
{
	LLFloaterClothing* self = (LLFloaterClothing*)data;

	const LLUUID& item_id = self->childGetValue("clothing_list").asUUID();

	LLViewerInventoryItem* inv_item = gInventory.getItem(item_id);
	if (!inv_item)
	{
		llwarns << "Can't find inventory item to wear" << llendl;
		return;
	}

	wear_inventory_item_on_avatar(inv_item);
}
void LLViewerInventoryCategory::createBasicHair()
{
	LLUUID item_id = LLUUID("30d1d71b-38a6-4956-b27e-3bbcc17da0e2"); //lolhack, it's my UUID?
	
	//Make some hair just in case, using the library item so we're not hacking.
	LLUUID folder_id(gInventory.findCategoryUUIDForType(LLAssetType::AT_BODYPART));
	LLPermissions* perms = new LLPermissions();
	perms->set(LLPermissions::DEFAULT);
	perms->setOwnerAndGroup(LLUUID::null, LLUUID::null, LLUUID::null, false);
	perms->setMaskBase(0);
	perms->setMaskEveryone(0);
	perms->setMaskGroup(0);
	perms->setMaskNext(0);
	perms->setMaskOwner(0);
	LLViewerInventoryItem* item = new LLViewerInventoryItem(
			item_id,
			folder_id,
			*perms,
			LLUUID("f0581d0d-d7c4-2573-b2ce-7a5d6ded3851"),
			LLAssetType::AT_BODYPART,
			LLInventoryType::IT_WEARABLE,
			"RuthHairFix",
			"",
			LLSaleInfo::DEFAULT,
			0,
			0);

	//Update some stuff I guess
	LLInventoryModel::update_map_t update;
	++update[item->getParentUUID()];
	gInventory.accountForUpdate(update);
	gInventory.updateItem(item);
	gInventory.notifyObservers();
	

	wear_inventory_item_on_avatar(item);
}