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

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Jan 17 04:49:58 EST 2010


Author: fruitiex
Date: 2010-01-17 04:49:58 -0500 (Sun, 17 Jan 2010)
New Revision: 8510

Modified:
   trunk/data/defaultNexuiz.cfg
   trunk/data/qcsrc/client/mapvoting.qc
   trunk/data/qcsrc/client/sbar.qc
   trunk/data/qcsrc/server/g_world.qc
Log:
fix small bug with badge, add support for a secondary mapshot dir into mapvotes


Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg	2010-01-16 22:26:53 UTC (rev 8509)
+++ trunk/data/defaultNexuiz.cfg	2010-01-17 09:49:58 UTC (rev 8510)
@@ -1128,6 +1128,7 @@
 seta g_maplist_votable_nodetail 1	"nodetail only shows total count instead of all vote counts per map, so votes don't influence others that much"
 seta g_maplist_votable_abstain 0	"when 1, you can abstain from your vote"
 seta g_maplist_votable_screenshot_dir "maps"	"where to look for map screenshots"
+seta g_maplist_votable_screenshot_dir2 "levelshots"	"fallback for map screenshots"
 alias suggestmap "cmd suggestmap $1"
 
 set g_chat_flood_spl 3	"normal chat: seconds between lines to not count as flooding"

Modified: trunk/data/qcsrc/client/mapvoting.qc
===================================================================
--- trunk/data/qcsrc/client/mapvoting.qc	2010-01-16 22:26:53 UTC (rev 8509)
+++ trunk/data/qcsrc/client/mapvoting.qc	2010-01-17 09:49:58 UTC (rev 8510)
@@ -287,8 +287,6 @@
 
 	mv_active = 1;
 
-	ssdir = ReadString();
-	
 	mv_num_maps = min(MAPVOTE_COUNT, ReadByte());
 	mv_abstain = ReadByte();
 	if(mv_abstain)
@@ -313,7 +311,9 @@
 		if(mv_maps_mask & power)
 		{
 			map = strzone(ReadString());
+			ssdir = ReadString();
 			pk3 = strzone(ReadString());
+	
 			mv_maps[i] = map;
 			mv_pk3[i] = pk3;
 			map = strzone(strcat(ssdir, "/", map));

Modified: trunk/data/qcsrc/client/sbar.qc
===================================================================
--- trunk/data/qcsrc/client/sbar.qc	2010-01-16 22:26:53 UTC (rev 8509)
+++ trunk/data/qcsrc/client/sbar.qc	2010-01-17 09:49:58 UTC (rev 8510)
@@ -1577,33 +1577,43 @@
 
 float race_status_time;
 float race_status_prev;
+string race_status_name_prev;
 void Sbar_DrawRaceStatus(vector pos)
 {
-	if (race_status != race_status_prev) {
+	if (race_status != race_status_prev || race_status_name != race_status_name_prev) {
 		race_status_time = time + 3;
 		race_status_prev = race_status;
+		if (race_status_name_prev)
+			strunzone(race_status_name_prev);
+		race_status_name_prev = strzone(race_status_name);
 	}
 
 	float a;
 	a = bound(0, race_status_time - time, 1);
 
 	string s;
-	s = textShortenToWidth(race_status_name, 120/9, stringwidth_colors);
+	s = textShortenToWidth(race_status_name, 120/10, stringwidth_colors);
 
 	if(race_status == 0)
 		drawpic(pos, "gfx/hud/race/newtime", '80 80 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
 	else if(race_status == 1) {
-		drawpic(pos, "gfx/hud/race/newrank", '80 80 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
-		drawcolorcodedstring(pos + '-20 80 0', s, '10 10 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+		drawpic(pos, "gfx/hud/race/newrank", '80 80 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL);	
+		drawcolorcodedstring(pos + '40 80 0' - '5 0 0' * stringwidth(s, TRUE), s, '10 10 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
 
 	} else if(race_status == 2) {
 		drawpic(pos, "gfx/hud/race/newrecord", '80 80 0', '1 1 1', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
-		drawcolorcodedstring(pos + '-20 80 0', s, '10 10 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
+		drawcolorcodedstring(pos + '40 80 0' - '5 0 0' * stringwidth(s, TRUE), s, '10 10 0', sbar_alpha_fg * a, DRAWFLAG_NORMAL);
 	}
 
 	if (race_status_time - time <= 0) {
 		race_status_prev = -1;
 		race_status = -1;
+		if(race_status_name)
+			strunzone(race_status_name);
+		race_status_name = string_null;
+		if(race_status_name_prev)
+			strunzone(race_status_name_prev);
+		race_status_name_prev = string_null;
 	}
 }
 

Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc	2010-01-16 22:26:53 UTC (rev 8509)
+++ trunk/data/qcsrc/server/g_world.qc	2010-01-17 09:49:58 UTC (rev 8510)
@@ -2074,6 +2074,7 @@
 float mapvote_timeout;
 string mapvote_message;
 string mapvote_screenshot_dir;
+string mapvote_screenshot_dir2;
 
 float mapvote_count;
 float mapvote_count_real;
@@ -2201,6 +2202,11 @@
 		mapvote_screenshot_dir = "maps";
 	mapvote_screenshot_dir = strzone(mapvote_screenshot_dir);
 
+	mapvote_screenshot_dir2 = cvar_string("g_maplist_votable_screenshot_dir2");
+	if(mapvote_screenshot_dir2 == "")
+		mapvote_screenshot_dir2 = "levelshots";
+	mapvote_screenshot_dir2 = strzone(mapvote_screenshot_dir2);
+
 	MapVote_Spawn();
 }
 
@@ -2240,7 +2246,7 @@
 entity mapvote_ent;
 float MapVote_SendEntity(entity to, float sf)
 {
-	string mapfile, pakfile;
+	string mapfile, mapfile2, pakfile;
 	float i, o;
 
 	if(sf & 1)
@@ -2252,7 +2258,6 @@
 	if(sf & 1)
 	{
 		// flag 1 == initialization
-		WriteString(MSG_ENTITY, mapvote_screenshot_dir);
 		WriteByte(MSG_ENTITY, mapvote_count);
 		WriteByte(MSG_ENTITY, mapvote_abstain);
 		WriteByte(MSG_ENTITY, mapvote_detail);
@@ -2273,13 +2278,23 @@
 				{
 					WriteString(MSG_ENTITY, mapvote_maps[i]);
 					mapfile = strcat(mapvote_screenshot_dir, "/", mapvote_maps[i]);
+					mapfile2 = strcat(mapvote_screenshot_dir2, "/", mapvote_maps[i]);
 					pakfile = whichpack(strcat(mapfile, ".tga"));
 					if(pakfile == "")
 						pakfile = whichpack(strcat(mapfile, ".jpg"));
 					if(pakfile == "")
 						pakfile = whichpack(strcat(mapfile, ".png"));
+					if(pakfile == "") {
+						mapvote_screenshot_dir = mapvote_screenshot_dir2;
+						pakfile = whichpack(strcat(mapfile2, ".tga"));
+					}
+					if(pakfile == "")
+						pakfile = whichpack(strcat(mapfile2, ".jpg"));
+					if(pakfile == "")
+						pakfile = whichpack(strcat(mapfile2, ".png"));
 					for(o = strstr(pakfile, "/", 0)+1; o > 0; o = strstr(pakfile, "/", 0)+1)
 						pakfile = substring(pakfile, o, 999);
+					WriteString(MSG_ENTITY, mapvote_screenshot_dir);
 					WriteString(MSG_ENTITY, pakfile);
 				}
 			}



More information about the nexuiz-commits mailing list