]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/sbar.qc
I think Jump is a more appropriate key for getting out than Alt Fire. Also don't...
[voretournament/voretournament.git] / data / qcsrc / client / sbar.qc
index 62e8d5131ec4b3388690a8f9387538c49bf096c1..746861aab913bbf75ddfc25fbd1053c235a27931 100644 (file)
@@ -508,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
@@ -967,10 +968,10 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
                // row highlighting\r
                if(field == ST_HIGHLIGHT)\r
                {\r
-                       if(getstati(STAT_STOMACH_EATEN))\r
-                               drawfill(pos - '0 0 0', '193 11 0', stov(cvar_string("sbar_stomachboard_color2")), cvar("sbar_stomachboard_highlight_alpha"), DRAWFLAG_NORMAL);\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"), DRAWFLAG_NORMAL);\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
@@ -2948,25 +2949,25 @@ void Sbar_Draw (void)
                        }\r
                }\r
 \r
-               if(getstati(STAT_STOMACH_EATEN))\r
+               if(getstati(STAT_VORE_EATEN))\r
                {\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"), 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_ColorFade(stov(cvar_string("sbar_stomachboard_color1"))), cvar("sbar_stomachboard_status_alpha"), 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
+               stomach_load = getstati(STAT_VORE_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
 \r
-               if(getstati(STAT_STOMACH_DIGESTING))\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
@@ -2985,8 +2986,8 @@ void Sbar_Draw (void)
                        if(pl.team == COLOR_SPECTATOR)\r
                                continue;\r
 \r
-                       if(getstati(STAT_STOMACH_EATEN))\r
-                               f = pl.pleater == getstati(STAT_STOMACH_EATEN);\r
+                       if(getstati(STAT_VORE_EATEN))\r
+                               f = pl.pleater == getstati(STAT_VORE_EATEN);\r
                        else\r
                        {\r
                                if(spectatee_status)\r
@@ -3001,8 +3002,8 @@ void Sbar_Draw (void)
                                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
+                       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
@@ -3074,6 +3075,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