]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/sbar.qc
Add stomach board indicator to show whether you are seeing your stomach or your preda...
[voretournament/voretournament.git] / data / qcsrc / client / sbar.qc
index 665abaa1353780043ae13aa3d7273d0aa5004f3b..663c3c219f07cd00f2e8fffd7fec4a56f45ebc79 100644 (file)
@@ -949,16 +949,9 @@ 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
-       vector tmp, rgb;\r
-       rgb = GetTeamRGB(pl.team);\r
        string str;\r
        float f, field;\r
 \r
-       // Layout:\r
-       tmp_x = sbwidth;\r
-       tmp_y = sbar_fontsize_y * 1.25;\r
-       tmp_z = 0;\r
-\r
        for(fieldcounter = 1; fieldcounter <= 2; ++fieldcounter)\r
        {\r
                field = -fieldcounter;\r
@@ -978,10 +971,10 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
                }\r
 \r
                if(field == ST_HEALTH)\r
-               if(g_vore_showpreyhealth && stof(str)) { // only if player health is not 0\r
+               if(g_vore_showpreyhealth && stof(str)) { // only if player health is not 0. Also used to hide the predators health\r
                        pos_x += 138;\r
                                if(pl.sv_entnum == player_localentnum - 1 || (spectatee_status && pl.sv_entnum == spectatee_status - 1))\r
-                                       drawcolorcodedstring(pos, " me", '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                                       drawcolorcodedstring(pos, "self", '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                                else\r
                                {\r
                                        drawpic(pos, "gfx/hud/sb_health", '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
@@ -2887,6 +2880,10 @@ void Sbar_Draw (void)
 \r
                                drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach", '256 256 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
                        }\r
+                       if(getstati(STAT_STOMACH_EATEN))\r
+                               drawpic(bottomleft- '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', '1 0 0', sbar_alpha_bg, DRAWFLAG_NORMAL);\r
+                       else\r
+                               drawpic(bottomleft- '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', '0 1 0', sbar_alpha_bg, DRAWFLAG_NORMAL);\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