aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llworldmapview.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-09-23 02:29:44 -0500
committerJacek Antonelli2009-09-23 02:29:44 -0500
commitcd2b97b3e6446449443700ae9a1521c402c93850 (patch)
tree0c45e5a05cdcb6956fb859c9fef834a5c5613a04 /linden/indra/newview/llworldmapview.cpp
parentCommented out Linux tarball building. (diff)
parentDisplay selected avatars larger than normal, zoom in at a reasonable speed. I... (diff)
downloadmeta-impy-cd2b97b3e6446449443700ae9a1521c402c93850.zip
meta-impy-cd2b97b3e6446449443700ae9a1521c402c93850.tar.gz
meta-impy-cd2b97b3e6446449443700ae9a1521c402c93850.tar.bz2
meta-impy-cd2b97b3e6446449443700ae9a1521c402c93850.tar.xz
Merge remote branch 'mccabe/1.2.0-next' into next
Conflicts: linden/indra/newview/llfloaterchat.cpp linden/indra/newview/llfloatermap.cpp linden/indra/newview/llinventorybridge.cpp linden/indra/newview/llnetmap.cpp linden/indra/newview/llviewermessage.cpp linden/indra/newview/llviewerobjectlist.cpp
Diffstat (limited to 'linden/indra/newview/llworldmapview.cpp')
-rw-r--r--linden/indra/newview/llworldmapview.cpp69
1 files changed, 54 insertions, 15 deletions
diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp
index 5e51e6f..947bdfd 100644
--- a/linden/indra/newview/llworldmapview.cpp
+++ b/linden/indra/newview/llworldmapview.cpp
@@ -71,9 +71,10 @@ const S32 SCROLL_HINT_WIDTH = 65;
71const F32 BIG_DOT_RADIUS = 5.f; 71const F32 BIG_DOT_RADIUS = 5.f;
72BOOL LLWorldMapView::sHandledLastClick = FALSE; 72BOOL LLWorldMapView::sHandledLastClick = FALSE;
73 73
74LLUIImagePtr LLWorldMapView::sAvatarYouSmallImage = NULL;
75LLUIImagePtr LLWorldMapView::sAvatarSmallImage = NULL; 74LLUIImagePtr LLWorldMapView::sAvatarSmallImage = NULL;
76LLUIImagePtr LLWorldMapView::sAvatarLargeImage = NULL; 75LLUIImagePtr LLWorldMapView::sAvatarYouImage = NULL;
76LLUIImagePtr LLWorldMapView::sAvatarYouLargeImage = NULL;
77LLUIImagePtr LLWorldMapView::sAvatarLevelImage = NULL;
77LLUIImagePtr LLWorldMapView::sAvatarAboveImage = NULL; 78LLUIImagePtr LLWorldMapView::sAvatarAboveImage = NULL;
78LLUIImagePtr LLWorldMapView::sAvatarBelowImage = NULL; 79LLUIImagePtr LLWorldMapView::sAvatarBelowImage = NULL;
79 80
@@ -113,11 +114,12 @@ std::map<std::string,std::string> LLWorldMapView::sStringsMap;
113 114
114void LLWorldMapView::initClass() 115void LLWorldMapView::initClass()
115{ 116{
116 sAvatarYouSmallImage = LLUI::getUIImage("map_avatar_you_8.tga");
117 sAvatarSmallImage = LLUI::getUIImage("map_avatar_8.tga"); 117 sAvatarSmallImage = LLUI::getUIImage("map_avatar_8.tga");
118 sAvatarLargeImage = LLUI::getUIImage("map_avatar_16.tga"); 118 sAvatarYouImage = LLUI::getUIImage("map_avatar_16.tga");
119 sAvatarAboveImage = LLUI::getUIImage("map_avatar_above_8.tga"); 119 sAvatarYouLargeImage = LLUI::getUIImage("map_avatar_you_32.tga");
120 sAvatarBelowImage = LLUI::getUIImage("map_avatar_below_8.tga"); 120 sAvatarLevelImage = LLUI::getUIImage("map_avatar_32.tga");
121 sAvatarAboveImage = LLUI::getUIImage("map_avatar_above_32.tga");
122 sAvatarBelowImage = LLUI::getUIImage("map_avatar_below_32.tga");
121 123
122 sHomeImage = LLUI::getUIImage("map_home.tga"); 124 sHomeImage = LLUI::getUIImage("map_home.tga");
123 sTelehubImage = LLUI::getUIImage("map_telehub.tga"); 125 sTelehubImage = LLUI::getUIImage("map_telehub.tga");
@@ -137,9 +139,10 @@ void LLWorldMapView::initClass()
137// static 139// static
138void LLWorldMapView::cleanupClass() 140void LLWorldMapView::cleanupClass()
139{ 141{
140 sAvatarYouSmallImage = NULL;
141 sAvatarSmallImage = NULL; 142 sAvatarSmallImage = NULL;
142 sAvatarLargeImage = NULL; 143 sAvatarYouImage = NULL;
144 sAvatarYouLargeImage = NULL;
145 sAvatarLevelImage = NULL;
143 sAvatarAboveImage = NULL; 146 sAvatarAboveImage = NULL;
144 sAvatarBelowImage = NULL; 147 sAvatarBelowImage = NULL;
145 148
@@ -606,7 +609,11 @@ void LLWorldMapView::draw()
606 gGL.end(); 609 gGL.end();
607 } 610 }
608 611
609 // If this is mature, and you are not, draw a line across it 612 // As part of the AO project, we no longer want to draw access indicators;
613 // it's too complicated to get all the rules straight and will only
614 // cause confusion.
615 /**********************
616 // If this is mature, and you are not, draw a line across it
610 if (info->mAccess != SIM_ACCESS_DOWN 617 if (info->mAccess != SIM_ACCESS_DOWN
611 && info->mAccess > SIM_ACCESS_PG 618 && info->mAccess > SIM_ACCESS_PG
612 && gAgent.isTeen()) 619 && gAgent.isTeen())
@@ -622,6 +629,7 @@ void LLWorldMapView::draw()
622 gGL.vertex2f(right, top); 629 gGL.vertex2f(right, top);
623 gGL.end(); 630 gGL.end();
624 } 631 }
632 **********************/
625 633
626 // Draw the region name in the lower left corner 634 // Draw the region name in the lower left corner
627 LLFontGL* font = LLFontGL::sSansSerifSmall; 635 LLFontGL* font = LLFontGL::sSansSerifSmall;
@@ -651,6 +659,33 @@ void LLWorldMapView::draw()
651 { 659 {
652 mesg = llformat( "%s (%s)", info->mName.c_str(), sStringsMap["offline"].c_str()); 660 mesg = llformat( "%s (%s)", info->mName.c_str(), sStringsMap["offline"].c_str());
653 } 661 }
662 else if (gSavedSettings.getBOOL("MapShowAgentCount") && gSavedSettings.getBOOL("MapShowPeople"))
663 {
664 // Display the agent count after the region name
665 S32 agent_count = LLWorldMap::getInstance()->mNumAgents[handle];
666 LLViewerRegion *region = gAgent.getRegion();
667
668 if (region && region->getHandle() == info->mHandle)
669 {
670 ++agent_count; // Bump by 1 if we're in this region
671 }
672
673 if (agent_count > 0)
674 {
675 //TODO: move this and the tooltip strings into XML
676 std::string count = llformat("%d %s", agent_count, agent_count > 1 ? "avatars" : "avatar");
677 font->renderUTF8(
678 count, 0,
679 llfloor(left + 3),
680 llfloor(bottom + 20),
681 LLColor4::white,
682 LLFontGL::LEFT,
683 LLFontGL::BASELINE,
684 LLFontGL::DROP_SHADOW);
685
686 mesg = info->mName;
687 }
688 }
654 else 689 else
655 { 690 {
656 mesg = info->mName; 691 mesg = info->mName;
@@ -732,7 +767,7 @@ void LLWorldMapView::draw()
732 767
733 // Now draw your avatar after all that other stuff. 768 // Now draw your avatar after all that other stuff.
734 LLVector3d pos_global = gAgent.getPositionGlobal(); 769 LLVector3d pos_global = gAgent.getPositionGlobal();
735 drawImage(pos_global, sAvatarLargeImage); 770 drawImage(pos_global, sAvatarYouImage);
736 771
737 LLVector3 pos_map = globalPosToView(pos_global); 772 LLVector3 pos_map = globalPosToView(pos_global);
738 if (!pointInView(llround(pos_map.mV[VX]), llround(pos_map.mV[VY]))) 773 if (!pointInView(llround(pos_map.mV[VX]), llround(pos_map.mV[VY])))
@@ -1161,11 +1196,11 @@ BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* stic
1161 1196
1162 if (agent_count == 1) 1197 if (agent_count == 1)
1163 { 1198 {
1164 message += "person"; 1199 message += "avatar";
1165 } 1200 }
1166 else 1201 else
1167 { 1202 {
1168 message += "people"; 1203 message += "avatars";
1169 } 1204 }
1170 } 1205 }
1171 } 1206 }
@@ -1241,7 +1276,7 @@ void LLWorldMapView::drawAvatar(F32 x_pixels,
1241 F32 dot_radius) 1276 F32 dot_radius)
1242{ 1277{
1243 const F32 HEIGHT_THRESHOLD = 7.f; 1278 const F32 HEIGHT_THRESHOLD = 7.f;
1244 LLUIImagePtr dot_image = sAvatarSmallImage; 1279 LLUIImagePtr dot_image = sAvatarLevelImage;
1245 if(relative_z < -HEIGHT_THRESHOLD) 1280 if(relative_z < -HEIGHT_THRESHOLD)
1246 { 1281 {
1247 dot_image = sAvatarBelowImage; 1282 dot_image = sAvatarBelowImage;
@@ -1250,9 +1285,13 @@ void LLWorldMapView::drawAvatar(F32 x_pixels,
1250 { 1285 {
1251 dot_image = sAvatarAboveImage; 1286 dot_image = sAvatarAboveImage;
1252 } 1287 }
1288
1289 S32 dot_width = llround(dot_radius * 2.f);
1253 dot_image->draw( 1290 dot_image->draw(
1254 llround(x_pixels) - dot_image->getWidth()/2, 1291 llround(x_pixels - dot_radius),
1255 llround(y_pixels) - dot_image->getHeight()/2, 1292 llround(y_pixels - dot_radius),
1293 dot_width,
1294 dot_width,
1256 color); 1295 color);
1257} 1296}
1258 1297