From fa39f0bfed2f98eaf0e1b07540ebade2a4ff085f Mon Sep 17 00:00:00 2001 From: fruitiex Date: Sun, 3 Jan 2010 21:55:39 +0000 Subject: [PATCH] cl_showspeed_z to show z-axis speed as a separate number instead git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8474 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/client/sbar.qc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 55d90987f..26cd9c78a 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -2116,7 +2116,7 @@ void Sbar_ShowSpeed(void) { vector numsize; float pos, conversion_factor; - string speed, unit; + string speed, zspeed, unit; switch(cvar("cl_showspeed_unit")) { @@ -2147,16 +2147,19 @@ void Sbar_ShowSpeed(void) break; } - if (cvar("cl_showspeed_z") == 1) - speed = strcat(ftos(floor( vlen(pmove_vel) * conversion_factor + 0.5 )), unit); - else - speed = strcat(ftos(floor( vlen(pmove_vel - pmove_vel_z * '0 0 1') * conversion_factor + 0.5 )), unit); + speed = strcat(ftos(floor( vlen(pmove_vel - pmove_vel_z * '0 0 1') * conversion_factor + 0.5 )), unit); numsize_x = numsize_y = cvar("cl_showspeed_size"); pos = (vid_conheight - numsize_y) * cvar("cl_showspeed_position"); drawfont = sbar_bigfont; drawstringcenter('1 0 0' + pos * '0 1 0', speed, numsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + + if (cvar("cl_showspeed_z") == 1) { + zspeed = strcat(ftos(fabs(floor( pmove_vel_z * conversion_factor + 0.5 ))), unit); + drawstringcenter('1 0 0' + pos * '0 1 0' + numsize_y * '0 1 0', zspeed, numsize * 0.5, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + } + drawfont = sbar_font; } -- 2.39.2