From c17629f8c0f2898cf337cae71f793d1d3983d926 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Mon, 28 Feb 2011 18:41:58 +0200 Subject: [PATCH] When holding a reloadable weapon, also show its count on the HUD --- data/qcsrc/client/sbar.qc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 33d31f39..ac11cd04 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -3050,6 +3050,8 @@ void Sbar_Draw (void) pos_x = bottom_x + 140; pos_y = bottom_y - 20; + float weapon_clipload, weapon_clipsize; + // if we are using the jetpack, show fuel ammo. Otherwise show the ammo of our weapon if(stat_items & IT_JETPACK && button_jetpack) { @@ -3066,7 +3068,18 @@ void Sbar_Draw (void) { a = getstati(GetAmmoStat(i)); // how much ammo do we have of type i? drawpic(pos - '98 18 0', GetAmmoPicture(i), '20 20 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); - Sbar_DrawXNum(pos - '144 16 0', a, 3, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + weapon_clipsize = getstati(STAT_WEAPON_CLIPSIZE); + + if(weapon_clipsize) + { + weapon_clipload = getstati(STAT_WEAPON_CLIPLOAD); + Sbar_DrawXNum(pos - '132 23 0', weapon_clipload, 2, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawXNum(pos - '137 7 0', a, 3, 0, 12, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + } + else + { + Sbar_DrawXNum(pos - '144 16 0', a, 3, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + } } } } -- 2.39.2