]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/sbar.qc
Fix the map voting screen. I have no idea why that 'else' check was there. Anyway...
[voretournament/voretournament.git] / data / qcsrc / client / sbar.qc
index 9b3db2e22a2bf0087c687e560758dfad1eaf43a1..73b6ee56dc5aedf20ede16f39f7a962e44e95993 100644 (file)
@@ -985,7 +985,7 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
                }\r
 \r
                if(field == ST_HEALTH)\r
-               if(g_vore_showpreyhealth) {\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
@@ -1396,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
@@ -1477,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
@@ -1490,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
@@ -2397,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
@@ -2451,8 +2457,8 @@ void Sbar_DrawAccuracyStats()
        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 = 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
+//     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
@@ -2464,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
@@ -2514,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
@@ -2904,9 +2912,7 @@ void Sbar_Draw (void)
                         Sbar_Score();\r
                         Sbar_Timer();\r
                 }\r
-               else\r
-                       Sbar_FinaleOverlay();\r
-\r
+               Sbar_FinaleOverlay();\r
                Sbar_Reset();\r
        }\r
        else if (sb_showscores_force || getstati(STAT_HEALTH) <= 0 || intermission == 1)\r
@@ -2935,76 +2941,79 @@ void Sbar_Draw (void)
                fade = 3.2 - 2 * (time - weapontime);\r
                fade = bound(0.7, fade, 1);\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
-\r
-               if(getstati(STAT_VORE_EATEN))\r
+               if(g_vore) // only when the vore system is active\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") * 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") * 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
+                       // 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
 \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
+                       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") * 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") * 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
-               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
+                       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
-               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
+                       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
-               // draw the stomach board player list\r
-               entity pl;\r
-               float f;\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
-               pos = bottomleft;\r
-               for(pl = players.sort_next; pl; pl = pl.sort_next)\r
-               {\r
-                       if(pl.team == COLOR_SPECTATOR)\r
-                               continue;\r
+                       // draw the stomach board player list\r
+                       entity pl;\r
+                       float f;\r
 \r
-                       if(getstati(STAT_VORE_EATEN))\r
-                               f = pl.plpredator == getstati(STAT_VORE_EATEN);\r
-                       else\r
+                       pos = bottomleft;\r
+                       for(pl = players.sort_next; pl; pl = pl.sort_next)\r
                        {\r
-                               if(spectatee_status)\r
-                                       f = pl.plpredator == 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.plpredator == 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_VORE_EATEN))\r
-                       if(pl.sv_entnum == getstati(STAT_VORE_EATEN) - 1)\r
-                               Sbar_PrintStomachboardItemPred(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) {\r