]> 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 496da10ab86120bef2c906f72788f4de08f369aa..304f4e5b6858aff736de8698c4ec3baf1d944373 100644 (file)
@@ -29,7 +29,6 @@ float ps_primary, ps_secondary;
 float ts_primary, ts_secondary;\r
 \r
 vector color;\r
-float SCOREBOARD_OFFSET = 50;\r
 \r
 void CSQC_kh_hudreset();\r
 void CSQC_kh_hud();\r
@@ -156,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
@@ -509,14 +508,15 @@ void Cmd_Sbar_SetFields(float argc)
                        sbar_field[sbar_num_fields] = SP_SEPARATOR;\r
                        have_separator = 1;\r
                } else {\r
+                       if(gametype == GAME_RPG)\r
+                               return;\r
+\r
                        for(j = 0; j < MAX_SCORE; ++j)\r
                                if(str == strtolower(scores_label[j]))\r
                                        goto found; // sorry, but otherwise fteqcc -O3 miscompiles this and warns about "unreachable code"\r
 :notfound\r
-                       if(str == "frags" && !(gametype == GAME_RPG))\r
-                       {\r
+                       if(str == "frags")\r
                                j = SP_FRAGS;\r
-                       }\r
                        else\r
                        {\r
                                if not(nocomplain)\r
@@ -716,18 +716,11 @@ string Sbar_GetField(entity pl, float field)
 \r
 string Sbar_GetStomachField(entity pl, float field)\r
 {\r
-       sbar_field_rgb = '1 1 1';\r
-       sbar_field_icon0 = "";\r
-       sbar_field_icon1 = "";\r
-       sbar_field_icon2 = "";\r
-       sbar_field_icon0_rgb = '1 1 1';\r
-       sbar_field_icon1_rgb = '1 1 1';\r
-       sbar_field_icon2_rgb = '1 1 1';\r
-       sbar_field_icon0_alpha = 1;\r
-       sbar_field_icon1_alpha = 1;\r
-       sbar_field_icon2_alpha = 1;\r
        switch(field)\r
        {\r
+               case ST_HIGHLIGHT:\r
+                       return ""; // the returned value is not used, we only need the field\r
+\r
                case ST_NAME:\r
                        return GetPlayerName(pl.sv_entnum);\r
 \r
@@ -740,6 +733,18 @@ string Sbar_GetStomachField(entity pl, float field)
        //return "error";\r
 }\r
 \r
+string Sbar_GetStomachFieldPred(entity pl, float field)\r
+{\r
+       switch(field)\r
+       {\r
+               case STP_NAME:\r
+                       return GetPlayerName(pl.sv_entnum);\r
+               default:\r
+                       return "N/A";\r
+       }\r
+       //return "error";\r
+}\r
+\r
 float xmin, xmax, ymin, ymax, sbwidth;\r
 float sbar_fixscoreboardcolumnwidth_len;\r
 float sbar_fixscoreboardcolumnwidth_iconlen;\r
@@ -949,17 +954,26 @@ void Sbar_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_num
 float fieldcounter;\r
 void Sbar_PrintStomachboardItem(vector pos, entity pl)\r
 {\r
+       // lists all players in the stomach\r
+\r
        string str;\r
-       float f, field;\r
+       float f, field, field_number;\r
+       field_number = 3; // the number of components each row has\r
 \r
-       for(fieldcounter = 1; fieldcounter <= 2; ++fieldcounter)\r
+       for(fieldcounter = 1; fieldcounter <= field_number; ++fieldcounter)\r
        {\r
                field = -fieldcounter;\r
-               if(field == SP_SEPARATOR)\r
-                       break;\r
-\r
                str = Sbar_GetStomachField(pl, field);\r
 \r
+               // row highlighting\r
+               if(field == ST_HIGHLIGHT)\r
+               {\r
+                       if(getstati(STAT_VORE_EATEN))\r
+                               drawfill(pos - '0 0 0', '193 11 0', stov(cvar_string("sbar_stomachboard_color2")), cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       else\r
+                               drawfill(pos - '0 0 0', '193 11 0', stov(cvar_string("sbar_stomachboard_color1")), cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+               }\r
+\r
                if(field == ST_NAME) {\r
                        f = stof(getplayerkey(pl.sv_entnum, "colors"));\r
                        drawpic(pos, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
@@ -967,11 +981,11 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
                        drawpic(pos, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
                        pos_x += 24;\r
-                       drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawcolorcodedstring(pos, textShortenToWidth(str, 138, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                }\r
 \r
                if(field == ST_HEALTH)\r
-               if(g_vore_showpreyhealth && stof(str)) { // only if player health is not 0. Also used to hide the predators health\r
+               if(stof(str) > 0) {\r
                        pos_x += 138;\r
                                if(pl.sv_entnum == player_localentnum - 1 || (spectatee_status && pl.sv_entnum == spectatee_status - 1))\r
                                        drawcolorcodedstring(pos, "self", '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
@@ -986,6 +1000,32 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
        }\r
 }\r
 \r
+float fieldcounter2;\r
+void Sbar_PrintStomachboardItemPred(vector pos, entity pl)\r
+{\r
+       // shows the name of our predator\r
+\r
+       string str;\r
+       float f, field, field_number;\r
+       field_number = 1; // the number of components each row has\r
+\r
+       for(fieldcounter2 = 1; fieldcounter2 <= field_number; ++fieldcounter2)\r
+       {\r
+               field = -fieldcounter2;\r
+               str = Sbar_GetStomachFieldPred(pl, field);\r
+\r
+               if(field == STP_NAME) {\r
+                       f = stof(getplayerkey(pl.sv_entnum, "colors"));\r
+                       drawpic(pos, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(pos, "gfx/sb_playercolor_shirt", '22 11 0', colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(pos, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+\r
+                       pos_x += 24;\r
+                       drawcolorcodedstring(pos, textShortenToWidth(str, 122, '11 11 0', stringwidth_colors), '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+               }\r
+       }\r
+}\r
+\r
 /*\r
  * Sbar_Scoreboard_MakeTable\r
  *\r
@@ -1344,7 +1384,7 @@ void Sbar_DrawScoreboard()
        sbwidth = Sbar_GetWidth(6.5 * sbar_fontsize_y);\r
 \r
        xmin = 0.5 * (vid_conwidth - sbwidth);\r
-       ymin = SCOREBOARD_OFFSET;\r
+       ymin = cvar("sbar_scoreboard_offset");\r
 \r
        xmax = vid_conwidth - xmin;\r
        ymax = vid_conheight - 0.2*vid_conheight;\r
@@ -1356,7 +1396,10 @@ void Sbar_DrawScoreboard()
 \r
        // Heading\r
        drawfont = sbar_bigfont;\r
-       drawstringcenter('0 1 0' * ymin, "Scoreboard", '24 24 0', '1 1 1', sbar_scoreboard_alpha_fg, DRAWFLAG_NORMAL);\r
+       if(gametype == GAME_RPG)\r
+               drawstringcenter('0 1 0' * ymin, "Players", '24 24 0', '1 1 1', sbar_scoreboard_alpha_fg, DRAWFLAG_NORMAL);\r
+       else\r
+               drawstringcenter('0 1 0' * ymin, "Scoreboard", '24 24 0', '1 1 1', sbar_scoreboard_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
        pos_y += 24 + 4;\r
        pos_y += sbar_fontsize_y;\r
@@ -1437,7 +1480,10 @@ void Sbar_DrawScoreboard()
        // Print info string\r
        string str;\r
        float tl, fl, ll;\r
-       str = strcat("playing on ^2", shortmapname, "^7");\r
+       if(gametype == GAME_RPG)\r
+               str = strcat("you are in ^2", shortmapname, "^7");\r
+       else\r
+               str = strcat("playing on ^2", shortmapname, "^7");\r
        tl = getstatf(STAT_TIMELIMIT);\r
        fl = getstatf(STAT_FRAGLIMIT);\r
        ll = getstatf(STAT_LEADLIMIT);\r
@@ -1450,7 +1496,7 @@ void Sbar_DrawScoreboard()
        {\r
                if(tl > 0)\r
                        str = strcat(str, " for ^1", ftos(tl), " minutes^7");\r
-               if(fl > 0)\r
+               if(fl > 0 && !(gametype == GAME_RPG))\r
                {\r
                        if(tl > 0)\r
                                str = strcat(str, " or");\r
@@ -2357,17 +2403,17 @@ void Sbar_DrawAccuracyStats_Description_Hitscan(vector position)
        drawstring(position + '0 9 0' * sbar_fontsize_y, "Shots missed:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 }\r
 \r
-void Sbar_DrawAccuracyStats_Description_Splash(vector position)\r
+/*void Sbar_DrawAccuracyStats_Description_Splash(vector position)\r
 {\r
        drawstring(position + '0 3 0' * sbar_fontsize_y, "Maximum damage:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
        drawstring(position + '0 5 0' * sbar_fontsize_y, "Actual damage:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
        drawstring(position + '0 7 0' * sbar_fontsize_y, "Accuracy:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
        drawstring(position + '0 9 0' * sbar_fontsize_y, "Damage wasted:", sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-}\r
+}*/ // we have no splash damage weapons, but keep this code just in case\r
 \r
 void Sbar_DrawAccuracyStats()\r
 {\r
-       float i, count_hitscan, count_splash, row_hitscan, row_splash;  // count is the number of 'colums'\r
+       float i, count_hitscan, /*count_splash,*/ row_hitscan/*, row_splash*/;  // count is the number of 'colums'\r
        float weapon_hit, weapon_damage, weapon_stats;\r
        float left_border;  // position where the weapons start, the description is in the border\r
        vector fill_colour, fill_size;\r
@@ -2382,7 +2428,7 @@ void Sbar_DrawAccuracyStats()
 \r
        drawfont = sbar_bigfont;\r
        pos_x = 0;\r
-       pos_y = SCOREBOARD_OFFSET;\r
+       pos_y = cvar("sbar_scoreboard_offset");\r
        pos_z = 0;\r
        drawstringcenter(pos, "Weapon Accuracy", 2 * sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
@@ -2408,11 +2454,11 @@ void Sbar_DrawAccuracyStats()
                return;\r
        }\r
 \r
-       float top_border_hitscan = SCOREBOARD_OFFSET + 55;  // position where the hitscan row starts: pixels down the screen\r
+       float top_border_hitscan = cvar("sbar_scoreboard_offset") + 55;  // position where the hitscan row starts: pixels down the screen\r
        Sbar_DrawAccuracyStats_Description_Hitscan('1 0 0' * col_margin + '0 1 0' * top_border_hitscan);\r
 \r
-       float top_border_splash = SCOREBOARD_OFFSET + 175;  // position where the splash row starts: pixels down the screen\r
-       Sbar_DrawAccuracyStats_Description_Splash('1 0 0' * col_margin + '0 1 0' * top_border_splash);\r
+//     float top_border_splash = cvar("sbar_scoreboard_offset") + 175;  // position where the splash row starts: pixels down the screen\r
+//     Sbar_DrawAccuracyStats_Description_Splash('1 0 0' * col_margin + '0 1 0' * top_border_splash);\r
 \r
        for(i = WEP_FIRST; i <= WEP_LAST; ++i)\r
        {\r
@@ -2424,7 +2470,7 @@ void Sbar_DrawAccuracyStats()
                border_colour = (i == activeweapon) ? '1 1 1' : '0 0 0';  // white or black border\r
 \r
                if (weapon_damage) {\r
-                       if (self.spawnflags & WEP_TYPE_SPLASH) {\r
+                       /*if (self.spawnflags & WEP_TYPE_SPLASH) {\r
                                weapon_stats = bound(0, floor(100 * weapon_hit / weapon_damage), 100);\r
 \r
                                fill_colour_x = 1 - 0.015 * weapon_stats;\r
@@ -2474,7 +2520,9 @@ void Sbar_DrawAccuracyStats()
                                drawstringright(pos + '4.5 0 0' * sbar_fontsize_x + '0 9 0' * sbar_fontsize_y, ftos(max(0, weapon_damage - weapon_hit)), sbar_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
                                ++count_splash;\r
-                       } else if (self.spawnflags & WEP_TYPE_HITSCAN) {\r
+                       } else*/ // we have no splash damage weapons, but keep this code just in case\r
+\r
+                       if (self.spawnflags & WEP_TYPE_HITSCAN) {\r
                                weapon_stats = bound(0, floor(100 * weapon_hit / weapon_damage), 100);\r
 \r
                                fill_colour_x = 1 - 0.015 * weapon_stats;\r
@@ -2545,7 +2593,7 @@ float GetAmmoStat(float i)
 {\r
        switch(i)\r
        {\r
-               case 1: return STAT_FUEL;\r
+               case 0: return STAT_FUEL;\r
                default: return -1;\r
        }\r
 }\r
@@ -2554,7 +2602,7 @@ float GetAmmoItemCode(float i)
 {\r
        switch(i)\r
        {\r
-               case 1: return IT_FUEL;\r
+               case 0: return IT_FUEL;\r
                default: return -1;\r
        }\r
 }\r
@@ -2563,7 +2611,7 @@ string GetAmmoPicture(float i)
 {\r
        switch(i)\r
        {\r
-               case 1: return "gfx/hud/sb_fuel";\r
+               case 0: return "gfx/hud/sb_fuel";\r
                default: return "";\r
        }\r
 }\r
@@ -2587,34 +2635,28 @@ float vote_prev; // previous state of vote_active to check for a change
 float vote_alpha;\r
 float vote_change; // "time" when vote_active changed\r
 \r
-vector colortrans_current;\r
-vector Stomachstatus_Colortrans(vector target_color)\r
+vector stomachstatus_colorfade_current;\r
+vector StomachStatus_ColorFade(vector target_color)\r
 {\r
        local float step;\r
-       step = 0.0125;\r
-\r
-       if(spectatee_status == -1 || getstati(STAT_HEALTH) <= 0)\r
-       {\r
-               colortrans_current = '0 0 0';\r
-               return colortrans_current;\r
-       }\r
+       step = cvar("sbar_stomachboard_status_fade") * frametime;\r
 \r
-       if(colortrans_current_x > target_color_x + step)\r
-               colortrans_current_x -= step;\r
-       else if(colortrans_current_x < target_color_x - step)\r
-               colortrans_current_x += step;\r
+       if(stomachstatus_colorfade_current_x >= target_color_x + step)\r
+               stomachstatus_colorfade_current_x -= step;\r
+       else if(stomachstatus_colorfade_current_x <= target_color_x - step)\r
+               stomachstatus_colorfade_current_x += step;\r
 \r
-       if(colortrans_current_y > target_color_y + step)\r
-               colortrans_current_y -= step;\r
-       else if(colortrans_current_y < target_color_y - step)\r
-               colortrans_current_y += step;\r
+       if(stomachstatus_colorfade_current_y >= target_color_y + step)\r
+               stomachstatus_colorfade_current_y -= step;\r
+       else if(stomachstatus_colorfade_current_y <= target_color_y - step)\r
+               stomachstatus_colorfade_current_y += step;\r
 \r
-       if(colortrans_current_z > target_color_z + step)\r
-               colortrans_current_z -= step;\r
-       else if(colortrans_current_z < target_color_z - step)\r
-               colortrans_current_z += step;\r
+       if(stomachstatus_colorfade_current_z >= target_color_z + step)\r
+               stomachstatus_colorfade_current_z -= step;\r
+       else if(stomachstatus_colorfade_current_z <= target_color_z - step)\r
+               stomachstatus_colorfade_current_z += step;\r
 \r
-       return colortrans_current;\r
+       return stomachstatus_colorfade_current;\r
 }\r
 \r
 void Sbar_Draw (void)\r
@@ -2861,15 +2903,9 @@ 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_Timer();\r
+               if(sb_showscores)\r
+                       Sbar_DrawScoreboard();\r
                else\r
                        Sbar_FinaleOverlay();\r
 \r
@@ -2882,6 +2918,8 @@ void Sbar_Draw (void)
                Sbar_Timer();\r
 \r
                Sbar_Reset();\r
+\r
+               StomachStatus_ColorFade('0 0 0');\r
        }\r
        else\r
        {\r
@@ -2890,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
@@ -2899,77 +2937,82 @@ void Sbar_Draw (void)
                fade = 3.2 - 2 * (time - weapontime);\r
                fade = bound(0.7, fade, 1);\r
 \r
-               if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) {\r
-                       if (teamplay)\r
-                               drawpic(bottomleft- '0 256 0', "gfx/hud/bg_stomach", '256 256 0', GetTeamRGB(myteam) * sbar_color_bg_team, sbar_alpha_bg, DRAWFLAG_NORMAL); // hud color = myteam color\r
-                       else {\r
-                               // allow for custom HUD colors in non-teamgames\r
-                               color_x = cvar("sbar_color_bg_r");\r
-                               color_y = cvar("sbar_color_bg_g");\r
-                               color_z = cvar("sbar_color_bg_b");\r
-\r
-                               drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach", '256 256 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
+               if(g_vore) // only when the vore system is active\r
+               {\r
+                       // draw the stomach board\r
+                       if (cvar("viewsize") <= 100) {\r
+                               if (teamplay)\r
+                                       drawpic(bottomleft- '0 256 0', "gfx/hud/bg_stomach", '256 256 0', GetTeamRGB(myteam) * sbar_color_bg_team, sbar_alpha_bg, DRAWFLAG_NORMAL); // hud color = myteam color\r
+                               else {\r
+                                       // allow for custom HUD colors in non-teamgames\r
+                                       color_x = cvar("sbar_color_bg_r");\r
+                                       color_y = cvar("sbar_color_bg_g");\r
+                                       color_z = cvar("sbar_color_bg_b");\r
+\r
+                                       drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach", '256 256 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
+                               }\r
                        }\r
-                       if(getstati(STAT_STOMACH_EATEN))\r
+\r
+                       if(getstati(STAT_VORE_EATEN))\r
                        {\r
-                               drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', Stomachstatus_Colortrans('1 0 0'), sbar_alpha_bg, DRAWFLAG_NORMAL);\r
-                               drawstring(bottomleft - '-80 168 0', "predator:", '8 8 0', '0 0 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                               drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', StomachStatus_ColorFade(stov(cvar_string("sbar_stomachboard_color2"))), cvar("sbar_stomachboard_status_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                               drawstring(bottomleft - '-80 172 0', "predator:", '10 10 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                        }\r
                        else\r
                        {\r
-                               drawpic(bottomleft- '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', Stomachstatus_Colortrans('0 1 0'), sbar_alpha_bg, DRAWFLAG_NORMAL);\r
-                               drawstring(bottomleft - '-80 168 0', "self:", '8 8 0', '0 0 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                               drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', StomachStatus_ColorFade(stov(cvar_string("sbar_stomachboard_color1"))), cvar("sbar_stomachboard_status_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                               drawstring(bottomleft - '-80 172 0', "self:", '10 10 0', ' 1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                        }\r
-               }\r
-               float stomach_load;\r
-               stomach_load = getstati(STAT_STOMACH_LOAD); // shows the predator's stomach load when we are eaten, and ours otherwise\r
-\r
-               Sbar_DrawXNum(bottomleft - '-18 170 0', bound(0, stomach_load, 9), 1, 0, 22, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-               drawstring(bottomleft - '-40 170 0', "/", '22 22 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-               Sbar_DrawXNum(bottomleft - '-50 170 0', bound(0, g_balance_vore_swallow_limit, 9), 1, 0, 22, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-               if(getstati(STAT_STOMACH_DIGESTING))\r
-                       drawstring(bottomleft - '-76 142 0', "stomach digesting", '12 12 0', '1 0.5 0.5', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-               else if(stomach_load == g_balance_vore_swallow_limit)\r
-                       drawstring(bottomleft - '-76 142 0', "stomach full", '12 12 0', '0.5 1 0.5', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-               else if(!stomach_load)\r
-                       drawstring(bottomleft - '-76 142 0', "stomach empty", '12 12 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-               else\r
-                       drawstring(bottomleft - '-76 142 0', "stomach has prey", '12 12 0', '0.75 1 0.75', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
-               // draw the stomach board\r
-               entity pl;\r
-               float f;\r
+                       float stomach_load;\r
+                       stomach_load = getstati(STAT_VORE_LOAD); // shows the predator's stomach load when we are eaten, and ours otherwise\r
 \r
-               pos = bottomleft;\r
-               for(pl = players.sort_next; pl; pl = pl.sort_next)\r
-               {\r
-                       if(pl.team == COLOR_SPECTATOR)\r
-                               continue;\r
+                       Sbar_DrawXNum(bottomleft - '-18 170 0', bound(0, stomach_load, 9), 1, 0, 22, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawstring(bottomleft - '-40 170 0', "/", '22 22 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       Sbar_DrawXNum(bottomleft - '-50 170 0', bound(0, g_balance_vore_swallow_limit, 9), 1, 0, 22, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
-                       if(getstati(STAT_STOMACH_EATEN))\r
-                       {\r
-                               f = pl.pleater == getstati(STAT_STOMACH_EATEN);\r
-                       }\r
+                       if(getstati(STAT_VORE_DIGESTING))\r
+                               drawstring(bottomleft - '-76 142 0', "stomach digesting", '12 12 0', '1 0.5 0.5', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       else if(stomach_load == g_balance_vore_swallow_limit)\r
+                               drawstring(bottomleft - '-76 142 0', "stomach full", '12 12 0', '0.5 1 0.5', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       else if(!stomach_load)\r
+                               drawstring(bottomleft - '-76 142 0', "stomach empty", '12 12 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                        else\r
+                               drawstring(bottomleft - '-76 142 0', "stomach has prey", '12 12 0', '0.75 1 0.75', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+\r
+                       // draw the stomach board player list\r
+                       entity pl;\r
+                       float f;\r
+\r
+                       pos = bottomleft;\r
+                       for(pl = players.sort_next; pl; pl = pl.sort_next)\r
                        {\r
-                               if(spectatee_status)\r
-                                       f = pl.pleater == spectatee_status;\r
+                               if(pl.team == COLOR_SPECTATOR)\r
+                                       continue;\r
+\r
+                               if(getstati(STAT_VORE_EATEN))\r
+                                       f = pl.plpredator == getstati(STAT_VORE_EATEN);\r
                                else\r
-                                       f = pl.pleater == player_localentnum;\r
-                       }\r
+                               {\r
+                                       if(spectatee_status)\r
+                                               f = pl.plpredator == spectatee_status;\r
+                                       else\r
+                                               f = pl.plpredator == player_localentnum;\r
+                               }\r
 \r
-                       if(f)\r
-                       {\r
-                               Sbar_PrintStomachboardItem(pos - '-16 124 0', pl);\r
-                               pos_y += 1.25 * sbar_fontsize_y;\r
-                       }\r
+                               if(f)\r
+                               {\r
+                                       Sbar_PrintStomachboardItem(pos - '-16 124 0', pl);\r
+                                       pos_y += 1.25 * sbar_fontsize_y;\r
+                               }\r
 \r
-                       if(getstati(STAT_STOMACH_EATEN))\r
-                       if(pl.sv_entnum == getstati(STAT_STOMACH_EATEN) - 1)\r
-                               Sbar_PrintStomachboardItem(bottomleft - '-76 156 0', pl);\r
+                               if(getstati(STAT_VORE_EATEN))\r
+                               if(pl.sv_entnum == getstati(STAT_VORE_EATEN) - 1)\r
+                                       Sbar_PrintStomachboardItemPred(bottomleft - '-76 156 0', pl);\r
+                       }\r
                }\r
 \r
-               if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) {\r
+               if (cvar("viewsize") <= 100) {\r
                        if (teamplay)\r
                                drawpic(bottom - '96 96 0', "gfx/hud/bg_status", '192 96 0', GetTeamRGB(myteam) * sbar_color_bg_team, sbar_alpha_bg, DRAWFLAG_NORMAL); // hud color = myteam color\r
                        else {\r
@@ -2982,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
@@ -2992,18 +3046,51 @@ void Sbar_Draw (void)
                if(x < 10) health_pos_x -= 11; // always center\r
                Sbar_DrawXNum_Colored(health_pos, x, 22, sbar_alpha_fg);\r
 \r
-               // fuel ammo\r
-               a = getstati(GetAmmoStat(1)); // how much fuel do we have?\r
+               // ammo\r
+               pos_x = bottom_x + 140;\r
+               pos_y = bottom_y - 20;\r
+\r
+               float weapon_clipload, weapon_clipsize;\r
 \r
-               if (a > 0) { // if we have fuel, draw the amount\r
-                       float invincibility_time, dt;\r
-                       invincibility_time = getstatf(STAT_INVINCIBLE_FINISHED);\r
-                       dt = invincibility_time - time;\r
-                       pos_x = bottom_x + 140;\r
-                       pos_y = bottom_y - 20;\r
-                       drawpic(pos - '98 18 0', GetAmmoPicture(1), '20 20 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\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
+                       a = getstati(GetAmmoStat(0)); // how much fuel do we have?\r
+                       drawpic(pos - '98 18 0', GetAmmoPicture(0), '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
                }\r
+               else\r
+               {\r
+                       float i;\r
+                       for (i = 0; i < 1; ++i)\r
+                       {\r
+                               if (stat_items & GetAmmoItemCode(i))\r
+                               {\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
+                                       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
+\r
+               // weapon icon\r
+               entity e;\r
+               e = get_weaponinfo(activeweapon);\r
+               if (e && e.netname != "" && e.netname != "N/A")\r
+                       drawpic(bottom - '96 96 0', strcat("gfx/hud/bg_status_activeweapon_", e.netname), '192 96 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
                // draw scores and timer\r
                Sbar_Score();\r
@@ -3019,6 +3106,16 @@ void Sbar_Draw (void)
                        CSQC_ctf_hud();\r
                else if(gametype == GAME_CTS || gametype == GAME_RACE)\r
                        CSQC_race_hud();\r
+\r
+               // draw the canleave message\r
+               if(getstati(STAT_VORE_CANLEAVE))\r
+               if not(spectatee_status) // this message doesn't address spectated players\r
+               {\r
+                       s = strcat("^7Press ^3", getcommandkey("jump", "+jump"), " ^7to exit");\r
+                       pos_x = bottom_x - stringwidth(s, TRUE, '0 0 0') * 16 / 2;\r
+                       pos_y = bottom_y - 120;\r
+                       drawcolorcodedstring(pos, s, '16 16 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+               }\r
        }\r
        return;\r
 }\r