r4740 - in branches/nexuiz-2.0: . data/gfx data/qcsrc/client data/qcsrc/menu/nexuiz data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Oct 13 09:12:10 EDT 2008


Author: div0
Date: 2008-10-13 09:12:10 -0400 (Mon, 13 Oct 2008)
New Revision: 4740

Added:
   branches/nexuiz-2.0/data/gfx/sb_playercolor_base.tga
   branches/nexuiz-2.0/data/gfx/sb_playercolor_pants.tga
   branches/nexuiz-2.0/data/gfx/sb_playercolor_shirt.tga
Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/qcsrc/client/Main.qc
   branches/nexuiz-2.0/data/qcsrc/client/View.qc
   branches/nexuiz-2.0/data/qcsrc/client/main.qh
   branches/nexuiz-2.0/data/qcsrc/client/miscfunctions.qc
   branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup.c
   branches/nexuiz-2.0/data/qcsrc/server/vote.qc
Log:
r4734 | div0 | 2008-10-12 18:47:41 +0200 (Sun, 12 Oct 2008) | 4 lines
sbar: add columns:
- "color": player color icon (SOME graphics guy has to make usable ones)
- "frags": always kills - suicides (synthetic column), if there is no real "frags" column
r4735 | div0 | 2008-10-12 20:01:48 +0200 (Sun, 12 Oct 2008) | 2 lines
as the players do not use shirt/pants right, rename it to first/second color :(
r4736 | div0 | 2008-10-13 08:04:55 +0200 (Mon, 13 Oct 2008) | 2 lines
try to improve player networking: let playerchecker do ALL the work for adding/removing players, and let scores updates JUST set the scores. Scores might come before the player, though, and a PL affected player can still get wrong scores for a short while even if networking is fixed, but well, that's PL.
r4737 | div0 | 2008-10-13 11:05:38 +0200 (Mon, 13 Oct 2008) | 2 lines
fteqcc sucks
r4738 | div0 | 2008-10-13 13:44:13 +0200 (Mon, 13 Oct 2008) | 2 lines
detect changes on teamplay cvar (in case that gets received after the scores info)
r4739 | div0 | 2008-10-13 15:05:55 +0200 (Mon, 13 Oct 2008) | 2 lines
fix map validation for chmap

Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2008-10-13 13:05:55 UTC (rev 4739)
+++ branches/nexuiz-2.0/.patchsets	2008-10-13 13:12:10 UTC (rev 4740)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-4732
+revisions_applied = 1-4739

Copied: branches/nexuiz-2.0/data/gfx/sb_playercolor_base.tga (from rev 4739, trunk/data/gfx/sb_playercolor_base.tga)
===================================================================
(Binary files differ)

Copied: branches/nexuiz-2.0/data/gfx/sb_playercolor_pants.tga (from rev 4739, trunk/data/gfx/sb_playercolor_pants.tga)
===================================================================
(Binary files differ)

Copied: branches/nexuiz-2.0/data/gfx/sb_playercolor_shirt.tga (from rev 4739, trunk/data/gfx/sb_playercolor_shirt.tga)
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/qcsrc/client/Main.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/Main.qc	2008-10-13 13:05:55 UTC (rev 4739)
+++ branches/nexuiz-2.0/data/qcsrc/client/Main.qc	2008-10-13 13:12:10 UTC (rev 4740)
@@ -194,33 +194,35 @@
 void Playerchecker_Think()
 {
 	float i;
+	entity e;
 	for(i = 0; i < maxclients; ++i)
 	{
+		e = playerslots[i];
 		if(getplayerkey(i, "name") == "")
 		{
-			if(playerslots[i].sort_prev)
+			if(e.sort_prev)
 			{
 				//print("playerchecker: KILL KILL KILL\n");
 				// player disconnected
-				SetTeam(playerslots[i], -1);
-				RemovePlayer(playerslots[i]);
-				playerslots[i].sort_prev = world;
-				playerslots[i].gotscores = 0;
+				SetTeam(e, -1);
+				RemovePlayer(e);
+				e.sort_prev = world;
+				//e.gotscores = 0;
 			}
 		}
 		else
 		{
-			if not(playerslots[i].sort_prev)
+			if not(e.sort_prev)
 			{
 				//print("playerchecker: SPAWN SPAWN SPAWN\n");
 				// player connected
-				if not(playerslots[i])
-					playerslots[i] = spawn();
-				playerslots[i].sv_entnum = i;
-				playerslots[i].gotscores = 0;
-				SetTeam(playerslots[i], COLOR_SPECTATOR);
-				RegisterPlayer(playerslots[i]);
-				Sbar_UpdatePlayerPos(playerslots[i]);
+				if not(e)
+					playerslots[i] = e = spawn();
+				e.sv_entnum = i;
+				//e.gotscores = 0; // we might already have the scores...
+				SetTeam(e, GetPlayerColor(i)); // will not hurt; later updates come with Sbar_UpdatePlayerTeams
+				RegisterPlayer(e);
+				Sbar_UpdatePlayerPos(e);
 			}
 		}
 	}
@@ -363,7 +365,7 @@
 void Ent_Remove();
 void Ent_ReadPlayerScore()
 {
-	float i, Team, n;
+	float i, n;
 	float isNew;
 	entity o;
 
@@ -383,17 +385,16 @@
 #endif
 
 	self.sv_entnum = n;
-	Team = GetPlayerColor(self.sv_entnum);
 
 	if not(playerslots[self.sv_entnum])
 		playerslots[self.sv_entnum] = spawn();
 	o = self.owner = playerslots[self.sv_entnum];
 	o.sv_entnum = self.sv_entnum;
 	o.gotscores = 1;
-	if not(o.sort_prev)
-		RegisterPlayer(o);
 
-	SetTeam(o, Team);
+	//if not(o.sort_prev)
+	//	RegisterPlayer(o);
+	//playerchecker will do this for us later, if it has not already done so
 
 #if MAX_SCORE <= 3
 	for(i = 0; i < MAX_SCORE; ++i)
@@ -411,7 +412,8 @@
 			o.(scores[i]) = ReadShort();
 #endif
 
-	Sbar_UpdatePlayerPos(o);
+	if(o.sort_prev)
+		Sbar_UpdatePlayerPos(o); // if not registered, we cannot do this yet!
 }
 
 void Ent_ReadTeamScore()
@@ -500,6 +502,7 @@
 // with others, make sure it can no longer do so.
 void Ent_Remove()
 {
+	float i;
 	if(self.enttype == ENT_CLIENT_ENTCS)
 	{
 		Ent_RemoveEntCS();
@@ -508,9 +511,9 @@
 		if(self.owner)
 		{
 			SetTeam(self.owner, -1);
-			if(self.owner.sort_prev)
-				RemovePlayer(self.owner);
-			self.owner.sort_prev = NULL;
+			self.owner.gotscores = 0;
+			for(i = 0; i < MAX_SCORE; ++i)
+				self.owner.(scores[i]) = 0; // clear all scores
 		}
 	} else if(self.enttype == ENT_CLIENT_TEAMSCORES)
 	{

Modified: branches/nexuiz-2.0/data/qcsrc/client/View.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/View.qc	2008-10-13 13:05:55 UTC (rev 4739)
+++ branches/nexuiz-2.0/data/qcsrc/client/View.qc	2008-10-13 13:12:10 UTC (rev 4740)
@@ -193,6 +193,7 @@
 {
 	entity e;
 	float fov;
+	float f;
 	dprint_load();
 	WaypointSprite_Load();
 
@@ -256,7 +257,12 @@
 	sbar_alpha_fg = cvar("sbar_alpha_fg" );
 	sbar_hudselector = cvar("sbar_hudselector");
 	activeweapon = getstati(STAT_SWITCHWEAPON);
-	teamplay = cvar("teamplay");
+	f = cvar("teamplay");
+	if(f != teamplay)
+	{
+		teamplay = f;
+		Sbar_InitScores();
+	}
 
 	if(last_weapon != activeweapon) {
 		weapontime = time;

Modified: branches/nexuiz-2.0/data/qcsrc/client/main.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/main.qh	2008-10-13 13:05:55 UTC (rev 4739)
+++ branches/nexuiz-2.0/data/qcsrc/client/main.qh	2008-10-13 13:12:10 UTC (rev 4740)
@@ -74,6 +74,8 @@
 #define SP_KDRATIO -4
 #define SP_CLRATIO -5
 #define SP_PL -6
+#define SP_COLOR -7
+#define SP_FRAGS -8
 
 #define SP_SEPARATOR -100
 

Modified: branches/nexuiz-2.0/data/qcsrc/client/miscfunctions.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/miscfunctions.qc	2008-10-13 13:05:55 UTC (rev 4739)
+++ branches/nexuiz-2.0/data/qcsrc/client/miscfunctions.qc	2008-10-13 13:12:10 UTC (rev 4740)
@@ -3,9 +3,31 @@
 entity players;
 entity teams;
 
+void AuditLists()
+{
+	entity e;
+	entity prev;
+
+	prev = players;
+	for(e = prev.sort_next; e; prev = e, e = e.sort_next)
+	{
+		if(prev != e.sort_prev)
+			error(strcat("sort list chain error\nplease submit the output of 'prvm_edicts client' to the developers"));
+	}
+
+	prev = teams;
+	for(e = prev.sort_next; e; prev = e, e = e.sort_next)
+	{
+		if(prev != e.sort_prev)
+			error(strcat("sort list chain error\nplease submit the output of 'prvm_edicts client' to the developers"));
+	}
+}
+
+
 float RegisterPlayer(entity player)
 {
 	entity pl;
+	AuditLists();
 	for(pl = players.sort_next; pl; pl = pl.sort_next)
 		if(pl == player)
 			error("Player already registered!");
@@ -14,12 +36,14 @@
 	if(players.sort_next)
 		players.sort_next.sort_prev = player;
 	players.sort_next = player;
+	AuditLists();
 	return true;
 }
 
 void RemovePlayer(entity player)
 {
 	entity pl, parent;
+	AuditLists();
 	parent = players;
 	for(pl = players.sort_next; pl && pl != player; pl = pl.sort_next)
 		parent = pl;
@@ -32,16 +56,19 @@
 	parent.sort_next = player.sort_next;
 	if(player.sort_next)
 		player.sort_next.sort_prev = parent;
+	AuditLists();
 }
 
 void MoveToLast(entity e)
 {
+	AuditLists();
 	other = e.sort_next;
 	while(other)
 	{
 		SORT_SWAP(other, e);
 		other = e.sort_next;
 	}
+	AuditLists();
 }
 
 // warning: Local "team" defined with name of a global
@@ -49,6 +76,7 @@
 float RegisterTeam(entity Team)
 {
 	entity tm;
+	AuditLists();
 	for(tm = teams.sort_next; tm; tm = tm.sort_next)
 		if(tm == Team)
 			error("Team already registered!");
@@ -57,12 +85,14 @@
 	if(teams.sort_next)
 		teams.sort_next.sort_prev = Team;
 	teams.sort_next = Team;
+	AuditLists();
 	return true;
 }
 
 void RemoveTeam(entity Team)
 {
 	entity tm, parent;
+	AuditLists();
 	parent = teams;
 	for(tm = teams.sort_next; tm && tm != Team; tm = tm.sort_next)
 		parent = tm;
@@ -75,6 +105,7 @@
 	parent.sort_next = Team.sort_next;
 	if(Team.sort_next)
 		Team.sort_next.sort_prev = parent;
+	AuditLists();
 }
 
 entity GetTeam(float Team, float add)

Modified: branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2008-10-13 13:05:55 UTC (rev 4739)
+++ branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2008-10-13 13:12:10 UTC (rev 4740)
@@ -216,6 +216,11 @@
 	float vl, vr;
 	vl = GetPlayerColor(left.sv_entnum);
 	vr = GetPlayerColor(right.sv_entnum);
+
+	if(!left.gotscores)
+		vl = COLOR_SPECTATOR;
+	if(!right.gotscores)
+		vr = COLOR_SPECTATOR;
 	
 	if(vl > vr)
 		return true;
@@ -332,6 +337,9 @@
 	print("of game types, then a slash, to make the field show up only in these\n");
 	print("or in all but these game types.\n");
 
+	print("The special game type names 'teams' and 'noteams' can be used to\n");
+	print("include/exclude ALL teams/noteams game modes.\n");
+
 	local float i;
 	print("Additional columns:\n");
 	for(i = 0; i < MAX_SCORE; ++i)
@@ -346,13 +354,18 @@
 
 string Sbar_DefaultColumnLayout()
 {
-	return "ping pl name | -ctf,kh/kills -ctf,kh/deaths +kh/caps +kh/pushes +kh/destroyed +ctf/caps +ctf/pickups +ctf/fckills +ctf/returns -lms/score";
+	return strcat( // fteqcc sucks
+		"ping pl color name | ",
+		"+noteams/kills +noteams/deaths +noteams/suicides -noteams,tdm/frags ", // tdm already has this in "score"
+		"+kh/caps +kh/pushes +kh/destroyed ",
+		"+ctf/caps +ctf/pickups +ctf/fckills +ctf/returns ",
+		"-lms/score");
 }
 
 void Cmd_Sbar_SetFields(float argc)
 {
 	float i, j, slash;
-	string str, pattern, subpattern;
+	string str, pattern, subpattern, subpattern2;
 	float digit;
 	float have_name, have_primary, have_secondary, have_separator;
 	float missing;
@@ -371,7 +384,7 @@
 		else if(argv(1) == "all")
 		{
 			string s;
-			s = "ping pl name |";
+			s = "ping pl color name |";
 			for(i = 0; i < MAX_SCORE; ++i)
 			{
 				if(i != ps_primary)
@@ -394,6 +407,10 @@
 	digit = stringwidth("0123456789", FALSE) / 10;
 
 	subpattern = strcat(",", GametypeNameFromType(gametype), ",");
+	if(teamplay)
+		subpattern2 = ",teams,";
+	else
+		subpattern2 = ",noteams,";
 
 	argc = min(argc-1, MAX_SBAR_FIELDS-1);
 	for(i = 0; i < argc; ++i)
@@ -411,12 +428,15 @@
 				pattern = substring(pattern, 1, strlen(pattern) - 1);
 				if(strstrofs(strcat(",", pattern, ","), subpattern, 0) >= 0)
 					continue;
+				if(strstrofs(strcat(",", pattern, ","), subpattern2, 0) >= 0)
+					continue;
 			}
 			else
 			{
 				if(substring(pattern, 0, 1) == "+")
 					pattern = substring(pattern, 1, strlen(pattern) - 1);
 				if(strstrofs(strcat(",", pattern, ","), subpattern, 0) < 0)
+				if(strstrofs(strcat(",", pattern, ","), subpattern2, 0) < 0)
 					continue;
 			}
 		}
@@ -432,6 +452,11 @@
 			sbar_field[sbar_num_fields] = SP_PL;
 		} else if(str == "kd" || str == "kdr" || str == "kdratio" || str == "k/d") {
 			sbar_field[sbar_num_fields] = SP_KDRATIO;
+		} else if(str == "color") {
+			if(!teamplay)
+				sbar_field[sbar_num_fields] = SP_COLOR;
+			else
+				continue; // can't put this column in teamplay, it is redundant and stupid
 		} else if(str == "name" || str == "nick") {
 			sbar_field[sbar_num_fields] = SP_NAME;
 			sbar_size[sbar_num_fields] = MIN_NAMELEN; // minimum size? any use?
@@ -444,8 +469,15 @@
 				if(str == strtolower(scores_label[j]))
 					goto found; // sorry, but otherwise fteqcc -O3 miscompiles this and warns about "unreachable code"
 :notfound
-			print(strcat("^1Error:^7 Unknown score field: '", str, "'\n"));
-			continue;
+			if(str == "frags")
+			{
+				j = SP_FRAGS;
+			}
+			else
+			{
+				print(strcat("^1Error:^7 Unknown score field: '", str, "'\n"));
+				continue;
+			}
 :found
 			sbar_field[sbar_num_fields] = j;
 			if(j == ps_primary)
@@ -533,11 +565,29 @@
 
 // MOVEUP::
 vector sbar_field_rgb;
+string sbar_field_icon0;
+string sbar_field_icon1;
+string sbar_field_icon2;
+vector sbar_field_icon0_rgb;
+vector sbar_field_icon1_rgb;
+vector sbar_field_icon2_rgb;
+float sbar_field_icon0_alpha;
+float sbar_field_icon1_alpha;
+float sbar_field_icon2_alpha;
 string Sbar_GetField(entity pl, float field)
 {
 	float tmp, num, denom, f;
 	string str;
 	sbar_field_rgb = '1 1 1';
+	sbar_field_icon0 = "";
+	sbar_field_icon1 = "";
+	sbar_field_icon2 = "";
+	sbar_field_icon0_rgb = '1 1 1';
+	sbar_field_icon1_rgb = '1 1 1';
+	sbar_field_icon2_rgb = '1 1 1';
+	sbar_field_icon0_alpha = 1;
+	sbar_field_icon1_alpha = 1;
+	sbar_field_icon2_alpha = 1;
 	switch(field)
 	{
 		case SP_PING:
@@ -563,6 +613,20 @@
 		case SP_NAME:
 			return getplayerkey(pl.sv_entnum, "name");
 
+		case SP_FRAGS:
+			f = pl.(scores[SP_KILLS]);
+			f -= pl.(scores[SP_SUICIDES]);
+			return ftos(f);
+
+		case SP_COLOR:
+			f = stof(getplayerkey(pl.sv_entnum, "colors"));
+			sbar_field_icon0 = "gfx/sb_playercolor_base";
+			sbar_field_icon1 = "gfx/sb_playercolor_shirt";
+			sbar_field_icon1_rgb = colormapPaletteColor(floor(f / 16), 0);
+			sbar_field_icon2 = "gfx/sb_playercolor_pants";
+			sbar_field_icon2_rgb = colormapPaletteColor(mod(f, 16), 1);
+			return "";
+
 		case SP_KDRATIO:
 			num = pl.(scores[SP_KILLS]);
 			denom = pl.(scores[SP_DEATHS]);
@@ -637,12 +701,67 @@
 }
 
 float xmin, xmax, ymin, ymax, sbwidth;
+float sbar_fixscoreboardcolumnwidth_len;
+float sbar_fixscoreboardcolumnwidth_iconlen;
 
+string Sbar_FixScoreboardColumnWidth(float i, string str)
+{
+	float field, maxsize, j;
+	vector sz;
+	field = sbar_field[i];
+
+	if(field == SP_NAME) // name gets all remaining space
+	{
+		maxsize = (xmax - xmin) / sbar_fontsize_x;
+		for(j = 0; j < sbar_num_fields; ++j) if(j != i) if(sbar_field[j] != SP_SEPARATOR)
+			maxsize -= sbar_size[j] + 1;
+		maxsize += 1;
+		str = textShortenToWidth(str, maxsize, TRUE);
+		sbar_fixscoreboardcolumnwidth_len = stringwidth(str, TRUE);
+	}
+	else
+		sbar_fixscoreboardcolumnwidth_len = stringwidth(str, FALSE);
+	
+	sbar_fixscoreboardcolumnwidth_iconlen = 0;
+
+	if(sbar_field_icon0 != "")
+	{
+		sz = drawgetimagesize(sbar_field_icon0);
+		if(sbar_fixscoreboardcolumnwidth_iconlen < sz_x / sz_y)
+			sbar_fixscoreboardcolumnwidth_iconlen = sz_x / sz_y;
+	}
+
+	if(sbar_field_icon1 != "")
+	{
+		sz = drawgetimagesize(sbar_field_icon1);
+		if(sbar_fixscoreboardcolumnwidth_iconlen < sz_x / sz_y)
+			sbar_fixscoreboardcolumnwidth_iconlen = sz_x / sz_y;
+	}
+
+	if(sbar_field_icon2 != "")
+	{
+		sz = drawgetimagesize(sbar_field_icon2);
+		if(sbar_fixscoreboardcolumnwidth_iconlen < sz_x / sz_y)
+			sbar_fixscoreboardcolumnwidth_iconlen = sz_x / sz_y;
+	}
+
+	sbar_fixscoreboardcolumnwidth_iconlen *= sbar_fontsize_y / sbar_fontsize_x; // fix icon aspect
+
+	if(sbar_size[i] < sbar_fixscoreboardcolumnwidth_len + sbar_fixscoreboardcolumnwidth_iconlen)
+	{
+		print("size: extended from ", ftos(sbar_size[i]), " to ");
+		sbar_size[i] = sbar_fixscoreboardcolumnwidth_len + sbar_fixscoreboardcolumnwidth_iconlen;
+		print(ftos(sbar_size[i]), "\n");
+	}
+
+	return str;
+}
+
 void Sbar_PrintScoreboardItem(vector pos, entity pl, float is_self)
 {
 	vector tmp;
 	string str;
-	float i, field, len;
+	float i, field;
 	float is_spec;
 	is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
 
@@ -667,36 +786,25 @@
 			continue;
 		}
 		str = Sbar_GetField(pl, field);
+		str = Sbar_FixScoreboardColumnWidth(i, str);
 
-		if(field == SP_NAME)
-		{
-			float realsize;
-			float j;
-			realsize = sbar_size[i];
-			if(i+1 < sbar_num_fields)
-				if(sbar_field[i+1] == SP_SEPARATOR)
-				{
-					realsize = (xmax - xmin) / sbar_fontsize_x;
-					for(j = 0; j < sbar_num_fields; ++j) if(j != i) if(sbar_field[j] != SP_SEPARATOR)
-						realsize -= sbar_size[j] + 1;
-					realsize += 1;
-				}
-			str = textShortenToWidth(str, realsize, TRUE);
-		}
-		len = stringwidth(str, TRUE);
-		
-		if(sbar_size[i] < len)
-			sbar_size[i] = len;
-
 		pos_x += sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
 
 		if(field == SP_NAME) {
-			tmp_x = sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
+			tmp_x = sbar_fontsize_x*(sbar_size[i] - sbar_fixscoreboardcolumnwidth_iconlen) + sbar_fontsize_x;
 			drawcolorcodedstring(pos - tmp, str, sbar_fontsize, 1, DRAWFLAG_NORMAL);
 		} else {
-			tmp_x = len*sbar_fontsize_x + sbar_fontsize_x;
+			tmp_x = sbar_fixscoreboardcolumnwidth_len*sbar_fontsize_x + sbar_fontsize_x;
 			drawstring(pos - tmp, str, sbar_fontsize, sbar_field_rgb, 1, DRAWFLAG_NORMAL);
 		}
+
+		tmp_x = sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
+		if(sbar_field_icon0 != "")
+			drawpic(pos - tmp, sbar_field_icon0, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon1_rgb, sbar_field_icon0_alpha, 0);
+		if(sbar_field_icon1 != "")
+			drawpic(pos - tmp, sbar_field_icon1, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon1_rgb, sbar_field_icon1_alpha, 0);
+		if(sbar_field_icon2 != "")
+			drawpic(pos - tmp, sbar_field_icon2, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon2_rgb, sbar_field_icon2_alpha, 0);
 	}
 	
 	if(sbar_field[i] == SP_SEPARATOR)
@@ -714,21 +822,24 @@
 			}
 			
 			str = Sbar_GetField(pl, field);
+			str = Sbar_FixScoreboardColumnWidth(i, str);
 
-			if(field == SP_NAME)
-				str = textShortenToWidth(str, sbar_size[i], TRUE);
-			len = stringwidth(str, TRUE);
-
-			if(sbar_size[i] < len)
-				sbar_size[i] = len;
-
 			if(field == SP_NAME) {
-				tmp_x = sbar_fontsize_x*len; // left or right aligned? let's put it right...
+				tmp_x = sbar_fontsize_x*sbar_fixscoreboardcolumnwidth_len; // left or right aligned? let's put it right...
 				drawcolorcodedstring(pos - tmp, str, sbar_fontsize, 1, DRAWFLAG_NORMAL);
 			} else {
-				tmp_x = sbar_fontsize_x*len; //strlen(str);
+				tmp_x = sbar_fontsize_x*sbar_fixscoreboardcolumnwidth_len; //strlen(str);
 				drawstring(pos - tmp, str, sbar_fontsize, sbar_field_rgb, 1, DRAWFLAG_NORMAL);
 			}
+
+			tmp_x = sbar_fontsize_x*sbar_size[i];
+			if(sbar_field_icon0 != "")
+				drawpic(pos - tmp, sbar_field_icon0, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon1_rgb, sbar_field_icon0_alpha, 0);
+			if(sbar_field_icon1 != "")
+				drawpic(pos - tmp, sbar_field_icon1, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon1_rgb, sbar_field_icon1_alpha, 0);
+			if(sbar_field_icon2 != "")
+				drawpic(pos - tmp, sbar_field_icon2, '0 1 0' * sbar_fontsize_y + '1 0 0' * sbar_fontsize_x * sbar_fixscoreboardcolumnwidth_iconlen, sbar_field_icon2_rgb, sbar_field_icon2_alpha, 0);
+
 			pos_x -= sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
 		}
 	}

Modified: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup.c	2008-10-13 13:05:55 UTC (rev 4739)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup.c	2008-10-13 13:12:10 UTC (rev 4740)
@@ -46,12 +46,12 @@
 	me.TR(me);
 	me.TR(me);
 	me.TR(me);
-		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Shirt Color:"));
+		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "First Color:"));
 		n = 16 - !cvar("developer");
 		for(i = 0; i < n; ++i)
 			me.TDNoMargin(me, 1, 2 / n, e = makeNexuizColorButton(1, 0, i), '1 0 0');
 	me.TR(me);
-		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Pants Color:"));
+		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Second Color:"));
 		for(i = 0; i < n; ++i)
 			me.TDNoMargin(me, 1, 2 / n, e = makeNexuizColorButton(2, 1, i), '1 0 0');
 	me.TR(me);

Modified: branches/nexuiz-2.0/data/qcsrc/server/vote.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/vote.qc	2008-10-13 13:05:55 UTC (rev 4739)
+++ branches/nexuiz-2.0/data/qcsrc/server/vote.qc	2008-10-13 13:12:10 UTC (rev 4740)
@@ -78,7 +78,10 @@
 		if(argv(0) == "chmap" || argv(0) == "gotomap" || argv(0) == "kick" || argv(0) == "kickban") // won't work without arguments
 			return FALSE;
 	if(argv(0) == "chmap")
+	{
 		vote = strcat("gotomap ", substring(vote, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)));
+		vote_argc = tokenize_sane(vote);
+	}
 	if(argv(0) == "gotomap")
 	{
 		if(!(vote = ValidateMap(substring(vote, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), e)))




More information about the nexuiz-commits mailing list