sources/interface.cpp

changeset 132
8a4690db252e
parent 128
e5d185b62b7f
child 137
485cb6d6b98c
child 133
4d8fa5394d67
--- a/sources/interface.cpp	Mon Jan 11 16:58:59 2016 +0200
+++ b/sources/interface.cpp	Fri May 15 22:46:53 2015 +0300
@@ -392,17 +392,7 @@
 		mvhline (y, x, ' ', width);
 
 		if (i < m_playerNames.size())
-		{
-			String displaynick = m_playerNames[i];
-
-			if (displaynick.length() > width)
-			{
-				displaynick = displaynick.mid (0, width - 3);
-				displaynick += "...";
-			}
-
-			mvprintw (y, x, "%s", displaynick.chars());
-		}
+			render_colorline (y, x, width, m_playerNames[i], false);
 
 		y++;
 	}
@@ -1029,7 +1019,16 @@
 //
 void Interface::set_player_names (const StringList& names)
 {
-	m_playerNames = names;
+	m_playerNames.clear();
+
+	for (const String& name : names)
+	{
+		ColoredLine coloredname;
+		coloredname.add_string (name);
+		coloredname.finalize();
+		m_playerNames.append (coloredname);
+	}
+
 	m_needNicklistRender = true;
 }
 

mercurial