[nexuiz-commits] r7517 - trunk/data/qcsrc/client
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Tue Aug 25 16:05:57 EDT 2009
Author: fruitiex
Date: 2009-08-25 16:05:49 -0400 (Tue, 25 Aug 2009)
New Revision: 7517
Modified:
trunk/data/qcsrc/client/sbar.qc
Log:
weapon accuracy stats cleanup patch by terencehill
Modified: trunk/data/qcsrc/client/sbar.qc
===================================================================
--- trunk/data/qcsrc/client/sbar.qc 2009-08-25 18:03:45 UTC (rev 7516)
+++ trunk/data/qcsrc/client/sbar.qc 2009-08-25 20:05:49 UTC (rev 7517)
@@ -1,8 +1,5 @@
void drawstringright(vector, string, vector, vector, float, float);
void drawstringcenter(vector, string, vector, vector, float, float);
-void Sbar_DrawAccuracyStats();
-void Sbar_DrawAccuracyStats_Description_Splash(vector);
-void Sbar_DrawAccuracyStats_Description_Hitscan(vector);
float weapon_hits[WEP_COUNT];
float weapon_fired[WEP_COUNT];
float weapon_number;
@@ -1936,6 +1933,22 @@
drawstringcenter('1 0 0' + pos * '0 1 0', speed, numsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
}
+void Sbar_DrawAccuracyStats_Description_Hitscan(vector position)
+{
+ drawstring(position + '0 3 0' * sbar_fontsize_y, "Shots fired:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(position + '0 5 0' * sbar_fontsize_y, "Shots hit:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(position + '0 7 0' * sbar_fontsize_y, "Accuracy:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(position + '0 9 0' * sbar_fontsize_y, "Shots missed:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
+}
+
+void Sbar_DrawAccuracyStats_Description_Splash(vector position)
+{
+ drawstring(position + '0 3 0' * sbar_fontsize_y, "Maximum damage:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(position + '0 5 0' * sbar_fontsize_y, "Actual damage:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(position + '0 7 0' * sbar_fontsize_y, "Accuracy:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
+ drawstring(position + '0 9 0' * sbar_fontsize_y, "Damage wasted:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
+}
+
void Sbar_DrawAccuracyStats()
{
float i, count_hitscan, count_splash, row; // count is the number of 'colums'
@@ -1951,15 +1964,16 @@
fill_size_y = 10 * sbar_fontsize_y; // height of the background
drawfont = sbar_bigfont;
-
pos_x = 0;
pos_y = SCOREBOARD_OFFSET;
pos_z = 0;
drawstringcenter(pos, "Weapon Accuracy", 2 * sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
+
left_border = col_margin + 11 * sbar_fontsize_x;
if(warmup_stage)
{
+ drawfont = sbar_font;
pos_y += 40;
if(mod(time, 1) >= 0.4)
drawstringcenter(pos, "Stats are not tracked during warmup stage", sbar_fontsize, '1 1 0', sbar_alpha_fg, DRAWFLAG_NORMAL);
@@ -1973,6 +1987,8 @@
float top_border_splash = SCOREBOARD_OFFSET + 175; // position where the splash row starts: pixels down the screen
Sbar_DrawAccuracyStats_Description_Splash('1 0 0' * col_margin + '0 1 0' * top_border_splash);
+ drawfont = sbar_font;
+
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
weapon_hit = weapon_hits[i];
@@ -2087,26 +2103,6 @@
}
}
-void Sbar_DrawAccuracyStats_Description_Hitscan(vector position)
-{
- drawfont = sbar_font;
- // hitscan stats
- drawstring(position + '0 3 0' * sbar_fontsize_y, "Shots fired:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(position + '0 5 0' * sbar_fontsize_y, "Shots hit:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(position + '0 7 0' * sbar_fontsize_y, "Accuracy:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(position + '0 9 0' * sbar_fontsize_y, "Shots missed:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
-}
-
-void Sbar_DrawAccuracyStats_Description_Splash(vector position)
-{
- //splash stats
- drawfont = sbar_font;
- drawstring(position + '0 3 0' * sbar_fontsize_y, "Maximum damage:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(position + '0 5 0' * sbar_fontsize_y, "Actual damage:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(position + '0 7 0' * sbar_fontsize_y, "Accuracy:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
- drawstring(position + '0 9 0' * sbar_fontsize_y, "Damage wasted:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
-}
-
void drawstringright(vector position, string text, vector scale, vector rgb, float alpha, float flag)
{
position_x -= 2 / 3 * strlen(text) * scale_x;
More information about the nexuiz-commits
mailing list