sources/interface.cpp

branch
protocol5
changeset 78
c1d43ade656e
parent 73
07dda51a7a8e
child 80
f992b027374b
--- a/sources/interface.cpp	Fri May 15 21:43:21 2015 +0300
+++ b/sources/interface.cpp	Fri May 15 22:46:53 2015 +0300
@@ -378,17 +378,7 @@
 		mvhline (y, x, ' ', width);
 
 		if (i < PlayerNames.size())
-		{
-			String displaynick = PlayerNames[i];
-
-			if (displaynick.length() > width)
-			{
-				displaynick = displaynick.mid (0, width - 3);
-				displaynick += "...";
-			}
-
-			mvprintw (y, x, "%s", displaynick.chars());
-		}
+			render_colorline (y, x, width, PlayerNames[i], false);
 
 		y++;
 	}
@@ -936,7 +926,16 @@
 //
 void Interface::set_player_names (const StringList& names)
 {
-	PlayerNames = names;
+	PlayerNames.clear();
+
+	for (const String& name : names)
+	{
+		ColoredLine coloredname;
+		coloredname.add_string (name);
+		coloredname.finalize();
+		PlayerNames.append (coloredname);
+	}
+
 	NeedNicklistRender = true;
 }
 

mercurial