]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/sbar.qc
First part of the predator stomach board; Send the stomach load stat of the predator...
[voretournament/voretournament.git] / data / qcsrc / client / sbar.qc
index 46e13c67db149095866f3a75ad90bd34f8ff337e..60d5139f29797ecc8d7095c244e96fbe07b5833c 100644 (file)
@@ -513,7 +513,7 @@ void Cmd_Sbar_SetFields(float argc)
                                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
+                       if(str == "frags" && !(gametype == GAME_RPG))\r
                        {\r
                                j = SP_FRAGS;\r
                        }\r
@@ -1653,6 +1653,9 @@ void Sbar_Score()
        top_y = 0;\r
        top_z = 0;\r
 \r
+       if(gametype == GAME_RPG)\r
+               return;\r
+\r
        score_pos = top + '-240 8 0';\r
        secondary_score_pos = score_pos + '210 -6 0';\r
 \r
@@ -1888,6 +1891,9 @@ void Sbar_Timer()
        scale = cvar_or("sbar_timer_scale", 1);\r
        timelimit = getstatf(STAT_TIMELIMIT);\r
 \r
+       if(gametype == GAME_RPG && !timelimit) // don't draw the timer in rpg if there's no time limit\r
+               return;\r
+\r
        Sbar_DrawRaceStatus((topright_x - 100) * '1 0 0' + '0 30 0' * scale);\r
        \r
        timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time);\r
@@ -2866,20 +2872,20 @@ void Sbar_Draw (void)
                fade = 3.2 - 2 * (time - weapontime);\r
                fade = bound(0.7, fade, 1);\r
 \r
-               if not(getstati(STAT_STOMACH_EATEN)) // useless if we're inside someone\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
-                               }\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
                        }\r
+               }\r
+               //if not(getstati(STAT_STOMACH_EATEN)) // useless if we're inside someone\r
+               //{\r
                        float stomach_load;\r
                        stomach_load = getstati(STAT_STOMACH_LOAD);\r
 \r
@@ -2894,7 +2900,31 @@ void Sbar_Draw (void)
                                drawstring(bottomleft - '-76 150 0', "stomach empty", '14 14 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                        else\r
                                drawstring(bottomleft - '-76 150 0', "stomach has prey", '14 14 0', '0.75 1 0.75', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-               }\r
+               //}\r
+\r
+               // draw the stomach board\r
+               //if not(getstati(STAT_STOMACH_EATEN)) // useless if we're inside someone\r
+               //{\r
+                       entity pl;\r
+                       float f;\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
+\r
+                               if(spectatee_status)\r
+                                       f = pl.pleater == spectatee_status;\r
+                               else\r
+                                       f = pl.pleater == player_localentnum;\r
+                               if(f)\r
+                               {\r
+                                       Sbar_PrintStomachboardItem(pos - '-16 124 0', pl);\r
+                                       pos_y += 1.25 * sbar_fontsize_y;\r
+                               }\r
+                       }\r
+               //}\r
 \r
                if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) {\r
                        if (teamplay)\r
@@ -2932,30 +2962,6 @@ void Sbar_Draw (void)
                        Sbar_DrawXNum(pos - '144 16 0', a, 3, 0, 16, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                }\r
 \r
-               // draw the stomach board\r
-               if not(getstati(STAT_STOMACH_EATEN)) // useless if we're inside someone\r
-               {\r
-                       entity pl;\r
-                       float f;\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
-\r
-                               if(spectatee_status)\r
-                                       f = pl.pleater == spectatee_status;\r
-                               else\r
-                                       f = pl.pleater == player_localentnum;\r
-                               if(f)\r
-                               {\r
-                                       Sbar_PrintStomachboardItem(pos - '-16 124 0', pl);\r
-                                       pos_y += 1.25 * sbar_fontsize_y;\r
-                               }\r
-                       }\r
-               }\r
-\r
                // draw scores and timer\r
                Sbar_Score();\r
                Sbar_Timer();\r