]> git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/sbar.qc
Match reading properly
[voretournament/voretournament.git] / data / qcsrc / client / sbar.qc
index f8d7eefc002920842e0e5a6e91d46bc9e10bc9e6..40171815fb9890d12e0204ff9493b0c1117b7d7d 100644 (file)
@@ -122,7 +122,7 @@ void Sbar_DrawXNum (vector pos, float num, float digits, float showminusplus, fl
        drawstring(pos, final_num, vsize, rgb, alpha, dflags);\r
 }\r
 \r
-void Sbar_DrawXNum_Colored (vector pos, float x, float lettersize, float alpha)\r
+vector Sbar_NumColor (float x)\r
 {\r
        if(x > 200) {\r
                color_x = 0;\r
@@ -144,17 +144,17 @@ void Sbar_DrawXNum_Colored (vector pos, float x, float lettersize, float alpha)
                color_y = 1;\r
                color_z = 0.2 + (x-50)*0.02 * 0.8; // blue value between 0.2 -> 1\r
        }\r
-       else if(x > 20) {\r
+       else if(x > 25) {\r
                color_x = 1;\r
-               color_y = (x-20)*90/27/100; // green value between 0 -> 1\r
-               color_z = (x-20)*90/27/100 * 0.2; // blue value between 0 -> 0.2\r
+               color_y = (x-25)*90/27/100; // green value between 0 -> 1\r
+               color_z = (x-25)*90/27/100 * 0.2; // blue value between 0 -> 0.2\r
        }\r
        else {\r
                color_x = 1;\r
                color_y = 0;\r
                color_z = 0;\r
        }\r
-       Sbar_DrawXNum(pos, x, 3, 0, lettersize, color, alpha, DRAWFLAG_NORMAL);\r
+       return color;\r
 }\r
 \r
 void Cmd_Sbar_SetFields(float argc);\r
@@ -795,11 +795,9 @@ void Sbar_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_num
        float is_spec;\r
        is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);\r
        \r
-       if((rgb == '1 1 1') && (!is_spec)) {\r
-               rgb_x = cvar("sbar_color_bg_r") + 0.5;\r
-               rgb_y = cvar("sbar_color_bg_g") + 0.5;\r
-               rgb_z = cvar("sbar_color_bg_b") + 0.5; }\r
-               \r
+       if((rgb == '1 1 1') && (!is_spec))\r
+               rgb = stov(cvar_string("sbar_color_bg")) + '0.5 0.5 0.5';\r
+\r
        // Layout:\r
        tmp_x = sbwidth;\r
        tmp_y = sbar_fontsize_y * 1.25;\r
@@ -932,7 +930,7 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
                {\r
                        if(getstati(STAT_VORE_EATEN))\r
                        {\r
-                               if(teamplay && GetPlayerColor(pl.entnum - 1) == GetPlayerColor(player_localentnum - 1)) // same team\r
+                               if(teamplay && (GetPlayerColor(getstati(STAT_VORE_EATEN) - 1) == GetPlayerColor(player_localentnum - 1) || GetPlayerColor(getstati(STAT_VORE_EATEN) - 1) == GetPlayerColor(spectatee_status - 1))) // same team\r
                                        hl_color = stov(cvar_string("sbar_stomachboard_color2"));\r
                                else\r
                                        hl_color = stov(cvar_string("sbar_stomachboard_color3"));\r
@@ -952,8 +950,7 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
                        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(stof(str) > 0) {\r
+               if(field == ST_HEALTH) {\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
@@ -1271,9 +1268,7 @@ vector Sbar_DrawScoreboardRankings(vector pos, entity pl,  vector rgb, vector bg
        float is_spec;\r
        is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);\r
        vector hl_rgb;\r
-               hl_rgb_x = cvar("sbar_color_bg_r") + 0.5;\r
-               hl_rgb_y = cvar("sbar_color_bg_g") + 0.5;\r
-               hl_rgb_z = cvar("sbar_color_bg_b") + 0.5;\r
+               hl_rgb = stov(cvar_string("sbar_color_bg")) + '0.5 0.5 0.5';\r
 \r
        pos_y += sbar_fontsize_y;\r
        drawstring(pos, strcat("Rankings"), sbar_fontsize, '1 1 1', sbar_scoreboard_alpha_fg, DRAWFLAG_NORMAL);\r
@@ -1396,9 +1391,7 @@ void Sbar_DrawScoreboard()
        }\r
        else\r
        {\r
-               rgb_x = cvar("sbar_color_bg_r");\r
-               rgb_y = cvar("sbar_color_bg_g");\r
-               rgb_z = cvar("sbar_color_bg_b");\r
+               rgb = stov(cvar_string("sbar_color_bg"));\r
 \r
                for(tm = teams.sort_next; tm; tm = tm.sort_next)\r
                {\r
@@ -1596,6 +1589,38 @@ float race_CheckName(string net_name) { // Does the name already exist in rankin
        return 0;\r
 }\r
 \r
+float GetAmmoStat(float i)\r
+{\r
+       switch(i)\r
+       {\r
+               case 0: return STAT_FUEL;\r
+               default: return -1;\r
+       }\r
+}\r
+\r
+float GetAmmoItemCode(float i)\r
+{\r
+       switch(i)\r
+       {\r
+               case 0: return IT_FUEL;\r
+               default: return -1;\r
+       }\r
+}\r
+\r
+string GetAmmoPicture(float i)\r
+{\r
+       switch(i)\r
+       {\r
+               case 0:\r
+                       if(getstati(STAT_ITEMS) & IT_FUEL_REGEN)\r
+                               return "gfx/hud/sb_fuel_regen";\r
+                       else\r
+                               return "gfx/hud/sb_fuel";\r
+               default:\r
+                       return "";\r
+       }\r
+}\r
+\r
 float race_status_time;\r
 float race_status_prev;\r
 string race_status_name_prev;\r
@@ -1892,6 +1917,108 @@ void Sbar_Score()
        }\r
 }\r
 \r
+void Sbar_Status()\r
+{\r
+       vector bottom;\r
+       bottom_x = vid_conwidth/2;\r
+       bottom_y = vid_conheight;\r
+       bottom_z = 0;\r
+\r
+       float armor, health, x, a;\r
+       armor = getstati(STAT_ARMOR);\r
+       health = getstati(STAT_HEALTH);\r
+\r
+       float stat_items;\r
+       stat_items = getstati(STAT_ITEMS);\r
+\r
+       vector health_pos, armor_pos, pos;\r
+       health_pos = bottom - '43 58 0';\r
+       armor_pos = bottom - '43 68 0';\r
+\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
+                       // allow for custom HUD colors in non-teamgames\r
+                       color = stov(cvar_string("sbar_color_bg"));\r
+\r
+                       drawpic(bottom - '96 96 0', "gfx/hud/bg_status", '192 96 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
+               }\r
+       }\r
+\r
+       // armor\r
+       x = armor;\r
+       if (x > 0)\r
+       {\r
+               drawpic(armor_pos + '-8 -13.5 0', "gfx/hud/sb_armor", '16 16 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+               armor_pos -= '1 0 0' * stringwidth(ftos(x), FALSE, '12 12 0') * 0.5;\r
+               Sbar_DrawXNum(armor_pos, x, 3, 0, 12, Sbar_NumColor(x), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+       }\r
+\r
+       // health\r
+       x = health;\r
+       drawpic(health_pos + '-11 16 0', "gfx/hud/sb_health", '32 32 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+       health_pos -= '1 0 0' * stringwidth(ftos(x), FALSE, '22 22 0') * 0.5;\r
+       Sbar_DrawXNum(health_pos, x, 3, 0, 22, Sbar_NumColor(x), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+\r
+       // ammo\r
+       pos_x = bottom_x + 140;\r
+       pos_y = bottom_y - 20;\r
+\r
+       float weapon_clipload, weapon_clipsize;\r
+       vector ammo_pos_offset;\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
+               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
+               ammo_pos_offset = '1 0 0' * stringwidth(ftos(a), FALSE, '16 16 0') * 0.5;\r
+               Sbar_DrawXNum(pos - '118 16 0' - ammo_pos_offset, a, 3, 0, 16, '1 1 1', 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
+                                       // 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
+                                       {\r
+                                               ammo_pos_offset = '1 0 0' * stringwidth("- -", FALSE, '16 16 0') * 0.5;\r
+                                               drawstring(pos - '118 23 0' - ammo_pos_offset, "- -", '16 16 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               ammo_pos_offset = '1 0 0' * stringwidth(ftos(weapon_clipload), FALSE, '16 16 0') * 0.5;\r
+                                               Sbar_DrawXNum(pos - '118 23 0' - ammo_pos_offset, weapon_clipload, 2, 0, 16, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                                       }\r
+                                       ammo_pos_offset = '1 0 0' * stringwidth(ftos(a), FALSE, '12 12 0') * 0.5;\r
+                                       Sbar_DrawXNum(pos - '118 7 0' - ammo_pos_offset, a, 3, 0, 12, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                               }\r
+                               else\r
+                               {\r
+                                       ammo_pos_offset = '1 0 0' * stringwidth(ftos(a), FALSE, '16 16 0') * 0.5;\r
+                                       Sbar_DrawXNum(pos - '118 16 0' - ammo_pos_offset, a, 3, 0, 16, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                               }\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
+\r
 void Sbar_Timer()\r
 {\r
        float timelimit, elapsedTime, minutes, seconds, timeleft, minutesLeft, secondsLeft;\r
@@ -1958,9 +2085,7 @@ void Sbar_Timer()
                if (teamplay)\r
                        drawpic(bgpos, "gfx/hud/bg_timer", '120 30 0' * scale, GetTeamRGB(myteam) * sbar_color_bg_team, sbar_alpha_bg, DRAWFLAG_NORMAL); // timer bg color = myteam color\r
                else {\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
+                       color = stov(cvar_string("sbar_color_bg"));\r
 \r
                        drawpic(bgpos, "gfx/hud/bg_timer", '120 30 0' * scale, color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
                }\r
@@ -1986,7 +2111,7 @@ void Sbar_Ring()
        string text1_msg, text2_msg;\r
 \r
        ring_pos_x = vid_conwidth / 2;\r
-       ring_pos_y = vid_conheight / 1.375;\r
+       ring_pos_y = vid_conheight - vid_conheight / 3.5;\r
        ring1_size = cvar("sbar_ring1_scale");\r
        ring2_size = cvar("sbar_ring2_scale");\r
        ring1_alpha = sbar_alpha_fg * cvar("sbar_ring1_alpha");\r
@@ -2001,22 +2126,16 @@ void Sbar_Ring()
                        break;\r
                case 1:\r
                        // ring shows predator swallow progress, fills with progress\r
-                       if not(cvar("sbar_ring1_info_swallowprogress_pred"))\r
-                               break;\r
                        ring1_color = '0.5 1 0.5';\r
                        text1_msg = "Swallowing...";\r
                        break;\r
                case 2:\r
                        // ring shows vore system delay, empties with progress\r
-                       if not(cvar("sbar_ring1_info_voredelay"))\r
-                               break;\r
                        ring1_color = '0.5 0.5 1';\r
                        text1_msg = "Vore delay";\r
                        break;\r
                case 3:\r
                        // ring shows stomach kick delay, empties with progress\r
-                       if not(cvar("sbar_ring1_info_kickdelay"))\r
-                               break;\r
                        ring1_color = '1 1 0.5';\r
                        text1_msg = "Kick delay";\r
                        break;\r
@@ -2031,15 +2150,11 @@ void Sbar_Ring()
                        break;\r
                case 1:\r
                        // ring shows prey swallow progress, fills with progress\r
-                       if not(cvar("sbar_ring2_info_swallowprogress_prey"))\r
-                               break;\r
                        ring2_color = '1 0.5 0.5';\r
                        text2_msg = "Swallowed...";\r
                        break;\r
                case 2:\r
                        // ring shows regurgitation preparing, fills with progress\r
-                       if not(cvar("sbar_ring2_info_regurgitateprepare"))\r
-                               break;\r
                        ring2_color = '1 0.5 1';\r
                        text2_msg = "Regurgitating...";\r
                        break;\r
@@ -2220,8 +2335,8 @@ void centerprint(string strMessage)
        havail = vid_conheight;\r
        if(cvar("con_chatpos") < 0)\r
                havail -= (-cvar("con_chatpos") + cvar("con_chat")) * cvar("con_chatsize"); // avoid overlapping chat\r
-       if(havail > vid_conheight - 70)\r
-               havail = vid_conheight - 70; // avoid overlapping HUD\r
+       if(havail > vid_conheight / 4)\r
+               havail = vid_conheight / 4; // avoid overlapping HUD\r
 \r
        centerprint_start_x = 0;\r
 \r
@@ -2650,38 +2765,6 @@ void drawstringcenter(vector position, string text, vector scale, vector rgb, fl
        drawstring(position, text, scale, rgb, alpha, flag);\r
 }\r
 \r
-float GetAmmoStat(float i)\r
-{\r
-       switch(i)\r
-       {\r
-               case 0: return STAT_FUEL;\r
-               default: return -1;\r
-       }\r
-}\r
-\r
-float GetAmmoItemCode(float i)\r
-{\r
-       switch(i)\r
-       {\r
-               case 0: return IT_FUEL;\r
-               default: return -1;\r
-       }\r
-}\r
-\r
-string GetAmmoPicture(float i)\r
-{\r
-       switch(i)\r
-       {\r
-               case 0:\r
-                       if(getstati(STAT_ITEMS) & IT_FUEL_REGEN)\r
-                               return "gfx/hud/sb_fuel_regen";\r
-                       else\r
-                               return "gfx/hud/sb_fuel";\r
-               default:\r
-                       return "";\r
-       }\r
-}\r
-\r
 void Sbar_Reset (void)\r
 {\r
        // reset gametype specific icons\r
@@ -2755,8 +2838,7 @@ void Sbar_Draw (void)
        sbar_color_bg_team = cvar("sbar_color_bg_team");\r
 \r
        float weapon_stats;\r
-       float x, fade;\r
-       float stat_items, stat_weapons;\r
+       float fade;\r
 \r
        weapon_stats = getstati(STAT_DAMAGE_HITS);\r
        weapon_number = weapon_stats & 63;\r
@@ -2922,11 +3004,8 @@ void Sbar_Draw (void)
 \r
                if (teamplay)\r
                        color =  GetTeamRGB(myteam) * sbar_color_bg_team;\r
-               else {\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
+               else\r
+                       color = stov(cvar_string("sbar_color_bg"));\r
 \r
                vector voteorigin = bottomright - '290 135 0';\r
                vector votesize = '280 70 0';\r
@@ -2982,6 +3061,8 @@ void Sbar_Draw (void)
                Sbar_DrawScoreboard();\r
                Sbar_Score();\r
                Sbar_Timer();\r
+               if(getstati(STAT_VORE_EATEN))\r
+                       Sbar_Status();\r
 \r
                Sbar_Reset();\r
 \r
@@ -2993,12 +3074,6 @@ void Sbar_Draw (void)
                        Sbar_DrawAccuracyStats();\r
                else\r
                        Sbar_DrawScoreboard();\r
-               float armor, health;\r
-               armor = getstati(STAT_ARMOR);\r
-               health = getstati(STAT_HEALTH);\r
-\r
-               stat_items = getstati(STAT_ITEMS);\r
-               stat_weapons = getstati(STAT_WEAPONS);\r
 \r
                fade = 3.2 - 2 * (time - weapontime);\r
                fade = bound(0.7, fade, 1);\r
@@ -3011,9 +3086,7 @@ void Sbar_Draw (void)
                                        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
+                                       color = stov(cvar_string("sbar_color_bg"));\r
 \r
                                        drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach", '256 256 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
                                }\r
@@ -3023,7 +3096,7 @@ void Sbar_Draw (void)
                        string hl_string;\r
                        if(getstati(STAT_VORE_EATEN))\r
                        {\r
-                               if(teamplay && GetPlayerColor(getstati(STAT_VORE_EATEN) - 1) == GetPlayerColor(player_localentnum - 1)) // same team\r
+                               if(teamplay && (GetPlayerColor(getstati(STAT_VORE_EATEN) - 1) == GetPlayerColor(player_localentnum - 1) || GetPlayerColor(getstati(STAT_VORE_EATEN) - 1) == GetPlayerColor(spectatee_status - 1))) // same team\r
                                        hl_color = stov(cvar_string("sbar_stomachboard_color2"));\r
                                else\r
                                        hl_color = stov(cvar_string("sbar_stomachboard_color3"));\r
@@ -3037,28 +3110,39 @@ void Sbar_Draw (void)
                        drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', StomachStatus_ColorFade(hl_color), cvar("sbar_stomachboard_status_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                        drawstring(bottomleft - '-80 173 0', hl_string, '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \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
+                       float stomach_load, stomach_maxload; // shows the predator's stomach load when we are eaten, and ours otherwise\r
+                       stomach_load = getstati(STAT_VORE_LOAD);\r
+                       stomach_maxload = getstati(STAT_VORE_MAXLOAD);\r
 \r
                        vector status_pos;\r
-                       string status_text;\r
-                       status_text = strcat(ftos(bound(0, stomach_load, 9)), "/", ftos(bound(0, g_balance_vore_swallow_limit, 9)));\r
-                       status_pos = bottomleft - '-43 171 0';\r
-                       status_pos -= '1 0 0' * stringwidth(status_text, FALSE, '22 22 0') * 0.5;\r
-                       drawstring(status_pos, status_text, '22 22 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\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
+                       string status_text, status_color;\r
+                       float status_size;\r
+                       status_color = rgb_to_hexcolor('0.5 0.5 0.5' + Sbar_NumColor(stomach_maxload) * 0.5); // twice brighter than health / armor colors\r
+                       if(stomach_load)\r
+                       {\r
+                               status_text = strcat(ftos(stomach_load), "^8/", status_color, ftos(stomach_maxload));\r
+                               status_pos = bottomleft - '-43 168 0';\r
+                               status_size = 16;\r
+                       }\r
+                       else if(g_healthsize_center >= 0) // no point in showing it otherwise\r
+                       {\r
+                               status_text = strcat(status_color, ftos(stomach_maxload));\r
+                               status_pos = bottomleft - '-43 170 0';\r
+                               status_size = 20;\r
+                       }\r
+                       status_pos -= '1 0 0' * stringwidth(status_text, TRUE, '1 0 0' * status_size) * 0.5;\r
+                       drawcolorcodedstring(status_pos, status_text, '1 1 0' * status_size, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+\r
+                       if(getstati(STAT_VORE_DIGESTING)) // we are currently digesting\r
+                               drawpic(bottomleft - '-35 149 0', "gfx/hud/sb_digestion", '16 16 0', '0 1 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       else if(stomach_load) // we can digest at this time\r
+                               drawpic(bottomleft - '-35 149 0', "gfx/hud/sb_digestion", '16 16 0', '0.25 0.25 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       else // we cannot digest at this time\r
+                               drawpic(bottomleft - '-35 149 0', "gfx/hud/sb_digestion", '16 16 0', '0.25 0 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
                        // draw the stomach board player list\r
-                       entity pl;\r
-                       float f;\r
+                       entity pl, pred;\r
+                       float f, l;\r
 \r
                        pos = bottomleft;\r
                        for(pl = players.sort_next; pl; pl = pl.sort_next)\r
@@ -3076,109 +3160,33 @@ void Sbar_Draw (void)
                                                f = pl.plpredator == player_localentnum;\r
                                }\r
 \r
-                               if(f)\r
+                               if(f && l <= 8) // limit the stomach board to 9 entries due to the HUD design\r
                                {\r
                                        Sbar_PrintStomachboardItem(pos - '-16 124 0', pl);\r
                                        pos_y += 1.1 * sbar_fontsize_y;\r
+                                       l += 1;\r
                                }\r
 \r
+                               // set the predator's name\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) {\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
-                               // 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(bottom - '96 96 0', "gfx/hud/bg_status", '192 96 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
-                       }\r
-               }\r
-\r
-               vector health_pos, armor_pos;\r
-               health_pos = bottom - '43 58 0';\r
-               armor_pos = bottom - '43 68 0';\r
-\r
-               // armor\r
-               x = armor;\r
-               if (x > 0)\r
-               {\r
-                       drawpic(armor_pos + '-8 -13.5 0', "gfx/hud/sb_armor", '16 16 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                       armor_pos -= '1 0 0' * stringwidth(ftos(x), FALSE, '12 12 0') * 0.5;\r
-                       Sbar_DrawXNum_Colored(armor_pos, x, 12, sbar_alpha_fg);\r
-               }\r
-\r
-               // health\r
-               x = health;\r
-               drawpic(health_pos + '-11 16 0', "gfx/hud/sb_health", '32 32 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-               health_pos -= '1 0 0' * stringwidth(ftos(x), FALSE, '22 22 0') * 0.5;\r
-               Sbar_DrawXNum_Colored(health_pos, x, 22, sbar_alpha_fg);\r
-\r
-               // ammo\r
-               pos_x = bottom_x + 140;\r
-               pos_y = bottom_y - 20;\r
-\r
-               float weapon_clipload, weapon_clipsize;\r
-               vector ammo_pos_offset;\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
-                       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
-                       ammo_pos_offset = '1 0 0' * stringwidth(ftos(a), FALSE, '16 16 0') * 0.5;\r
-                       Sbar_DrawXNum(pos - '118 16 0' - ammo_pos_offset, a, 3, 0, 16, '1 1 1', 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
-                                               {\r
-                                                       ammo_pos_offset = '1 0 0' * stringwidth("- -", FALSE, '16 16 0') * 0.5;\r
-                                                       drawstring(pos - '118 23 0' - ammo_pos_offset, "- -", '16 16 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                                               }\r
-                                               else\r
-                                               {\r
-                                                       ammo_pos_offset = '1 0 0' * stringwidth(ftos(weapon_clipload), FALSE, '16 16 0') * 0.5;\r
-                                                       Sbar_DrawXNum(pos - '118 23 0' - ammo_pos_offset, weapon_clipload, 2, 0, 16, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                                               }\r
-                                               ammo_pos_offset = '1 0 0' * stringwidth(ftos(a), FALSE, '12 12 0') * 0.5;\r
-                                               Sbar_DrawXNum(pos - '118 7 0' - ammo_pos_offset, a, 3, 0, 12, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                                       }\r
-                                       else\r
-                                       {\r
-                                               ammo_pos_offset = '1 0 0' * stringwidth(ftos(a), FALSE, '16 16 0') * 0.5;\r
-                                               Sbar_DrawXNum(pos - '118 16 0' - ammo_pos_offset, a, 3, 0, 16, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                                       }\r
+                                       if(pl.sv_entnum == getstati(STAT_VORE_EATEN) - 1)\r
+                                               pred = pl;\r
                                }\r
+                               else if(pl.sv_entnum == player_localentnum - 1 || pl.sv_entnum == spectatee_status - 1)\r
+                                       pred = pl; // show us or the spectated player\r
                        }\r
+\r
+                       // draw the predator's name\r
+                       Sbar_PrintStomachboardItemPred(bottomleft - '-76 150 0', pred);\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
+//             if(getstati(STAT_HEALTH) > 0)\r
+//             if(getstati(STAT_ARMOR) < g_power)\r
+//                     return;\r
 \r
-               // draw scores, timer, and ring\r
+               // draw status, scores, timer, and ring\r
+               Sbar_Status();\r
                Sbar_Score();\r
                Sbar_Timer();\r
                Sbar_Ring();\r