当前位置: 首页>>代码示例>>C++>>正文


C++ LLAvatarListEntry类代码示例

本文整理汇总了C++中LLAvatarListEntry的典型用法代码示例。如果您正苦于以下问题:C++ LLAvatarListEntry类的具体用法?C++ LLAvatarListEntry怎么用?C++ LLAvatarListEntry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LLAvatarListEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: focusOnCurrent

void LLFloaterAvatarList::focusOnCurrent()
{
	std::map<LLUUID, LLAvatarListEntry>::iterator iter;
	LLAvatarListEntry *entry;

	if (mAvatars.size() == 0)
	{
		return;
	}

	for (iter = mAvatars.begin(); iter != mAvatars.end(); iter++)
	{
		entry = &iter->second;

		if (entry->isDead())
			continue;

		if (entry->getID() == mFocusedAvatar)
		{
			removeFocusFromAll();
			entry->setFocus(TRUE);
			gAgentCamera.lookAtObject(mFocusedAvatar, false);
			return;
		}
	}
}
开发者ID:StephenGWills,项目名称:SingularityViewer,代码行数:26,代码来源:llfloateravatarlist.cpp

示例2: expireAvatarList

void LLFloaterAvatarList::expireAvatarList()
{
//	llinfos << "radar: expiring" << llendl;
	std::map<LLUUID, LLAvatarListEntry>::iterator iter;
	std::queue<LLUUID> delete_queue;
	bool alive;

	for (iter = mAvatars.begin(); iter != mAvatars.end(); iter++)
	{
		LLAvatarListEntry *entry = &iter->second;
		
		alive = entry->getAlive();

		if (entry->isDead())
		{
			//llinfos << "radar: expiring avatar " << entry->getName() << llendl;
			LLUUID av_id = entry->getID();
			delete_queue.push(av_id);
		}
	}

	while (!delete_queue.empty())
	{
		mAvatars.erase(delete_queue.front());
		delete_queue.pop();
	}
}
开发者ID:StephenGWills,项目名称:SingularityViewer,代码行数:27,代码来源:llfloateravatarlist.cpp

示例3: getInstance

BOOL LLFloaterAvatarList::handleKeyHere(KEY key, MASK mask)
{
	LLFloaterAvatarList* self = getInstance();
	LLScrollListItem* item = self->mAvatarList->getFirstSelected();
	if(item)
	{
		LLUUID agent_id = item->getUUID();
		if (( KEY_RETURN == key ) && (MASK_NONE == mask))
		{
			self->mFocusedAvatar = agent_id;
			self->focusOnCurrent();
			return TRUE;
		}
		else if (( KEY_RETURN == key ) && (MASK_CONTROL == mask))
		{
			LLAvatarListEntry* entry = self->getAvatarEntry(agent_id);
			if (entry)
			{
//				llinfos << "Trying to teleport to " << entry->getName() << " at " << entry->getPosition() << llendl;
				gAgent.teleportViaLocation(entry->getPosition());
			}
			return TRUE;
		}
	}

	if (( KEY_RETURN == key ) && (MASK_SHIFT == mask))
	{
		LLDynamicArray<LLUUID> ids = self->mAvatarList->getSelectedIDs();
		if (ids.size() > 0)
		{
			if (ids.size() == 1)
			{
				// Single avatar
				LLUUID agent_id = ids[0];

				// [Ansariel: Display name support]
				LLAvatarName avatar_name;
				if (LLAvatarNameCache::get(agent_id, &avatar_name))
				{
					gIMMgr->setFloaterOpen(TRUE);
					gIMMgr->addSession(LLCacheName::cleanFullName(avatar_name.getLegacyName()),IM_NOTHING_SPECIAL,agent_id);
				}
				// [Ansariel: Display name support]
			}
			else
			{
				// Group IM
				LLUUID session_id;
				session_id.generate();
				gIMMgr->setFloaterOpen(TRUE);
				gIMMgr->addSession("Avatars Conference", IM_SESSION_CONFERENCE_START, ids[0], ids);
			}
		}
	}
	return LLPanel::handleKeyHere(key, mask);
}
开发者ID:samiam123,项目名称:VoodooNxg,代码行数:56,代码来源:llfloateravatarlist.cpp

示例4: removeFocusFromAll

void LLFloaterAvatarList::removeFocusFromAll()
{
	std::map<LLUUID, LLAvatarListEntry>::iterator iter;

	for (iter = mAvatars.begin(); iter != mAvatars.end(); iter++)
	{
		LLAvatarListEntry *entry = &iter->second;
		entry->setFocus(FALSE);
	}
}
开发者ID:StephenGWills,项目名称:SingularityViewer,代码行数:10,代码来源:llfloateravatarlist.cpp

示例5: getSelectedID

std::string LLFloaterAvatarList::getSelectedName()
{
	LLUUID id = getSelectedID();
	LLAvatarListEntry *entry = getAvatarEntry(id);
	if (entry)
	{
		return entry->getName();
	}
	return "";
}
开发者ID:StephenGWills,项目名称:SingularityViewer,代码行数:10,代码来源:llfloateravatarlist.cpp

示例6: onClickAR

//static
void LLFloaterAvatarList::onClickAR(void *userdata)
{
	LLFloaterAvatarList *self = (LLFloaterAvatarList*)userdata;
 	LLScrollListItem *item = self->mAvatarList->getFirstSelected();
	if (item)
	{
		LLUUID agent_id = item->getUUID();
		LLAvatarListEntry *entry = self->getAvatarEntry(agent_id);
		if (entry)
		{
			LLFloaterReporter::showFromObject(entry->getID());
		}
	}
}
开发者ID:StephenGWills,项目名称:SingularityViewer,代码行数:15,代码来源:llfloateravatarlist.cpp

示例7: getAvatarEntry

void LLFloaterAvatarList::doCommand(void (*func)(const LLUUID &avatar, const std::string &name))
{
	LLDynamicArray<LLUUID> ids = mAvatarList->getSelectedIDs();

	for (LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
	{
		LLUUID avid = *itr;
		LLAvatarListEntry *entry = getAvatarEntry(avid);
		if (entry != NULL)
		{
			llinfos << "Executing command on " << entry->getName() << llendl;
			func(avid, entry->getName());
		}
	}
}
开发者ID:StephenGWills,项目名称:SingularityViewer,代码行数:15,代码来源:llfloateravatarlist.cpp

示例8: onClickMark

//static
void LLFloaterAvatarList::onClickMark(void *userdata)
{
	LLFloaterAvatarList *self = (LLFloaterAvatarList*)userdata;
	LLDynamicArray<LLUUID> ids = self->mAvatarList->getSelectedIDs();

	for (LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
	{
		LLUUID avid = *itr;
		LLAvatarListEntry *entry = self->getAvatarEntry(avid);
		if (entry != NULL)
		{
			entry->toggleMark();
		}
	}
}
开发者ID:StephenGWills,项目名称:SingularityViewer,代码行数:16,代码来源:llfloateravatarlist.cpp

示例9: onClickTeleport

//static
void LLFloaterAvatarList::onClickTeleport(void* userdata)
{
	LLFloaterAvatarList *self = (LLFloaterAvatarList*)userdata;
 	LLScrollListItem *item = self->mAvatarList->getFirstSelected();
	if (item)
	{
		LLUUID agent_id = item->getUUID();
		LLAvatarListEntry *entry = self->getAvatarEntry(agent_id);
		if (entry)
		{
//			llinfos << "Trying to teleport to " << entry->getName() << " at " << entry->getPosition() << llendl;
			gAgent.teleportViaLocation(entry->getPosition());
		}
	}
}
开发者ID:StephenGWills,项目名称:SingularityViewer,代码行数:16,代码来源:llfloateravatarlist.cpp

示例10: updateParticleActivity

void updateParticleActivity(LLDrawable *drawablep)
{
	if (LLFloaterAvatarList::instanceExists())
	{
		LLViewerObject *vobj = drawablep->getVObj();
		if (vobj && vobj->isParticleSource())
		{
			LLUUID id = vobj->mPartSourcep->getOwnerUUID();
			LLAvatarListEntry *ent = LLFloaterAvatarList::getInstance()->getAvatarEntry(id);
			if ( NULL != ent )
			{
				ent->setActivity(LLAvatarListEntry::ACTIVITY_PARTICLES);
			}
		}
	}
}
开发者ID:aragornarda,项目名称:SingularityViewer,代码行数:16,代码来源:llfloateravatarlist.cpp

示例11: onClickSendKeys

void LLFloaterAvatarList::onClickSendKeys(void *userdata)
{
	LLFloaterAvatarList *self = (LLFloaterAvatarList*)userdata;
	std::map<LLUUID, LLAvatarListEntry>::iterator iter;
	LLAvatarListEntry *entry;

	if (self->mAvatars.size() == 0)
		return;

	for (iter = self->mAvatars.begin(); iter != self->mAvatars.end(); iter++)
	{
		entry = &iter->second;

		if (!entry->isDead() && entry->isInSim())
			announce(entry->getID().asString());
	}
}
开发者ID:Boy,项目名称:rainbow,代码行数:17,代码来源:llfloateravatarlist.cpp

示例12: onSelectName

void LLFloaterAvatarList::onSelectName(LLUICtrl*, void* userdata)
{
	LLFloaterAvatarList* self = (LLFloaterAvatarList*)userdata;

 	LLScrollListItem *item = self->mAvatarList->getFirstSelected();
	if (item)
	{
		LLUUID agent_id = item->getUUID();
		LLAvatarListEntry *entry = self->getAvatarEntry(agent_id);
		if (entry)
		{
			BOOL enabled = entry->isDrawn();
			self->childSetEnabled("focus_btn", enabled);
			self->childSetEnabled("prev_in_list_btn", enabled);
			self->childSetEnabled("next_in_list_btn", enabled);
		}
	}
}
开发者ID:StephenGWills,项目名称:SingularityViewer,代码行数:18,代码来源:llfloateravatarlist.cpp

示例13: focusOnNext

void LLFloaterAvatarList::focusOnNext(BOOL marked_only)
{
	std::map<LLUUID, LLAvatarListEntry>::iterator iter;
	BOOL found = FALSE;
	LLAvatarListEntry *next = NULL;
	LLAvatarListEntry *entry;

	if (mAvatars.size() == 0)
	{
		return;
	}

	for (iter = mAvatars.begin(); iter != mAvatars.end(); iter++)
	{
		entry = &iter->second;

		if (entry->isDead())
			continue;

		if (next == NULL && ((!marked_only && entry->isDrawn()) || entry->isMarked()))
		{
			next = entry;
		}

		if (found && ((!marked_only && entry->isDrawn()) || entry->isMarked()))
		{
			next = entry;
			break;
		}

		if (entry->getID() == mFocusedAvatar)
		{
			found = TRUE;
		} 
	}

	if (next != NULL)
	{
		removeFocusFromAll();
		next->setFocus(TRUE);
		mFocusedAvatar = next->getID();
		gAgentCamera.lookAtObject(mFocusedAvatar, false);
	}
}
开发者ID:StephenGWills,项目名称:SingularityViewer,代码行数:44,代码来源:llfloateravatarlist.cpp

示例14: focusOnPrev

void LLFloaterAvatarList::focusOnPrev(BOOL marked_only)
{
	std::map<LLUUID, LLAvatarListEntry>::iterator iter;
	LLAvatarListEntry *prev = NULL;
	LLAvatarListEntry *entry;

	if (mAvatars.size() == 0)
	{
		return;
	}

	for (iter = mAvatars.begin(); iter != mAvatars.end(); iter++)
	{
		entry = &iter->second;

		if (entry->isDead())
			continue;

		if (prev != NULL && entry->getID() == mFocusedAvatar)
		{
			break;
		}

		if ((!marked_only && entry->isDrawn()) || entry->isMarked())
		{
			prev = entry;
		}
	}

	if (prev != NULL)
	{
		removeFocusFromAll();
		prev->setFocus(TRUE);
		mFocusedAvatar = prev->getID();
		gAgentCamera.lookAtObject(mFocusedAvatar, false);
	}
}
开发者ID:StephenGWills,项目名称:SingularityViewer,代码行数:37,代码来源:llfloateravatarlist.cpp

示例15: refreshAvatarList

/**
 * Redraws the avatar list
 * Only does anything if the avatar list is visible.
 * @author Dale Glass
 */
void LLFloaterAvatarList::refreshAvatarList() 
{
	// Don't update list when interface is hidden
	if (!sInstance->getVisible()) return;

	// We rebuild the list fully each time it's refreshed
	// The assumption is that it's faster to refill it and sort than
	// to rebuild the whole list.
	LLDynamicArray<LLUUID> selected = mAvatarList->getSelectedIDs();
	S32 scrollpos = mAvatarList->getScrollPos();

	mAvatarList->deleteAllItems();

	LLVector3d mypos = gAgent.getPositionGlobal();
	LLVector3d posagent;
	posagent.setVec(gAgent.getPositionAgent());
	LLVector3d simpos = mypos - posagent;

	std::map<LLUUID, LLAvatarListEntry>::iterator iter;
	for (iter = mAvatars.begin(); iter != mAvatars.end(); iter++)
	{
		LLSD element;
		LLUUID av_id;
		std::string av_name;

		LLAvatarListEntry *entry = &iter->second;

		// Skip if avatar hasn't been around
		if (entry->isDead())
		{
			continue;
		}

		av_id = entry->getID();
		av_name = entry->getName().c_str();

		LLVector3d position = entry->getPosition();
		BOOL UnknownAltitude = false;

		LLVector3d delta = position - mypos;
		F32 distance = (F32)delta.magVec();
		if (position.mdV[VZ] == 0.0)
		{
			UnknownAltitude = true;
			distance = 9000.0;
		}
		delta.mdV[2] = 0.0f;
		F32 side_distance = (F32)delta.magVec();

		// HACK: Workaround for an apparent bug:
		// sometimes avatar entries get stuck, and are registered
		// by the client as perpetually moving in the same direction.
		// this makes sure they get removed from the visible list eventually

		//jcool410 -- this fucks up seeing dueds thru minimap data > 1024m away, so, lets just say > 2048m to the side is bad
		//aka 8 sims
		if (side_distance > 2048.0f)
		{
			continue;
		}

		if (av_id.isNull())
		{
			//llwarns << "Avatar with null key somehow got into the list!" << llendl;
			continue;
		}

		element["id"] = av_id;

		element["columns"][LIST_MARK]["column"] = "marked";
		element["columns"][LIST_MARK]["type"] = "text";
		if (entry->isMarked())
		{
			element["columns"][LIST_MARK]["value"] = "X";
			element["columns"][LIST_MARK]["color"] = LLColor4::blue.getValue();
			element["columns"][LIST_MARK]["font-style"] = "BOLD";
		}
		else
		{
			element["columns"][LIST_MARK]["value"] = "";
		}

		element["columns"][LIST_AVATAR_NAME]["column"] = "avatar_name";
		element["columns"][LIST_AVATAR_NAME]["type"] = "text";
		element["columns"][LIST_AVATAR_NAME]["value"] = av_name;
		if (entry->isFocused())
		{
			element["columns"][LIST_AVATAR_NAME]["font-style"] = "BOLD";
		}

		//<edit> custom colors for certain types of avatars!
		//Changed a bit so people can modify them in settings. And since they're colors, again it's possibly account-based. Starting to think I need a function just to determine that. - HgB
		//element["columns"][LIST_AVATAR_NAME]["color"] = gColors.getColor( "MapAvatar" ).getValue();
		LLViewerRegion* parent_estate = LLWorld::getInstance()->getRegionFromPosGlobal(entry->getPosition());
		LLUUID estate_owner = LLUUID::null;
//.........这里部分代码省略.........
开发者ID:StephenGWills,项目名称:SingularityViewer,代码行数:101,代码来源:llfloateravatarlist.cpp


注:本文中的LLAvatarListEntry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。