X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=data%2Fqcsrc%2Fclient%2Fsbar.qc;h=d856adabb9a7c5b87f803ef18492ed297d71b45a;hb=ceea9aed4596cc127c93a7fc973261b0e684b0e4;hp=c9d1d4f1226d88664ef8d19312ba56c471c638b9;hpb=7d870cd0d9c45e0e060a88b8703d46598a4ff4df;p=voretournament%2Fvoretournament.git diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index c9d1d4f1..d856adab 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -919,6 +919,7 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl) string str; float f, field, field_number; + vector hl_color; field_number = 3; // the number of components each row has for(fieldcounter = 1; fieldcounter <= field_number; ++fieldcounter) @@ -930,11 +931,15 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl) if(field == ST_HIGHLIGHT) { if(getstati(STAT_VORE_EATEN)) - drawfill(pos - '0 0 0', '193 11 0', stov(cvar_string("sbar_stomachboard_color3")), cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL); - else if(pl.team == myteam) - drawfill(pos - '0 0 0', '193 11 0', stov(cvar_string("sbar_stomachboard_color2")), cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL); + { + if(teamplay && GetPlayerColor(pl.entnum - 1) == GetPlayerColor(player_localentnum - 1)) // same team + hl_color = stov(cvar_string("sbar_stomachboard_color2")); + else + hl_color = stov(cvar_string("sbar_stomachboard_color3")); + } else - drawfill(pos - '0 0 0', '193 11 0', stov(cvar_string("sbar_stomachboard_color1")), cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL); + hl_color = stov(cvar_string("sbar_stomachboard_color1")); + drawfill(pos - '0 0 0', '193 11 0', hl_color, cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL); } if(field == ST_NAME) { @@ -1940,13 +1945,13 @@ void Sbar_Timer() minutes = minutesLeft; seconds = secondsLeft; if (minutes == 0) - bgpos_x = topright_x - (58 + 7 + 12) * scale; + bgpos_x = topright_x - (46 + 17 + 12) * scale; else if (minutes < 10) // nudge the timer background left if more digits are drawn - bgpos_x = topright_x - (66 + 17 + 12) * scale; + bgpos_x = topright_x - (54 + 17 + 12) * scale; else if (minutes < 100) - bgpos_x = topright_x - (74 + 17 + 12) * scale; + bgpos_x = topright_x - (62 + 17 + 12) * scale; else - bgpos_x = topright_x - (82 + 17 + 12) * scale; + bgpos_x = topright_x - (70 + 17 + 12) * scale; bgpos_y = 0; bgpos_z = 0; } @@ -2925,16 +2930,23 @@ void Sbar_Draw (void) } } + vector hl_color; + string hl_string; if(getstati(STAT_VORE_EATEN)) { - 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); - drawstring(bottomleft - '-80 173 0', "predator:", '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + if(teamplay && GetPlayerColor(getstati(STAT_VORE_EATEN) - 1) == GetPlayerColor(player_localentnum - 1)) // same team + hl_color = stov(cvar_string("sbar_stomachboard_color2")); + else + hl_color = stov(cvar_string("sbar_stomachboard_color3")); + hl_string = "predator:"; } else { - 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); - drawstring(bottomleft - '-80 173 0', "self:", '11 11 0', ' 1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + hl_color = stov(cvar_string("sbar_stomachboard_color1")); + hl_string = "self:"; } + 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); + drawstring(bottomleft - '-80 173 0', hl_string, '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); float stomach_load; stomach_load = getstati(STAT_VORE_LOAD); // shows the predator's stomach load when we are eaten, and ours otherwise