]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/sbar.qc
Draw the two sbar rings. They will be used to indicate certain things, including...
[voretournament/voretournament.git] / data / qcsrc / client / sbar.qc
index 527872bcdef423d7a959192a835d1673073849cf..7fa1280d852f22f49b3039cfbf4af37feeb99a97 100644 (file)
@@ -919,6 +919,7 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
 \r
        string str;\r
        float f, field, field_number;\r
+       vector hl_color;\r
        field_number = 3; // the number of components each row has\r
 \r
        for(fieldcounter = 1; fieldcounter <= field_number; ++fieldcounter)\r
@@ -932,12 +933,13 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
                        if(getstati(STAT_VORE_EATEN))\r
                        {\r
                                if(teamplay && GetPlayerColor(pl.entnum - 1) == GetPlayerColor(player_localentnum - 1)) // same team\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
+                                       hl_color = stov(cvar_string("sbar_stomachboard_color2"));\r
                                else\r
-                                       drawfill(pos - '0 0 0', '193 11 0', stov(cvar_string("sbar_stomachboard_color3")), cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                                       hl_color = stov(cvar_string("sbar_stomachboard_color3"));\r
                        }\r
                        else\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
+                               hl_color = stov(cvar_string("sbar_stomachboard_color1"));\r
+                       drawfill(pos - '0 0 0', '193 11 0', hl_color, cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                }\r
 \r
                if(field == ST_NAME) {\r
@@ -1942,14 +1944,12 @@ void Sbar_Timer()
        } else {\r
                minutes = minutesLeft;\r
                seconds = secondsLeft;\r
-               if (minutes == 0)\r
-                       bgpos_x = topright_x - (58 + 7 + 12) * scale;\r
-               else if (minutes < 10) // nudge the timer background left if more digits are drawn\r
-                       bgpos_x = topright_x - (66 + 17 + 12) * scale;\r
+               if (minutes < 10) // nudge the timer background left if more digits are drawn\r
+                       bgpos_x = topright_x - (54 + 17 + 12) * scale;\r
                else if (minutes < 100)\r
-                       bgpos_x = topright_x - (74 + 17 + 12) * scale;\r
+                       bgpos_x = topright_x - (62 + 17 + 12) * scale;\r
                else\r
-                       bgpos_x = topright_x - (82 + 17 + 12) * scale;\r
+                       bgpos_x = topright_x - (70 + 17 + 12) * scale;\r
                bgpos_y = 0;\r
                bgpos_z = 0;\r
        }\r
@@ -1967,9 +1967,7 @@ void Sbar_Timer()
        }\r
 \r
        drawpic(topright - ('19 0 0' + '3 0 0' - '0 2 0'), "gfx/hud/sb_time", '22 22 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-       if(minutesLeft >= 1 || cvar("sbar_increment_maptime") || timelimit == 0 || warmup_stage) {\r
-               finaltime = strcat(ftos(minutes), ":");\r
-       }\r
+       finaltime = strcat(ftos(minutes), ":");\r
        if(seconds < 10)\r
                finaltime = strcat(finaltime, "0", ftos(seconds));\r
        else\r
@@ -1980,6 +1978,18 @@ void Sbar_Timer()
        drawstring(pos, finaltime, 18 * scale * '1 1 0', timer_color, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 }\r
 \r
+void Sbar_Ring()\r
+{\r
+       vector pos;\r
+       pos_x = vid_conwidth / 2;\r
+       pos_y = vid_conheight / 1.375;\r
+       pos_z = 0;\r
+\r
+       DrawCircleClippedPic(pos, 100, "gfx/hud/sb_ring.tga", 0.85, '1 1 1', 1 * sbar_alpha_fg, DRAWFLAG_ADDITIVE);\r
+\r
+       DrawCircleClippedPic(pos, 80, "gfx/hud/sb_ring.tga", 0.75, '1 1 1', 1 * sbar_alpha_fg, DRAWFLAG_ADDITIVE);\r
+}\r
+\r
 void CSQC_Strength_Timer() {\r
        vector pos;\r
        vector bottomright;\r
@@ -2928,19 +2938,23 @@ void Sbar_Draw (void)
                                }\r
                        }\r
 \r
+                       vector hl_color;\r
+                       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
-                                       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
+                                       hl_color = stov(cvar_string("sbar_stomachboard_color2"));\r
                                else\r
-                                       drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', StomachStatus_ColorFade(stov(cvar_string("sbar_stomachboard_color3"))), cvar("sbar_stomachboard_status_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-                               drawstring(bottomleft - '-80 173 0', "predator:", '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                                       hl_color = stov(cvar_string("sbar_stomachboard_color3"));\r
+                               hl_string = "predator:";\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 173 0', "self:", '11 11 0', ' 1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                               hl_color = stov(cvar_string("sbar_stomachboard_color1"));\r
+                               hl_string = "self:";\r
                        }\r
+                       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
@@ -3083,9 +3097,10 @@ void Sbar_Draw (void)
                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
-               // draw scores and timer\r
+               // draw scores, timer, and ring\r
                Sbar_Score();\r
                Sbar_Timer();\r
+               Sbar_Ring();\r
 \r
                // draw strength/invincibility icon and timer\r
                CSQC_Strength_Timer();\r