diff options
author | Aimee Linden <aimee@lindenlab.com> | 2010-09-03 17:41:39 +0100 |
---|---|---|
committer | Aimee Linden <aimee@lindenlab.com> | 2010-09-03 17:41:39 +0100 |
commit | ffae589843c2977ae7f70de78d84c936e2a91291 (patch) | |
tree | 497660a88fe55382639dea1b2f3499241127470d /indra/newview/lltoolpie.cpp | |
parent | 63f2ddf377fa0fc6a666cdc1001289335d86258b (diff) | |
parent | 25c29d59cf658acec5901c6f06775add10cf0bfd (diff) |
Post-convert merge by convert_monolith.py from /Users/Aimee/Documents/Work/Linden-Lab/Development/viewer/convert/viewer-identity-evolution
Diffstat (limited to 'indra/newview/lltoolpie.cpp')
-rw-r--r-- | indra/newview/lltoolpie.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index d8be70e546..6c45b7cc60 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -34,6 +34,7 @@ #include "llagent.h" #include "llagentcamera.h" +#include "llavatarnamecache.h" #include "llviewercontrol.h" #include "llfocusmgr.h" //#include "llfirstuse.h" @@ -855,23 +856,40 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l || !existing_inspector->getVisible() || existing_inspector->getKey()["avatar_id"].asUUID() != hover_object->getID()) { - std::string avatar_name; + // IDEVO: try to get display name + username + std::string final_name; + std::string full_name; + if (!gCacheName->getFullName(hover_object->getID(), full_name)) + { LLNameValue* firstname = hover_object->getNVPair("FirstName"); LLNameValue* lastname = hover_object->getNVPair("LastName"); if (firstname && lastname) { - avatar_name = llformat("%s %s", firstname->getString(), lastname->getString()); + full_name = LLCacheName::buildFullName( + firstname->getString(), lastname->getString()); + } + else + { + full_name = LLTrans::getString("TooltipPerson"); + } + } + + LLAvatarName av_name; + if (LLAvatarNameCache::useDisplayNames() && + LLAvatarNameCache::get(hover_object->getID(), &av_name)) + { + final_name = av_name.mDisplayName + " (" + av_name.mUsername + ")"; } else { - avatar_name = LLTrans::getString("TooltipPerson"); + final_name = full_name; } - + // *HACK: We may select this object, so pretend it was clicked mPick = mHoverPick; LLInspector::Params p; p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>()); - p.message(avatar_name); + p.message(final_name); p.image.name("Inspector_I"); p.click_callback(boost::bind(showAvatarInspector, hover_object->getID())); p.visible_time_near(6.f); |