]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
When holding a reloadable weapon, also show its count on the HUD
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 16:41:58 +0000 (18:41 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 28 Feb 2011 16:41:58 +0000 (18:41 +0200)
data/qcsrc/client/sbar.qc

index 33d31f39b276534cd8e8aaa459ab65a4b14d8777..ac11cd040c149a65dd29ebe5ba82321aa8847f39 100644 (file)
@@ -3050,6 +3050,8 @@ void Sbar_Draw (void)
                pos_x = bottom_x + 140;\r
                pos_y = bottom_y - 20;\r
 \r
+               float weapon_clipload, weapon_clipsize;\r
+\r
                // if we are using the jetpack, show fuel ammo. Otherwise show the ammo of our weapon\r
                if(stat_items & IT_JETPACK && button_jetpack)\r
                {\r
@@ -3066,7 +3068,18 @@ void Sbar_Draw (void)
                                {\r
                                        a = getstati(GetAmmoStat(i)); // how much ammo do we have of type i?\r
                                        drawpic(pos - '98 18 0', GetAmmoPicture(i), '20 20 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                                       Sbar_DrawXNum(pos - '144 16 0', a, 3, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                                       weapon_clipsize = getstati(STAT_WEAPON_CLIPSIZE);\r
+\r
+                                       if(weapon_clipsize)\r
+                                       {\r
+                                               weapon_clipload = getstati(STAT_WEAPON_CLIPLOAD);\r
+                                               Sbar_DrawXNum(pos - '132 23 0', weapon_clipload, 2, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                                               Sbar_DrawXNum(pos - '137 7 0', a, 3, 0, 12, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               Sbar_DrawXNum(pos - '144 16 0', a, 3, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                                       }\r
                                }\r
                        }\r
                }\r