r104 - trunk/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Mar 8 00:28:58 EST 2008


Author: vermeulen
Date: 2008-03-08 00:28:58 -0500 (Sat, 08 Mar 2008)
New Revision: 104

Modified:
   trunk/client/cl_main.qc
   trunk/client/cl_sbar.qc
   trunk/client/cl_vars.qc
Log:
Changed hud around, added bars for ammo/health


Modified: trunk/client/cl_main.qc
===================================================================
--- trunk/client/cl_main.qc	2008-03-04 11:48:46 UTC (rev 103)
+++ trunk/client/cl_main.qc	2008-03-08 05:28:58 UTC (rev 104)
@@ -47,7 +47,7 @@
 
 void() CSQC_Init =
 {
-	Sbar_Init();
+
 };
 
 void() CSQC_Shutdown =
@@ -87,7 +87,7 @@
 
 	R_SetView(VF_DRAWWORLD, 1);
 	R_SetView(VF_DRAWCROSSHAIR, 1);
-	R_SetView(VF_DRAWENGINESBAR, 1);
+	//R_SetView(VF_DRAWENGINESBAR, 1);
 	
 	R_RenderScene();
 	

Modified: trunk/client/cl_sbar.qc
===================================================================
--- trunk/client/cl_sbar.qc	2008-03-04 11:48:46 UTC (rev 103)
+++ trunk/client/cl_sbar.qc	2008-03-08 05:28:58 UTC (rev 104)
@@ -24,37 +24,37 @@
 entity scoreboard_chain;
 float  scoreboard_size;
 
-//-----------------------------------------------------------------------------
-// Sbar_Init
-//-----------------------------------------------------------------------------
-
-void() Sbar_Init =
+// This Draws the progress bar
+void DrawBars(void)
 {
-	precache_pic("gfx/sb_shells");
-	precache_pic("gfx/sb_nails");
-	precache_pic("gfx/sb_rocket");
-	precache_pic("gfx/sb_cells");
-};
+   local vector fillsize;
+   local float ammo1, ammo2;
 
-//-----------------------------------------------------------------------------
-// Sbar_Draw functions
-//-----------------------------------------------------------------------------
+   fillsize_y  = GetStat_FLOAT_TRUNCATED(STAT_ARMOR) * 2;
+   fillsize_x = 15;
+   pos_armor_x = 5;
+   pos_armor_y = vid_height - (20 + fillsize_y);
+   drawfill(pos_armor, fillsize, '0.5 0.5 2', 0.6, 0);
 
-float(float x) NewX =
-{
-	return x + ((vid_width - 320) / 2);
-};
+   fillsize_y  = GetStat_FLOAT_TRUNCATED(STAT_HEALTH) * 2;
+   fillsize_x = 15;
+   pos_health_x = 20;
+   pos_health_y = vid_height - (20 + fillsize_y);
+   drawfill(pos_health, fillsize, '2 0.5 0.5', 0.6, 0);
 
-void(float x, float y, string pic, float alph) Sbar_DrawPic =
-{
-	local float width;
-	local vector siz, pos;
-	siz = drawgetimagesize(pic);
-	pos_x = NewX(x);
-	pos_y = vid_height - y;
-	drawpic(pos, pic, siz, VEC_1, alph, 0);
-};
+   ammo1 = GetStat_FLOAT_TRUNCATED(STAT_AMMO) * 2;
+   ammo2 = GetStat_FLOAT_TRUNCATED(STAT_SHELLS) * 2;
+   fillsize_y = ammo2;
+   fillsize_x = 15;
+   pos_ammo_x = vid_width - 50;
+   pos_ammo_y = vid_height - (20 + fillsize_y);
+   drawfill(pos_ammo, fillsize, '0 1 1', 0.6, 0);
 
+   fillsize_y = ammo1;
+   pos_ammo_y = vid_height - (20 + fillsize_y + ammo2);
+   drawfill(pos_ammo, fillsize, '0 0.8 0.8', 0.6, 0);
+}
+
 //-----------------------------------------------------------------------------
 // Sbar_Draw
 //-----------------------------------------------------------------------------
@@ -62,16 +62,25 @@
 void() Sbar_Draw =
 {
 	local float f;
+	local vector itemsize;
 	
+	DrawBars(); 
+
 	f = GetStat_FLOAT_TRUNCATED(STAT_CELLS);
+
+	pos_item_x = 40;
+	pos_item_y = vid_height - 65;
+
+	itemsize = '50 50 0';
+
 	if (f==1)
-		Sbar_DrawPic (0, 50, "gfx/item1", sbar_alpha_fg);
+		drawpic(pos_item, "gfx/item1", itemsize, '1 1 1', 1, 0);
 	else if (f==2)
-		Sbar_DrawPic (0, 50, "gfx/item2", sbar_alpha_fg);
+		drawpic(pos_item, "gfx/item2", itemsize, '1 1 1', 1, 0);
 	else if (f==3)
-		Sbar_DrawPic (0, 50, "gfx/item3", sbar_alpha_fg);
+		drawpic(pos_item, "gfx/item3", itemsize, '1 1 1', 1, 0);
 	else if (f==4)
-		Sbar_DrawPic (0, 50, "gfx/item4", sbar_alpha_fg);
+		drawpic(pos_item, "gfx/item4", itemsize, '1 1 1', 1, 0);
 	else if (f==5)
-		Sbar_DrawPic (0, 50, "gfx/item5", sbar_alpha_fg);
+		drawpic(pos_item, "gfx/item5", itemsize, '1 1 1', 1, 0);
 };

Modified: trunk/client/cl_vars.qc
===================================================================
--- trunk/client/cl_vars.qc	2008-03-04 11:48:46 UTC (rev 103)
+++ trunk/client/cl_vars.qc	2008-03-08 05:28:58 UTC (rev 104)
@@ -21,6 +21,9 @@
 float vid_width, vid_height;
 
 // sbar
+vector pos_health, pos_ammo;
+vector pos_armor, pos_item;
+
 float sbar_alpha_bg, sbar_alpha_fg;
 float showscores;
 




More information about the zymotic-commits mailing list