[nexuiz-commits] r7801 - in branches/nexuiz-2.0: . data/qcsrc/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Sep 15 05:33:33 EDT 2009


Author: div0
Date: 2009-09-15 05:33:33 -0400 (Tue, 15 Sep 2009)
New Revision: 7801

Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
   branches/nexuiz-2.0/data/qcsrc/client/teamradar.qc
   branches/nexuiz-2.0/data/qcsrc/client/waypointsprites.qc
Log:
r7771 | fruitiex | 2009-09-13 04:06:32 -0400 (Sun, 13 Sep 2009) | 2 lines
fade out showpressedkeys and showacceleration when opening the menu
r7772 | fruitiex | 2009-09-13 04:20:38 -0400 (Sun, 13 Sep 2009) | 2 lines
also fade out radar and waypoints, fix showpressedkeys bg not fading out
r7773 | fruitiex | 2009-09-13 04:40:28 -0400 (Sun, 13 Sep 2009) | 2 lines
fade out the ons radar, all icons on the radar as well (duh) and healthbars on waypointsprites


Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2009-09-15 09:29:51 UTC (rev 7800)
+++ branches/nexuiz-2.0/.patchsets	2009-09-15 09:33:33 UTC (rev 7801)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-7563,7565-7586,7589-7589,7592-7592,7595-7595,7597-7597,7599-7602,7605-7610,7612-7615,7619-7620,7623-7623,7626-7628,7630-7630,7644-7651,7656-7656,7658-7660,7663-7665,7670-7670,7672-7676,7678-7680,7686-7687,7689-7698,7701-7701,7703-7714,7717-7723,7731-7731,7735-7741,7744-7745,7752-7754,7756-7756,7758-7758,7761-7764
+revisions_applied = 1-7563,7565-7586,7589-7589,7592-7592,7595-7595,7597-7597,7599-7602,7605-7610,7612-7615,7619-7620,7623-7623,7626-7628,7630-7630,7644-7651,7656-7656,7658-7660,7663-7665,7670-7670,7672-7676,7678-7680,7686-7687,7689-7698,7701-7701,7703-7714,7717-7723,7731-7731,7735-7741,7744-7745,7752-7754,7756-7758,7761-7764,7771-7773

Modified: branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2009-09-15 09:29:51 UTC (rev 7800)
+++ branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2009-09-15 09:33:33 UTC (rev 7801)
@@ -1925,13 +1925,13 @@
 	pos -= '-15 -6 0'; // adjust to the origin of these numbers
 
 	pressedkeys = getstatf(STAT_PRESSED_KEYS);
-	drawpic(pos + '-15   -6   0', "gfx/hud/keys/key_bg.tga",           bgsize, '1 1 1', .1, DRAWFLAG_NORMAL);
-	drawpic(pos + ' 83.5  9   0', ((pressedkeys & KEY_CROUCH) ? "gfx/hud/keys/key_crouch_inv.tga" : "gfx/hud/keys/key_crouch.tga"), ' 24 24 0', '1 1 1', 1, DRAWFLAG_NORMAL);
-	drawpic(pos + ' 32   -1.5 0', ((pressedkeys & KEY_FORWARD) ? "gfx/hud/keys/key_forward_inv.tga" : "gfx/hud/keys/key_forward.tga"),  ' 32 32 0', '1 1 1', 1, DRAWFLAG_NORMAL);
-	drawpic(pos + '-11.5  9   0', ((pressedkeys & KEY_JUMP) ? "gfx/hud/keys/key_jump_inv.tga" : "gfx/hud/keys/key_jump.tga"),     ' 24 24 0', '1 1 1', 1, DRAWFLAG_NORMAL);
-	drawpic(pos + ' -1   32   0', ((pressedkeys & KEY_LEFT) ? "gfx/hud/keys/key_left_inv.tga" : "gfx/hud/keys/key_left.tga"),     ' 32 32 0', '1 1 1', 1, DRAWFLAG_NORMAL);
-	drawpic(pos + ' 32   32   0', ((pressedkeys & KEY_BACKWARD) ? "gfx/hud/keys/key_backward_inv.tga" : "gfx/hud/keys/key_backward.tga"), ' 32 32 0', '1 1 1', 1, DRAWFLAG_NORMAL);
-	drawpic(pos + ' 65   32   0', ((pressedkeys & KEY_RIGHT) ? "gfx/hud/keys/key_right_inv.tga" : "gfx/hud/keys/key_right.tga"),    ' 32 32 0', '1 1 1', 1, DRAWFLAG_NORMAL);
+	drawpic(pos + '-15   -6   0', "gfx/hud/keys/key_bg.tga",           bgsize, '1 1 1', 0.1 * sbar_alpha_fg, DRAWFLAG_NORMAL);
+	drawpic(pos + ' 83.5  9   0', ((pressedkeys & KEY_CROUCH) ? "gfx/hud/keys/key_crouch_inv.tga" : "gfx/hud/keys/key_crouch.tga"), ' 24 24 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
+	drawpic(pos + ' 32   -1.5 0', ((pressedkeys & KEY_FORWARD) ? "gfx/hud/keys/key_forward_inv.tga" : "gfx/hud/keys/key_forward.tga"),  ' 32 32 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
+	drawpic(pos + '-11.5  9   0', ((pressedkeys & KEY_JUMP) ? "gfx/hud/keys/key_jump_inv.tga" : "gfx/hud/keys/key_jump.tga"),     ' 24 24 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
+	drawpic(pos + ' -1   32   0', ((pressedkeys & KEY_LEFT) ? "gfx/hud/keys/key_left_inv.tga" : "gfx/hud/keys/key_left.tga"),     ' 32 32 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
+	drawpic(pos + ' 32   32   0', ((pressedkeys & KEY_BACKWARD) ? "gfx/hud/keys/key_backward_inv.tga" : "gfx/hud/keys/key_backward.tga"), ' 32 32 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
+	drawpic(pos + ' 65   32   0', ((pressedkeys & KEY_RIGHT) ? "gfx/hud/keys/key_right_inv.tga" : "gfx/hud/keys/key_right.tga"),    ' 32 32 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
 }
 
 void Sbar_ShowSpeed(void)
@@ -1992,9 +1992,9 @@
 	}
 		
 	if (acceleration > 0)
-		drawpic(pos, "gfx/hud/accelerometer_gradient", acceleration * scale * '40 0 0' + sz * '0 1 0', rgb, alpha, DRAWFLAG_NORMAL);
+		drawpic(pos, "gfx/hud/accelerometer_gradient", acceleration * scale * '40 0 0' + sz * '0 1 0', rgb, alpha * sbar_alpha_fg, DRAWFLAG_NORMAL);
 	else if (acceleration < 0)
-		drawpic(pos + acceleration * scale * '40 0 0', "gfx/hud/accelerometer_gradient", -acceleration * scale * '40 0 0' + sz * '0 1 0', rgb, alpha, DRAWFLAG_NORMAL);
+		drawpic(pos + acceleration * scale * '40 0 0', "gfx/hud/accelerometer_gradient", -acceleration * scale * '40 0 0' + sz * '0 1 0', rgb, alpha * sbar_alpha_fg, DRAWFLAG_NORMAL);
 }
 
 void Sbar_DrawAccuracyStats_Description_Hitscan(vector position)

Modified: branches/nexuiz-2.0/data/qcsrc/client/teamradar.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/teamradar.qc	2009-09-15 09:29:51 UTC (rev 7800)
+++ branches/nexuiz-2.0/data/qcsrc/client/teamradar.qc	2009-09-15 09:33:33 UTC (rev 7801)
@@ -115,17 +115,17 @@
 		rgb2 = '1 1 1';
 
 	R_BeginPolygon("", 0);
-	R_PolygonVertex(coord+v_forward*3, '0 0 0', rgb2, 1);
-	R_PolygonVertex(coord+v_right*4-v_forward*2.5, '0 1 0', rgb2, 1);
-	R_PolygonVertex(coord-v_forward*2, '1 0 0', rgb2, 1);
-	R_PolygonVertex(coord-v_right*4-v_forward*2.5, '1 1 0', rgb2, 1);
+	R_PolygonVertex(coord+v_forward*3, '0 0 0', rgb2, sbar_alpha_fg);
+	R_PolygonVertex(coord+v_right*4-v_forward*2.5, '0 1 0', rgb2, sbar_alpha_fg);
+	R_PolygonVertex(coord-v_forward*2, '1 0 0', rgb2, sbar_alpha_fg);
+	R_PolygonVertex(coord-v_right*4-v_forward*2.5, '1 1 0', rgb2, sbar_alpha_fg);
 	R_EndPolygon();
 
 	R_BeginPolygon("", 0);
-	R_PolygonVertex(coord+v_forward*2, '0 0 0', rgb, 1);
-	R_PolygonVertex(coord+v_right*3-v_forward*2, '0 1 0', rgb, 1);
-	R_PolygonVertex(coord-v_forward, '1 0 0', rgb, 1);
-	R_PolygonVertex(coord-v_right*3-v_forward*2, '1 1 0', rgb, 1);
+	R_PolygonVertex(coord+v_forward*2, '0 0 0', rgb, sbar_alpha_fg);
+	R_PolygonVertex(coord+v_right*3-v_forward*2, '0 1 0', rgb, sbar_alpha_fg);
+	R_PolygonVertex(coord-v_forward, '1 0 0', rgb, sbar_alpha_fg);
+	R_PolygonVertex(coord-v_right*3-v_forward*2, '1 1 0', rgb, sbar_alpha_fg);
 	R_EndPolygon();
 };
 
@@ -149,7 +149,7 @@
 			if(dt >= 1 || dt <= 0)
 				continue;
 			v = '2 2 0' * teamradar_size * dt;
-			drawpic(coord - 0.5 * v, "gfx/teamradar_ping", v, '1 1 1', 1 - dt, DRAWFLAG_ADDITIVE);
+			drawpic(coord - 0.5 * v, "gfx/teamradar_ping", v, '1 1 1', (1 - dt) * a, DRAWFLAG_ADDITIVE);
 		}
 	}
 }
@@ -170,10 +170,10 @@
 	c1 = colormapPaletteColor((colors & 0xF0) / 0x10, FALSE);
 
 	R_BeginPolygon("", 0);
-	R_PolygonVertex(start - norm, '0 0 0', c0, 1);
-	R_PolygonVertex(start + norm, '0 1 0', c0, 1);
-	R_PolygonVertex(end + norm, '1 1 0', c1, 1);
-	R_PolygonVertex(end - norm, '1 0 0', c1, 1);
+	R_PolygonVertex(start - norm, '0 0 0', c0, sbar_alpha_fg);
+	R_PolygonVertex(start + norm, '0 1 0', c0, sbar_alpha_fg);
+	R_PolygonVertex(end + norm, '1 1 0', c1, sbar_alpha_fg);
+	R_PolygonVertex(end - norm, '1 0 0', c1, sbar_alpha_fg);
 	R_EndPolygon();
 }
 
@@ -191,8 +191,8 @@
 	if(ons_showmap)
 	{
 		cl_teamradar_scale = 42; // dummy, not used (see zoommode)
-		cl_teamradar_background_alpha = 1;
-		cl_teamradar_foreground_alpha = 1;
+		cl_teamradar_background_alpha = 1 * (1 - cvar("_menu_alpha"));
+		cl_teamradar_foreground_alpha = 1 * (1 - cvar("_menu_alpha"));
 		cl_teamradar_rotation = cvar("cl_teamradar_rotation");
 		if(!cl_teamradar_rotation)
 			cl_teamradar_rotation = 4;
@@ -204,8 +204,8 @@
 	else
 	{
 		cl_teamradar_scale = cvar("cl_teamradar_scale");
-		cl_teamradar_background_alpha = cvar("cl_teamradar_background_alpha");
-		cl_teamradar_foreground_alpha = cvar("cl_teamradar_foreground_alpha");
+		cl_teamradar_background_alpha = cvar("cl_teamradar_background_alpha") * sbar_alpha_fg;
+		cl_teamradar_foreground_alpha = cvar("cl_teamradar_foreground_alpha") * sbar_alpha_fg;
 		cl_teamradar_rotation = cvar("cl_teamradar_rotation");
 		cl_teamradar_size = stov(cvar_string("cl_teamradar_size"));
 		cl_teamradar_position = stov(cvar_string("cl_teamradar_position"));
@@ -214,8 +214,8 @@
 		// others default to 0
 		// match this to defaultNexuiz.cfg!
 		if(!cl_teamradar_scale) cl_teamradar_scale = 4096;
-		if(!cl_teamradar_background_alpha) cl_teamradar_background_alpha = 0.4;
-		if(!cl_teamradar_foreground_alpha) cl_teamradar_foreground_alpha = 0.8;
+		if(!cl_teamradar_background_alpha) cl_teamradar_background_alpha = 0.4 * sbar_alpha_fg;
+		if(!cl_teamradar_foreground_alpha) cl_teamradar_foreground_alpha = 0.8 * sbar_alpha_fg;
 		if(!cl_teamradar_size_x) cl_teamradar_size_x = 128;
 		if(!cl_teamradar_size_y) cl_teamradar_size_y = cl_teamradar_size_x;
 
@@ -346,8 +346,8 @@
 		frame_origin_y = teamradar_origin2d_y - teamradar_size2d_y * 0.55859375;
 		frame_size_x = teamradar_size2d_x * 1.1171875;
 		frame_size_y = teamradar_size2d_y * 1.1171875;
-		drawpic(frame_origin, "gfx/ons-frame.tga", frame_size, '1 1 1', 1, 0);
-		drawpic(frame_origin, "gfx/ons-frame-team.tga", frame_size, rgb, 1, 0);
+		drawpic(frame_origin, "gfx/ons-frame.tga", frame_size, '1 1 1', sbar_alpha_fg, 0);
+		drawpic(frame_origin, "gfx/ons-frame-team.tga", frame_size, rgb, sbar_alpha_fg, 0);
 
 		drawsetcliparea(
 			teamradar_origin2d_x - teamradar_size2d_x * 0.5,
@@ -360,7 +360,7 @@
 	for(tm = world; (tm = find(tm, classname, "radarlink")); )
 		draw_teamradar_link(tm.origin, tm.velocity, tm.team);
 	for(tm = world; (tm = findflags(tm, teamradar_icon, 0xFFFFFF)); )
-		draw_teamradar_icon(tm.origin, tm.teamradar_icon, tm, tm.teamradar_color, tm.alpha);
+		draw_teamradar_icon(tm.origin, tm.teamradar_icon, tm, tm.teamradar_color, tm.alpha * sbar_alpha_fg);
 	for(tm = world; (tm = find(tm, classname, "entcs_receiver")); )
 	{
 		color2 = GetPlayerColor(tm.sv_entnum);

Modified: branches/nexuiz-2.0/data/qcsrc/client/waypointsprites.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/waypointsprites.qc	2009-09-15 09:29:51 UTC (rev 7800)
+++ branches/nexuiz-2.0/data/qcsrc/client/waypointsprites.qc	2009-09-15 09:33:33 UTC (rev 7801)
@@ -159,7 +159,7 @@
 	dist = vlen(self.origin - view_origin);
 	
 	float a;
-	a = self.alpha;
+	a = self.alpha * sbar_alpha_fg;
 
 	if(self.maxdistance > waypointsprite_normdistance)
 		a *= pow(bound(0, (self.maxdistance - dist) / (self.maxdistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent);
@@ -386,9 +386,9 @@
 	waypointsprite_minalpha = cvar("g_waypointsprite_minalpha");
 	waypointsprite_distancealphaexponent = cvar("g_waypointsprite_distancealphaexponent");
 	waypointsprite_timealphaexponent = cvar("g_waypointsprite_timealphaexponent");
-	waypointsprite_scale = cvar("g_waypointsprite_scale");
+	waypointsprite_scale = cvar("g_waypointsprite_scale") * (1 - cvar("_menu_alpha"));
 	if(!waypointsprite_scale)
-		waypointsprite_scale = 1.0;
+		waypointsprite_scale = 1.0 * (1 - cvar("_menu_alpha"));
 
 	if(!waypointsprite_initialized)
 	{



More information about the nexuiz-commits mailing list