From aa1fc0d6e16a0c89f276f5c1b7ef2de10fc5800f Mon Sep 17 00:00:00 2001
From: McCabe Maxsted
Date: Fri, 2 Oct 2009 02:36:21 -0700
Subject: Draw selected avatars last (and fixed silver skin missing selection
 color)

---
 linden/indra/newview/llnetmap.cpp                  | 31 ++++++++++++++++++----
 linden/indra/newview/skins/default/colors_base.xml |  2 +-
 linden/indra/newview/skins/silver/colors_base.xml  |  1 +
 3 files changed, 28 insertions(+), 6 deletions(-)

(limited to 'linden')

diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp
index f055dbc..dc4a4ae 100644
--- a/linden/indra/newview/llnetmap.cpp
+++ b/linden/indra/newview/llnetmap.cpp
@@ -345,7 +345,7 @@ void LLNetMap::draw()
 		LLColor4 muted_color = gColors.getColor( "MapMuted" );
 		LLColor4 selected_color = gColors.getColor( "MapSelected" );
 		LLColor4 glyph_color;
-		F32 glyph_radius;
+		int selected = -1;
 
 		std::vector<LLUUID> avatar_ids;
 		std::vector<LLVector3d> positions;
@@ -356,14 +356,14 @@ void LLNetMap::draw()
 			// just be careful to sort the avatar IDs along with the positions. -MG
 			pos_map = globalPosToView(positions[i], rotate_map);
 			
+			// Save this entry to draw last
 			if (LLFloaterMap::getSelected() == avatar_ids[i])
 			{
-				glyph_radius = mDotRadius * 1.7f;
-				glyph_color = selected_color;
+				selected = i;
+				continue;
 			}
 			else
 			{
-				glyph_radius = mDotRadius;
 				// Show them muted even if they're friends
 				if (LLMuteList::getInstance()->isMuted(avatar_ids[i]))
 				{
@@ -392,7 +392,7 @@ void LLNetMap::draw()
 				pos_map.mV[VX], pos_map.mV[VY], 
 				glyph_color, 
 				pos_map.mV[VZ],
-				glyph_radius);
+				mDotRadius);
 
 			F32	dist_to_cursor = dist_vec(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), LLVector2(local_mouse_x,local_mouse_y));
 			if(dist_to_cursor < min_pick_dist && dist_to_cursor < closest_dist)
@@ -402,6 +402,27 @@ void LLNetMap::draw()
 			}
 		}
 
+		// Draw dot for selected avatar last
+		if (selected >= 0)
+		{
+			pos_map = globalPosToView(positions[selected], rotate_map);
+			F32 glyph_radius = mDotRadius * 1.7f;
+			glyph_color = selected_color;
+
+			LLWorldMapView::drawAvatar(
+				pos_map.mV[VX], pos_map.mV[VY], 
+				glyph_color, 
+				pos_map.mV[VZ],
+				glyph_radius);
+
+			F32	dist_to_cursor = dist_vec(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), LLVector2(local_mouse_x,local_mouse_y));
+			if(dist_to_cursor < min_pick_dist && dist_to_cursor < closest_dist)
+			{
+				closest_dist = dist_to_cursor;
+				mClosestAgentToCursor = avatar_ids[selected];
+			}
+		}
+
 		// Draw dot for autopilot target
 		if (gAgent.getAutoPilot())
 		{
diff --git a/linden/indra/newview/skins/default/colors_base.xml b/linden/indra/newview/skins/default/colors_base.xml
index 8f0fc29..854c027 100644
--- a/linden/indra/newview/skins/default/colors_base.xml
+++ b/linden/indra/newview/skins/default/colors_base.xml
@@ -162,7 +162,7 @@
 <MapAvatar value="0, 255, 0, 255" />                    <!-- Your avatar's glyph color -->
 <MapFriend value="255, 255, 0, 255" />                  <!-- Your friends' glyph color -->
 <MapMuted value="128, 128, 128, 255" />                 <!-- Muted avatars' glyph color -->
-<MapSelected value="255, 0, 0, 255" />                 <!-- Selected avatars' glyph color -->
+<MapSelected value="255, 0, 0, 255" />                  <!-- Selected avatars' glyph color -->
   
   <!-- MINI-MAP -->
 <NetMapBackgroundColor value="0, 0, 0, 77" />           <!-- Mini-map floater background -->
diff --git a/linden/indra/newview/skins/silver/colors_base.xml b/linden/indra/newview/skins/silver/colors_base.xml
index 6a94489..f129230 100644
--- a/linden/indra/newview/skins/silver/colors_base.xml
+++ b/linden/indra/newview/skins/silver/colors_base.xml
@@ -162,6 +162,7 @@
 <MapAvatar value="0, 255, 0, 255" />                    <!-- Your avatar's glyph color -->
 <MapFriend value="255, 255, 0, 255" />                  <!-- Your friends' glyph color -->
 <MapMuted value="128, 128, 128, 255" />                 <!-- Muted avatars' glyph color -->
+<MapSelected value="255, 0, 0, 255" />                  <!-- Selected avatars' glyph color -->
  
 <!-- MINI-MAP -->
 <NetMapBackgroundColor value="0, 0, 0, 77" />           <!-- Mini-map floater background -->
-- 
cgit v1.1