X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=data%2Fqcsrc%2Fclient%2Fsbar.qc;h=06fdcc215af57ad6d1d7d99c80c848316fe5af96;hb=bb24a2e88c9eac0658680c63fcba53c592fa0db7;hp=2ef328c0d6c67f98368e40b3d5e98e8cd678e6c4;hpb=829dd8207468230c9ce035a8c5622af026e932bb;p=voretournament%2Fvoretournament.git diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 2ef328c0..06fdcc21 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -949,16 +949,11 @@ void Sbar_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_num float fieldcounter; void Sbar_PrintStomachboardItem(vector pos, entity pl) { - vector tmp, rgb; - rgb = GetTeamRGB(pl.team); + // list the players in the stomach + string str; float f, field; - // Layout: - tmp_x = sbwidth; - tmp_y = sbar_fontsize_y * 1.25; - tmp_z = 0; - for(fieldcounter = 1; fieldcounter <= 2; ++fieldcounter) { field = -fieldcounter; @@ -967,6 +962,14 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl) str = Sbar_GetStomachField(pl, field); + if(field == ST_NAME) // do this for one field, or we get multiple highlights in the same spot + { + if(getstati(STAT_STOMACH_EATEN)) + drawfill(pos - '0 0 0', '193 11 0', '1 0 0' * cvar("sbar_stomachboard_highlight_brightness"), cvar("sbar_stomachboard_highlight_alpha"), DRAWFLAG_NORMAL); + else + drawfill(pos - '0 0 0', '193 11 0', '0 1 0' * cvar("sbar_stomachboard_highlight_brightness"), cvar("sbar_stomachboard_highlight_alpha"), DRAWFLAG_NORMAL); + } + if(field == ST_NAME) { f = stof(getplayerkey(pl.sv_entnum, "colors")); drawpic(pos, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); @@ -977,14 +980,46 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl) drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL); } - if(field == ST_HEALTH) { + if(field == ST_HEALTH) + if(g_vore_showpreyhealth) { pos_x += 138; - if(g_vore_showpreyhealth) - drawpic(pos, "gfx/hud/sb_health", '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + if(pl.sv_entnum == player_localentnum - 1 || (spectatee_status && pl.sv_entnum == spectatee_status - 1)) + drawcolorcodedstring(pos, "self", '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL); + else + { + drawpic(pos, "gfx/hud/sb_health", '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + + pos_x += 9; + drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL); + } + } + } +} + +float fieldcounter2; +void Sbar_PrintStomachboardItem2(vector pos, entity pl) +{ + // show the name of our eater + + string str; + float f, field; + + for(fieldcounter2 = 1; fieldcounter2 <= 2; ++fieldcounter2) + { + field = -fieldcounter2; + if(field == SP_SEPARATOR) + break; + + str = Sbar_GetStomachField(pl, field); + + if(field == ST_NAME) { + f = stof(getplayerkey(pl.sv_entnum, "colors")); + drawpic(pos, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + drawpic(pos, "gfx/sb_playercolor_shirt", '22 11 0', colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL); + drawpic(pos, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL); - pos_x += 9; - if(g_vore_showpreyhealth) - drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL); + pos_x += 24; + drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL); } } } @@ -2590,6 +2625,30 @@ float vote_prev; // previous state of vote_active to check for a change float vote_alpha; float vote_change; // "time" when vote_active changed +vector colortrans_current; +vector Stomachstatus_Colortrans(vector target_color) +{ + local float step; + step = 0.0125; + + if(colortrans_current_x > target_color_x + step) + colortrans_current_x -= step; + else if(colortrans_current_x < target_color_x - step) + colortrans_current_x += step; + + if(colortrans_current_y > target_color_y + step) + colortrans_current_y -= step; + else if(colortrans_current_y < target_color_y - step) + colortrans_current_y += step; + + if(colortrans_current_z > target_color_z + step) + colortrans_current_z -= step; + else if(colortrans_current_z < target_color_z - step) + colortrans_current_z += step; + + return colortrans_current; +} + void Sbar_Draw (void) { // vectors for top right, bottom right, bottom and bottom left corners @@ -2855,6 +2914,8 @@ void Sbar_Draw (void) Sbar_Timer(); Sbar_Reset(); + + Stomachstatus_Colortrans('0 0 0'); } else { @@ -2883,6 +2944,17 @@ void Sbar_Draw (void) drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach", '256 256 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL); } + + if(getstati(STAT_STOMACH_EATEN)) + { + drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', Stomachstatus_Colortrans('1 0 0' * cvar("sbar_stomachboard_status_brightness")), cvar("sbar_stomachboard_status_alpha"), DRAWFLAG_NORMAL); + drawstring(bottomleft - '-80 172 0', "predator:", '10 10 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + } + else + { + drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', Stomachstatus_Colortrans('0 1 0' * cvar("sbar_stomachboard_status_brightness")), cvar("sbar_stomachboard_status_alpha"), DRAWFLAG_NORMAL); + drawstring(bottomleft - '-80 172 0', "self:", '10 10 0', ' 1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + } } float stomach_load; stomach_load = getstati(STAT_STOMACH_LOAD); // shows the predator's stomach load when we are eaten, and ours otherwise @@ -2929,7 +3001,7 @@ void Sbar_Draw (void) if(getstati(STAT_STOMACH_EATEN)) if(pl.sv_entnum == getstati(STAT_STOMACH_EATEN) - 1) - Sbar_PrintStomachboardItem(pos - '-76 156 0', pl); + Sbar_PrintStomachboardItem2(bottomleft - '-76 156 0', pl); } if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) {