[nexuiz-commits] r8545 - in trunk/data: . qcsrc/client qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Jan 24 07:53:28 EST 2010


Author: fruitiex
Date: 2010-01-24 07:53:27 -0500 (Sun, 24 Jan 2010)
New Revision: 8545

Modified:
   trunk/data/defaultNexuiz.cfg
   trunk/data/qcsrc/client/sbar.qc
   trunk/data/qcsrc/server/vote.qc
Log:
fix detecting width of vote string, coloring in teamgames and abstain support (vote dialog)


Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg	2010-01-24 11:35:25 UTC (rev 8544)
+++ trunk/data/defaultNexuiz.cfg	2010-01-24 12:53:27 UTC (rev 8545)
@@ -1332,7 +1332,7 @@
 seta sbar_showweaponicons 1 "1 = show icons of weapons that you have"
 seta sbar_timer_increment 0 "1 = show elapsed time on the timer"
 seta sbar_timer_scale 1 "scale multiplier of the timer"
-seta sbar_alreadyvoted_alpha 0.75 "alpha of the vote dialog after you have voted"
+seta sbar_vote_alreadyvoted_alpha 0.75 "alpha of the vote dialog after you have voted"
 
 // for menu server list (eventually make them have engine support?)
 seta menu_slist_showfull 1 "show servers even if they are full and have no slots to join"

Modified: trunk/data/qcsrc/client/sbar.qc
===================================================================
--- trunk/data/qcsrc/client/sbar.qc	2010-01-24 11:35:25 UTC (rev 8544)
+++ trunk/data/qcsrc/client/sbar.qc	2010-01-24 12:53:27 UTC (rev 8545)
@@ -2776,9 +2776,13 @@
 		float a;
 		a = vote_alpha * bound(cvar_or("sbar_vote_alreadyvoted_alpha", 0.75), 1 - vote_highlighted, 1);
 
-		color_x = cvar("sbar_color_bg_r");
-		color_y = cvar("sbar_color_bg_g");
-		color_z = cvar("sbar_color_bg_b");
+		if (teamplay)
+			color =  GetTeamRGB(myteam) * sbar_color_bg_team;
+		else {
+			color_x = cvar("sbar_color_bg_r");
+			color_y = cvar("sbar_color_bg_g");
+			color_z = cvar("sbar_color_bg_b");
+		}
 
 		vector origin = bottomright - '290 135 0';
 		vector size = '280 70 0';
@@ -2787,8 +2791,8 @@
 		string s;
 	        s = "A vote has been called for: ";
 		drawstring(origin + '0.5 0 0' * size_x + '0 0.1 0' * size_y - '6 0 0' * stringwidth(s, FALSE), s, '12 12 0', '1 1 1', a * sbar_alpha_fg, DRAWFLAG_NORMAL);
-		s = textShortenToWidth(vote_called_vote, size_x * 0.95, stringwidth_colors);
-		drawcolorcodedstring(origin + '0.5 0 0' * size_x + '0 0.3 0' * size_y - '5 0 0' * stringwidth(s, FALSE), s, '10 10 0', a * sbar_alpha_fg, DRAWFLAG_NORMAL);
+		s = textShortenToWidth(vote_called_vote, size_x * 0.96/10, stringwidth_colors);
+		drawcolorcodedstring(origin + '0.52 0 0' * size_x + '0 0.3 0' * size_y - '5 0 0' * stringwidth(s, FALSE), s, '10 10 0', a * sbar_alpha_fg, DRAWFLAG_NORMAL);
 
 		// print the yes/no counts
 		s = strcat("Yes: ", ftos(vote_yescount));

Modified: trunk/data/qcsrc/server/vote.qc
===================================================================
--- trunk/data/qcsrc/server/vote.qc	2010-01-24 11:35:25 UTC (rev 8544)
+++ trunk/data/qcsrc/server/vote.qc	2010-01-24 12:53:27 UTC (rev 8545)
@@ -310,6 +310,8 @@
 				print_to(e, "^1You can't vote from the server console.");
 			} else if(e.vote_vote == 0
 				  || cvar("sv_vote_change")) {
+				msg_entity = e;
+				VoteDialog_UpdateHighlight(3);
 				print_to(e, "^1You abstained from your vote.");
 				e.vote_vote = -2;
 				centerprint_expire(e, CENTERPRIO_VOTE);



More information about the nexuiz-commits mailing list