void LLFloaterProperties::onClickCreator()
{
	LLInventoryItem* item = findItem();
	if(!item) return;
	if(!item->getCreatorUUID().isNull())
	{
		LLAvatarActions::showProfile(item->getCreatorUUID());
	}
}
Esempio n. 2
0
// static
void LLFloaterProperties::onClickCreator(void* data)
{
	LLFloaterProperties* self = (LLFloaterProperties*)data;
	if(!self) return;
	LLInventoryItem* item = self->findItem();
	if(!item) return;
	if(!item->getCreatorUUID().isNull())
	{
		LLFloaterAvatarInfo::showFromObject(item->getCreatorUUID());
	}
}
Esempio n. 3
0
// Callback for inventory picker (select from calling cards)
void LLFloaterAvatarPicker::doCallingCardSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data)
{
	bool panel_active = (childGetVisibleTab("ResidentChooserTabs") == getChild<LLPanel>("CallingCardsPanel"));
	
	mSelectedInventoryAvatarIDs.clear();
	mSelectedInventoryAvatarNames.clear();
	
	if (panel_active)
	{
		childSetEnabled("Select", FALSE);
	}

	std::deque<LLFolderViewItem*>::const_iterator item_it;
	for (item_it = items.begin(); item_it != items.end(); ++item_it)
	{
		LLFolderViewEventListener* listenerp = (*item_it)->getListener();
		if (listenerp->getInventoryType() == LLInventoryType::IT_CALLINGCARD)
		{
			LLInventoryItem* item = gInventory.getItem(listenerp->getUUID());
			if (item)
			{
				mSelectedInventoryAvatarIDs.push_back(item->getCreatorUUID());
				mSelectedInventoryAvatarNames.push_back(listenerp->getName());
			}
		}
	}

	if (panel_active)
	{
		childSetEnabled("Select", visibleItemsSelected());
	}
}
Esempio n. 4
0
// virtual, public
BOOL LLNameListCtrl::handleDragAndDrop( 
		S32 x, S32 y, MASK mask,
		BOOL drop,
		EDragAndDropType cargo_type, void *cargo_data, 
		EAcceptance *accept,
		std::string& tooltip_msg)
{
	if (!mAllowCallingCardDrop)
	{
		return FALSE;
	}

	BOOL handled = FALSE;

	if (cargo_type == DAD_CALLINGCARD)
	{
		if (drop)
		{
			LLInventoryItem* item = (LLInventoryItem *)cargo_data;
			addNameItem(item->getCreatorUUID());
		}

		*accept = ACCEPT_YES_MULTI;
	}
	else
	{
		*accept = ACCEPT_NO;
		if (tooltip_msg.empty())
		{
			if (!getToolTip().empty())
			{
				tooltip_msg = getToolTip();
			}
			else
			{
				// backwards compatable English tooltip (should be overridden in xml)
				tooltip_msg.assign("Drag a calling card here\nto add a resident.");
			}
		}
	}

	handled = TRUE;
	lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLNameListCtrl " << getName() << llendl;

	return handled;
}
// Callback for inventory picker (select from calling cards)
void LLFloaterAvatarPicker::doSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data)
{
	if (!mListNames)
	{
		return;
	}

	std::vector<LLScrollListItem*> search_items = mListNames->getAllSelected();
	if ( search_items.size() == 0 )
	{	// Nothing selected in the search results
		mAvatarIDs.clear();
		mAvatarNames.clear();
		childSetEnabled("Select", FALSE);
	}
	BOOL first_calling_card = TRUE;

	std::deque<LLFolderViewItem*>::const_iterator item_it;
	for (item_it = items.begin(); item_it != items.end(); ++item_it)
	{
		LLFolderViewEventListener* listenerp = (*item_it)->getListener();
		if (listenerp->getInventoryType() == LLInventoryType::IT_CALLINGCARD)
		{
			LLInventoryItem* item = gInventory.getItem(listenerp->getUUID());

			if (item)
			{
				if ( first_calling_card )
				{	// Have a calling card selected, so clear anything from the search panel
					first_calling_card = FALSE;
					mAvatarIDs.clear();
					mAvatarNames.clear();
					mListNames->deselectAllItems();
				}

				// Add calling card info to the selected avatars
				mAvatarIDs.push_back(item->getCreatorUUID());
				mAvatarNames.push_back(listenerp->getName());
				childSetEnabled("Select", TRUE);
			}
		}
	}
}
void FSLSLBridge::inventoryChanged(LLViewerObject* object,
								LLInventoryObject::object_list_t* inventory,
								S32 serial_num,
								void* user_data)
{
	object->removeInventoryListener(this);

	llinfos << "Received object inventory for existing bridge prim. Checking contents..." << llendl;

	//are we attaching the right thing? Check size and script
	LLInventoryObject::object_list_t inventory_objects;
	object->getInventoryContents(inventory_objects);

	if (object->flagInventoryEmpty())
	{
		llinfos << "Empty bridge detected- re-enter creation process" << llendl;
		mBridgeCreating = true;
	}
	else if (inventory_objects.size() > 0)
	{
		S32 count(0);

		LLInventoryObject::object_list_t::iterator it = inventory_objects.begin();
		LLInventoryObject::object_list_t::iterator end = inventory_objects.end();
		bool isOurScript = false;
		for ( ; it != end; ++it)
		{
			LLInventoryItem* item = ((LLInventoryItem*)((LLInventoryObject*)(*it)));

			// AH: Somehow always contains a wonky object item with creator
			// UUID = NULL UUID and asset type AT_NONE - don't count it
			if (item->getType() != LLAssetType::AT_NONE)
			{
				count++;
			}

			if (item->getType() == LLAssetType::AT_LSL_TEXT)
			{
				if (item->getCreatorUUID() == gAgent.getID())
				{
					isOurScript = true;
				}
				else //problem, not our script
				{
					llwarns << "The bridge inventory contains a script not created by user." << llendl;
				}
			}
		}
		if (count == 1 && isOurScript) //We attached a valid bridge. Run along.
		{
			return;
		}
		else 
		{
			reportToNearbyChat(LLTrans::getString("fsbridge_warning_unexpected_items"));
			llwarns << "The bridge inventory contains items other than bridge script." << llendl;
			if (!isOurScript)	//some junk but no valid script? Unlikely to happen, but lets add script anyway.
			{
				mBridgeCreating = true;
			}
			else //Let the script disable competitors 
			{
				return;
			}
		}
	}
	else
	{
		llwarns << "Bridge not empty, but we're unable to retrieve contents." << llendl;
	}

	//modify the rock size and texture
	if (mBridgeCreating)
	{
		configureBridgePrim(object);
	}
}