From 8992232e64155588c64b4ab29bad6766bc6c7ff6 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 21 May 2010 16:45:35 -0700 Subject: DEV-50013 Display names in mini-map tooltips Reviewed with Leyla --- indra/newview/llnetmap.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'indra/newview/llnetmap.cpp') diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index a8dee8a24a..33d03bd890 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -37,6 +37,7 @@ // Library includes (should move below) #include "indra_constants.h" +#include "llavatarnamecache.h" #include "llmath.h" #include "llfloaterreg.h" #include "llfocusmgr.h" @@ -555,11 +556,14 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask ) // mToolTipMsg = "[AGENT][REGION](Double-click to open Map)" + bool have_agent = false; LLStringUtil::format_map_t args; - std::string fullname; - if(mClosestAgentToCursor.notNull() && gCacheName->getFullName(mClosestAgentToCursor, fullname)) + LLAvatarName av_name; + if(mClosestAgentToCursor.notNull() + && LLAvatarNameCache::get(mClosestAgentToCursor, &av_name)) { - args["[AGENT]"] = fullname + "\n"; + args["[AGENT]"] = av_name.getNameAndSLID() + "\n"; + have_agent = true; } else { @@ -567,7 +571,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask ) } LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( viewPosToGlobal( x, y ) ); - if( region ) + if( region && !have_agent) { args["[REGION]"] = region->getName() + "\n"; } -- cgit v1.2.3 From d674d11f895b8f3d578cded931cdc1c430379c95 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 21 May 2010 17:11:31 -0700 Subject: Rename LLAvatarName::getNameAndSLID() to getCompleteName() Discussed with Leyla/Richard --- indra/newview/llnetmap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llnetmap.cpp') diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 33d03bd890..67b238ad58 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -562,7 +562,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask ) if(mClosestAgentToCursor.notNull() && LLAvatarNameCache::get(mClosestAgentToCursor, &av_name)) { - args["[AGENT]"] = av_name.getNameAndSLID() + "\n"; + args["[AGENT]"] = av_name.getCompleteName() + "\n"; have_agent = true; } else -- cgit v1.2.3