From ae109e01799d9270e9caa54761c7e3496b87ad1f Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Tue, 22 Sep 2009 08:18:22 -0700 Subject: Applied Jacek's patch to show number of avatars in world map --- linden/indra/newview/llworldmapview.cpp | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'linden/indra/newview/llworldmapview.cpp') diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp index 5e51e6f..2b22b9d 100644 --- a/linden/indra/newview/llworldmapview.cpp +++ b/linden/indra/newview/llworldmapview.cpp @@ -651,6 +651,33 @@ void LLWorldMapView::draw() { mesg = llformat( "%s (%s)", info->mName.c_str(), sStringsMap["offline"].c_str()); } + else if (gSavedSettings.getBOOL("MapShowAgentCount") && gSavedSettings.getBOOL("MapShowPeople")) + { + // Display the agent count after the region name + S32 agent_count = LLWorldMap::getInstance()->mNumAgents[handle]; + LLViewerRegion *region = gAgent.getRegion(); + + if (region && region->getHandle() == info->mHandle) + { + ++agent_count; // Bump by 1 if we're in this region + } + + if (agent_count > 0) + { + //TODO: move this and the tooltip strings into XML + std::string count = llformat("%d %s", agent_count, agent_count > 1 ? "avatars" : "avatar"); + font->renderUTF8( + count, 0, + llfloor(left + 3), + llfloor(bottom + 20), + LLColor4::white, + LLFontGL::LEFT, + LLFontGL::BASELINE, + LLFontGL::DROP_SHADOW); + + mesg = info->mName; + } + } else { mesg = info->mName; @@ -1161,11 +1188,11 @@ BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* stic if (agent_count == 1) { - message += "person"; + message += "avatar"; } else { - message += "people"; + message += "avatars"; } } } -- cgit v1.1