]> git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/sbar.qc
Bigger text
[voretournament/voretournament.git] / data / qcsrc / client / sbar.qc
index c65579a5944aa5512d25852094a3cc2e95aeee69..5d5326cff2446e46eaf089372eb8aba035b37f8c 100644 (file)
@@ -949,16 +949,11 @@ 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
+       // list the players in the stomach\r
+\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
@@ -967,6 +962,14 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
 \r
                str = Sbar_GetStomachField(pl, field);\r
 \r
+               if(field == ST_NAME) // do this for one field, or we get multiple highlights in the same spot\r
+               {\r
+                       if(getstati(STAT_STOMACH_EATEN))\r
+                               drawfill(pos - '0 0 0', '193 11 0', '1 0 0' * cvar("sbar_stomachboard_highlight_brightness"), cvar("sbar_stomachboard_highlight_alpha"), DRAWFLAG_NORMAL);\r
+                       else\r
+                               drawfill(pos - '0 0 0', '193 11 0', '0 1 0' * cvar("sbar_stomachboard_highlight_brightness"), cvar("sbar_stomachboard_highlight_alpha"), DRAWFLAG_NORMAL);\r
+               }\r
+\r
                if(field == ST_NAME) {\r
                        f = stof(getplayerkey(pl.sv_entnum, "colors"));\r
                        drawpic(pos, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
@@ -978,14 +981,45 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
                }\r
 \r
                if(field == ST_HEALTH)\r
-               if(stof(str)) { // only if player health is not 0\r
+               if(g_vore_showpreyhealth) {\r
                        pos_x += 138;\r
-                       if(g_vore_showpreyhealth)\r
-                               drawpic(pos, "gfx/hud/sb_health", '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\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
+                               else\r
+                               {\r
+                                       drawpic(pos, "gfx/hud/sb_health", '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+\r
+                                       pos_x += 9;\r
+                                               drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                               }\r
+               }\r
+       }\r
+}\r
+\r
+float fieldcounter2;\r
+void Sbar_PrintStomachboardItem2(vector pos, entity pl)\r
+{\r
+       // show the name of our eater\r
+\r
+       string str;\r
+       float f, field;\r
+\r
+       for(fieldcounter2 = 1; fieldcounter2 <= 2; ++fieldcounter2)\r
+       {\r
+               field = -fieldcounter2;\r
+               if(field == SP_SEPARATOR)\r
+                       break;\r
+\r
+               str = Sbar_GetStomachField(pl, field);\r
+\r
+               if(field == ST_NAME) {\r
+                       f = stof(getplayerkey(pl.sv_entnum, "colors"));\r
+                       drawpic(pos, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(pos, "gfx/sb_playercolor_shirt", '22 11 0', colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(pos, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
-                       pos_x += 9;\r
-                       if(g_vore_showpreyhealth)\r
-                               drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       pos_x += 24;\r
+                       drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                }\r
        }\r
 }\r
@@ -2591,6 +2625,30 @@ float vote_prev; // previous state of vote_active to check for a change
 float vote_alpha;\r
 float vote_change; // "time" when vote_active changed\r
 \r
+vector colortrans_current;\r
+vector Stomachstatus_Colortrans(vector target_color)\r
+{\r
+       local float step;\r
+       step = 0.0125;\r
+\r
+       if(colortrans_current_x > target_color_x + step)\r
+               colortrans_current_x -= step;\r
+       else if(colortrans_current_x < target_color_x - step)\r
+               colortrans_current_x += step;\r
+\r
+       if(colortrans_current_y > target_color_y + step)\r
+               colortrans_current_y -= step;\r
+       else if(colortrans_current_y < target_color_y - step)\r
+               colortrans_current_y += step;\r
+\r
+       if(colortrans_current_z > target_color_z + step)\r
+               colortrans_current_z -= step;\r
+       else if(colortrans_current_z < target_color_z - step)\r
+               colortrans_current_z += step;\r
+\r
+       return colortrans_current;\r
+}\r
+\r
 void Sbar_Draw (void)\r
 {\r
        // vectors for top right, bottom right, bottom and bottom left corners\r
@@ -2856,6 +2914,8 @@ void Sbar_Draw (void)
                Sbar_Timer();\r
 \r
                Sbar_Reset();\r
+\r
+               Stomachstatus_Colortrans('0 0 0');\r
        }\r
        else\r
        {\r
@@ -2884,6 +2944,17 @@ 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
+\r
+                       if(getstati(STAT_STOMACH_EATEN))\r
+                       {\r
+                               drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', '1 0 0' * cvar("sbar_stomachboard_status_brightness"), cvar("sbar_stomachboard_status_alpha"), 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', '0 1 0' * cvar("sbar_stomachboard_status_brightness"), cvar("sbar_stomachboard_status_alpha"), 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
@@ -2930,7 +3001,7 @@ void Sbar_Draw (void)
 \r
                        if(getstati(STAT_STOMACH_EATEN))\r
                        if(pl.sv_entnum == getstati(STAT_STOMACH_EATEN) - 1)\r
-                               Sbar_PrintStomachboardItem(pos - '-76 156 0', pl);\r
+                               Sbar_PrintStomachboardItem2(bottomleft - '-76 156 0', pl);\r
                }\r
 \r
                if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) {\r