]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/sbar.qc
First attempt at implementing True Type font support for the sbar. All fonts will...
[voretournament/voretournament.git] / data / qcsrc / client / sbar.qc
index 73b6ee56dc5aedf20ede16f39f7a962e44e95993..304f4e5b6858aff736de8698c4ec3baf1d944373 100644 (file)
@@ -155,8 +155,8 @@ void Sbar_DrawXNum (vector pos, float num, float digits, float showminusplus, fl
        {\r
                tmp = substring(str, i, 1);\r
                if (stroke == 1)\r
-                       drawpic(pos, strcat("gfx/hud/num_", tmp, "_stroke"), vsize, rgb, alpha, dflags);\r
-               drawpic(pos, strcat("gfx/hud/num_", tmp), vsize, num_color, alpha, dflags);\r
+                       drawstring(pos, tmp, vsize, rgb, alpha, dflags);\r
+               drawstring(pos, tmp, vsize, num_color, alpha, dflags);\r
                pos_x += lettersize;\r
        }\r
 }\r
@@ -2903,16 +2903,12 @@ void Sbar_Draw (void)
        Sbar_UpdatePlayerTeams();\r
        if (intermission == 2) // map voting screen\r
        {\r
-               if(spectatee_status != -1) {\r
-                       Sbar_Score();\r
-                       Sbar_Timer();\r
-               }\r
-               else if(sb_showscores) {\r
-                       Sbar_DrawScoreboard();\r
-                        Sbar_Score();\r
-                        Sbar_Timer();\r
-                }\r
-               Sbar_FinaleOverlay();\r
+               Sbar_Timer();\r
+               if(sb_showscores)\r
+                       Sbar_DrawScoreboard();\r
+               else\r
+                       Sbar_FinaleOverlay();\r
+\r
                Sbar_Reset();\r
        }\r
        else if (sb_showscores_force || getstati(STAT_HEALTH) <= 0 || intermission == 1)\r
@@ -2932,7 +2928,7 @@ void Sbar_Draw (void)
                else\r
                        Sbar_DrawScoreboard();\r
                float armor, health;\r
-               armor = getstati(STAT_ARMOR); // armor is not used in Vore Tournament by default, but still exists for mods that might want it\r
+               armor = getstati(STAT_ARMOR);\r
                health = getstati(STAT_HEALTH);\r
 \r
                stat_items = getstati(STAT_ITEMS);\r
@@ -3029,8 +3025,19 @@ void Sbar_Draw (void)
                        }\r
                }\r
 \r
-               vector health_pos;\r
+               vector health_pos, armor_pos;\r
                health_pos = bottom - '77 58 0';\r
+               armor_pos = bottom - '62 68 0';\r
+\r
+               // armor\r
+               x = armor;\r
+               if (x > 0)\r
+               {\r
+                       drawpic(armor_pos + '10.5 -13.5 0', "gfx/hud/sb_armor", '16 16 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       if(x < 100) armor_pos_x -= 4.5; // always center\r
+                       if(x < 10) armor_pos_x -= 7; // always center\r
+                       Sbar_DrawXNum_Colored(armor_pos, x, 12, sbar_alpha_fg);\r
+               }\r
 \r
                // health\r
                x = health;\r
@@ -3043,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
@@ -3059,7 +3068,20 @@ 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 the weapon we're holding is reloadable, show both its ammo and load\r
+                                       if(weapon_clipsize)\r
+                                       {\r
+                                               weapon_clipload = getstati(STAT_WEAPON_CLIPLOAD);\r
+                                               if(weapon_clipload < 0) // we're reloading\r
+                                                       drawstring(pos - '124 23 0', "- -", '16 16 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                                               else\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
+                                               Sbar_DrawXNum(pos - '144 16 0', a, 3, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                                }\r
                        }\r
                }\r