本文整理汇总了C++中LLAvatarName::getCompleteName方法的典型用法代码示例。如果您正苦于以下问题:C++ LLAvatarName::getCompleteName方法的具体用法?C++ LLAvatarName::getCompleteName怎么用?C++ LLAvatarName::getCompleteName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLAvatarName
的用法示例。
在下文中一共展示了LLAvatarName::getCompleteName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_avatar_name_cache_notify
static void on_avatar_name_cache_notify(const LLUUID& agent_id,
const LLAvatarName& av_name,
bool online,
LLSD payload)
{
// Popup a notify box with online status of this agent
// Use display name only because this user is your friend
LLSD args;
switch (gSavedSettings.getS32("PhoenixNameSystem"))
{
case 0 : args["NAME"] = av_name.getLegacyName(); break;
case 1 : args["NAME"] = (av_name.mIsDisplayNameDefault ? av_name.mDisplayName : av_name.getCompleteName()); break;
case 2 : args["NAME"] = av_name.mDisplayName; break;
default : args["NAME"] = av_name.getCompleteName(); break;
}
// Popup a notify box with online status of this agent
LLNotificationPtr notification = LLNotificationsUtil::add(online ? "FriendOnline" : "FriendOffline", args, payload);
// If there's an open IM session with this agent, send a notification there too.
LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id);
LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id);
if (floater)
{
std::string notifyMsg = notification->getMessage();
if (!notifyMsg.empty())
floater->addHistoryLine(notifyMsg,gSavedSettings.getColor4("SystemChatColor"));
}
}
示例2: onAvatarNameCache
void LLFloaterReporter::onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name)
{
if (mObjectID == avatar_id)
{
mOwnerName = av_name.getCompleteName();
getChild<LLUICtrl>("object_name")->setValue(av_name.getCompleteName());
getChild<LLUICtrl>("object_name")->setToolTip(av_name.getCompleteName());
getChild<LLUICtrl>("abuser_name_edit")->setValue(av_name.getCompleteName());
}
}
示例3: on_avatar_name_show_profile
static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name, bool web)
{
if (gSavedSettings.getString("WebProfileURL").empty() || !(web || gSavedSettings.getBOOL("UseWebProfiles")))
{
LLFloaterAvatarInfo* floater = LLFloaterAvatarInfo::getInstance(agent_id);
if(!floater)
{
floater = new LLFloaterAvatarInfo(av_name.getCompleteName()+" - "+LLTrans::getString("Command_Profile_Label"), agent_id);
floater->center();
}
// ...bring that window to front
floater->open(); /*Flawfinder: ignore*/
}
else
{
std::string username = av_name.mUsername;
if (username.empty())
{
username = LLCacheName::buildUsername(av_name.mDisplayName);
}
llinfos << "opening web profile for " << username << llendl;
std::string url = getProfileURL(username);
// PROFILES: open in webkit window
LLFloaterWebContent::Params p;
p.url(url).
id(agent_id.asString());
LLFloaterWebProfile::showInstance(get_profile_floater_name(agent_id), p);
}
}
示例4: onAvatarNameCache
void LLAvatarListItem::onAvatarNameCache(const LLAvatarName& av_name)
{
// setAvatarName(av_name.mDisplayName);
// setAvatarToolTip(av_name.mUsername);
// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
bool fRlvFilter = (mRlvCheckShowNames) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
if (mShowDisplayName && !mShowUsername)
setAvatarName( (!fRlvFilter) ? av_name.mDisplayName : RlvStrings::getAnonym(av_name) );
else if (!mShowDisplayName && mShowUsername)
setAvatarName( (!fRlvFilter) ? av_name.mUsername : RlvStrings::getAnonym(av_name) );
else
setAvatarName( (!fRlvFilter) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name) );
// NOTE: If you change this, you will break sorting the contacts list
// by username unless you go change the comparator too. -- TS
setAvatarToolTip( (!fRlvFilter) ? av_name.mUsername : RlvStrings::getAnonym(av_name) );
// TODO-RLVa: bit of a hack putting this here. Maybe find a better way?
mAvatarIcon->setDrawTooltip(!fRlvFilter);
// [/RLVa:KB]
//KC - store the username for use in sorting
mUserName = av_name.mUsername;
//requesting the list to resort
notifyParent(LLSD().with("sort", LLSD()));
//update children, because this call tends to effect the size of the name field width
updateChildren();
}
示例5: onAvatarNameCache
void LLCallFloater::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name)
{
LLStringUtil::format_map_t args;
args["[NAME]"] = av_name.getCompleteName();
std::string title = getString("title_peer_2_peer", args);
setTitle(title);
}
示例6: onAvatarNameCache
void LLUrlEntryAgent::onAvatarNameCache(const LLUUID& id,
const LLAvatarName& av_name)
{
std::string label = av_name.getCompleteName();
// received the agent name from the server - tell our observers
callObservers(id.asString(), label, mIcon);
}
示例7: onAvatarNameCache
void LLIMFloater::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name)
{
// Use display name only for labels, as the extended name will be in the
// floater title
std::string ui_title = av_name.getCompleteName();
updateSessionName(ui_title, av_name.mDisplayName);
mTypingStart.setArg("[NAME]", ui_title);
}
示例8: onAvatarNameCache
void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name,
std::string suffix,
LLHandle<LLNameListItem> item)
{
avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(agent_id);
if (it != mAvatarNameCacheConnections.end())
{
if (it->second.connected())
{
it->second.disconnect();
}
mAvatarNameCacheConnections.erase(it);
}
std::string name;
if (mShortNames)
name = av_name.getDisplayName();
else
name = av_name.getCompleteName();
// Append optional suffix.
if (!suffix.empty())
{
name.append(suffix);
}
LLNameListItem* list_item = item.get();
if (list_item && list_item->getUUID() == agent_id)
{
LLScrollListCell* cell = list_item->getColumn(mNameColumnIndex);
if (cell)
{
cell->setValue(name);
setNeedsSort();
}
}
//////////////////////////////////////////////////////////////////////////
// BAKER - FIX NameListCtrl
//if (mPendingLookupsRemaining <= 0)
{
// We might get into a state where mPendingLookupsRemaining might
// go negative. So just reset it right now and figure out if it's
// possible later :)
//mPendingLookupsRemaining = 0;
mNameListCompleteSignal(true);
}
//else
{
// mPendingLookupsRemaining--;
}
//////////////////////////////////////////////////////////////////////////
dirtyColumns();
}
示例9: getPNSName
// get() with callback compatible version of getPNSName
void LLAvatarNameCache::getPNSName(const LLAvatarName& avatar_name, std::string& name)
{
static LLCachedControl<S32> phoenix_name_system("PhoenixNameSystem", 0);
switch (phoenix_name_system)
{
case 0 : name = avatar_name.getLegacyName(); break;
case 1 : name = avatar_name.getCompleteName(); break;
case 2 : name = avatar_name.mDisplayName; break;
default : name = avatar_name.getLegacyName(); break;
}
}
示例10: getPNSName
// get() with callback compatible version of getPNSName
void LLAvatarNameCache::getPNSName(const LLAvatarName& avatar_name, std::string& name, const S32& name_system)
{
switch (name_system)
{
case 0 : name = avatar_name.getLegacyName(); break;
case 1 : name = avatar_name.getCompleteName(); break;
case 2 : name = avatar_name.mDisplayName; break;
case 3 : name = avatar_name.getLegacyName() + (avatar_name.mIsDisplayNameDefault ? "" : " (" + avatar_name.mDisplayName + ")"); break;
default : name = avatar_name.getLegacyName(); break;
}
}
示例11: onAvatarNameLookup
//-TT 2.6.9 merge
//Ansariel name lookup function
void LLNearbyChatHandler::onAvatarNameLookup(const LLUUID& agent_id, const LLAvatarName& av_name, const LLChat& chat_msg)
{
std::string consoleChat;
std::string senderName(chat_msg.mFromName);
std::string prefix = chat_msg.mText.substr(0, 4);
LLStringUtil::toLower(prefix);
//IRC styled /me messages.
bool irc_me = prefix == "/me " || prefix == "/me'";
// Delimiter after a name in header copy/past and in plain text mode
std::string delimiter = ": ";
std::string shout = LLTrans::getString("shout");
std::string whisper = LLTrans::getString("whisper");
if (chat_msg.mChatType == CHAT_TYPE_SHOUT ||
chat_msg.mChatType == CHAT_TYPE_WHISPER ||
chat_msg.mText.compare(0, shout.length(), shout) == 0 ||
chat_msg.mText.compare(0, whisper.length(), whisper) == 0)
{
delimiter = " ";
}
// Don't add any delimiter after name in irc styled messages
if (irc_me || chat_msg.mChatStyle == CHAT_STYLE_IRC)
{
delimiter = LLStringUtil::null;
}
std::string message = irc_me ? chat_msg.mText.substr(3) : chat_msg.mText;
// Get the display name of the sender if required
static LLCachedControl<bool> nameTagShowUsernames(gSavedSettings, "NameTagShowUsernames");
static LLCachedControl<bool> useDisplayNames(gSavedSettings, "UseDisplayNames");
if (!chat_msg.mRlvNamesFiltered)
{
if (nameTagShowUsernames && useDisplayNames)
{
senderName = av_name.getCompleteName();
}
else if (useDisplayNames)
{
senderName = av_name.mDisplayName;
}
}
consoleChat = senderName + delimiter + message;
LLColor4 chatcolor;
LLViewerChat::getChatColor(chat_msg, chatcolor);
gConsole->addConsoleLine(consoleChat, chatcolor);
LLFloaterNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLFloaterNearbyChat>("nearby_chat", LLSD());
if( nearby_chat )
gConsole->setVisible(!nearby_chat->getVisible());
}
示例12: onAvatarNameLookup
// Ansariel: Name lookup callback for chat console output
// FS:LO FIRE-5230 - Chat Console Improvement: Replacing the "IM" in front of group chat messages with the actual group name
//void LLIMHandler::onAvatarNameLookup(const LLUUID& agent_id, const LLAvatarName& av_name, const std::string& message_str)
void LLIMHandler::onAvatarNameLookup(const LLUUID& agent_id, const LLAvatarName& av_name, const std::string& message_str, const std::string& group)
{
std::string senderName;
std::string message(message_str);
std::string delimiter = ": ";
std::string prefix = message.substr(0, 4);
LLStringUtil::toLower(prefix);
// irc styled messages
if (prefix == "/me " || prefix == "/me'")
{
delimiter = LLStringUtil::null;
message = message.substr(3);
}
static LLCachedControl<bool> nameTagShowUsernames(gSavedSettings, "NameTagShowUsernames");
static LLCachedControl<bool> useDisplayNames(gSavedSettings, "UseDisplayNames");
if (nameTagShowUsernames && useDisplayNames)
{
senderName = av_name.getCompleteName();
}
else if (useDisplayNames)
{
senderName = av_name.mDisplayName;
}
else
{
senderName = av_name.getLegacyName();
}
if (rlv_handler_t::isEnabled() && gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
senderName = RlvStrings::getAnonym(senderName);
}
// FS:LO FIRE-5230 - Chat Console Improvement: Replacing the "IM" in front of group chat messages with the actual group name
if(group != "")
{
senderName = "[" + group + "] " + senderName;
}
// FS:LO FIRE-5230 - Chat Console Improvement: Replacing the "IM" in front of group chat messages with the actual group name
LLColor4 textColor = LLUIColorTable::instance().getColor("AgentChatColor");
//color based on contact sets prefs
if(LGGContactSets::getInstance()->hasFriendColorThatShouldShow(agent_id,TRUE))
{
textColor = LGGContactSets::getInstance()->getFriendColor(agent_id);
}
gConsole->addConsoleLine("IM: " + senderName + delimiter + message, textColor);
LLFloaterNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLFloaterNearbyChat>("nearby_chat", LLSD());
gConsole->setVisible(!nearby_chat->getVisible());
}
示例13: callbackLoadAvatarName
// static
void LLFloaterAvatarInfo::callbackLoadAvatarName(const LLUUID& id,
const LLAvatarName& av_name)
{
LLFloaterAvatarInfo *floater = gAvatarInfoInstances.getIfThere(id);
if (floater)
{
// Build a new title including the avatar name.
std::ostringstream title;
//title << first << " " << last << " - " << floater->getTitle();
title << av_name.getCompleteName()<< " - " << floater->getTitle();
floater->setTitle(title.str());
}
}
示例14:
void LLPanelGroupInvite::impl::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name,
void* user_data)
{
impl* selfp = (impl*) user_data;
if (selfp)
{
std::vector<std::string> names;
uuid_vec_t agent_ids;
agent_ids.push_back(agent_id);
names.push_back(av_name.getCompleteName());
selfp->addUsers(names, agent_ids);
}
}
示例15: onAvatarNameCache
void LLUrlEntryAgent::onAvatarNameCache(const LLUUID& id,
const LLAvatarName& av_name)
{
// <FS:Ansariel> FIRE-11330: Names in chat get stuck as "Loading..."
//mAvatarNameCacheConnection.disconnect();
std::pair<avatar_name_cache_connection_map_t::iterator, avatar_name_cache_connection_map_t::iterator> range;
range = mAvatarNameCacheConnections.equal_range(id);
for (avatar_name_cache_connection_map_t::iterator it = range.first; it != range.second; ++it)
{
if (it->second.connected())
{
it->second.disconnect();
}
}
mAvatarNameCacheConnections.erase(range.first, range.second);
// </FS:Ansariel>
std::string label = av_name.getCompleteName();
// received the agent name from the server - tell our observers
callObservers(id.asString(), label, mIcon);
}