From 2026983b0096a9a0ee0cfbb1468db8f7fb399206 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Fri, 15 Apr 2011 18:35:43 +0300 Subject: [PATCH] Fix and finalize my last code --- data/defaultVT.cfg | 6 +++--- data/qcsrc/client/sbar.qc | 14 ++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index f5094fa4..39d69ae0 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -1139,9 +1139,9 @@ seta sbar_scoreboard_fadeoutspeed 5 "speed at which scoreboard fades out, higher seta sbar_scoreboard_highlight 1 "enable highlighting for rows and columns in the scoreboard" seta sbar_scoreboard_highlight_alpha 0.10 "highlight alpha value (depends on sbar_scoreboard_highlight 1)" seta sbar_scoreboard_highlight_alpha_self 0.25 "self highlight alpha value" -seta sbar_stomachboard_color1 "0 0.5 0" "RGB color of the stomach board indicators for self" -seta sbar_stomachboard_color2 "0.5 0.5 0" "RGB color of the stomach board indicators for team mates" -seta sbar_stomachboard_color3 "0.5 0 0" "RGB color of the stomach board indicators for predators" +seta sbar_stomachboard_color1 "0 0.5 0" "RGB color of the stomach board indicators when showing self" +seta sbar_stomachboard_color2 "0.5 0.5 0" "RGB color of the stomach board indicators when showing team mate predators" +seta sbar_stomachboard_color3 "0.5 0 0" "RGB color of the stomach board indicators when showing enemy predators" seta sbar_stomachboard_status_alpha 0.75 "alpha of the stomach board status" seta sbar_stomachboard_status_fade 1 "color fading speed of the stomach board status" seta sbar_stomachboard_highlight_alpha 0.25 "alpha of the stomach board highlight" diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index c9d1d4f1..527872bc 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -930,9 +930,12 @@ 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 + drawfill(pos - '0 0 0', '193 11 0', stov(cvar_string("sbar_stomachboard_color2")), cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL); + else + 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 drawfill(pos - '0 0 0', '193 11 0', stov(cvar_string("sbar_stomachboard_color1")), cvar("sbar_stomachboard_highlight_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL); } @@ -2927,7 +2930,10 @@ void Sbar_Draw (void) 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); + if(teamplay && GetPlayerColor(getstati(STAT_VORE_EATEN) - 1) == GetPlayerColor(player_localentnum - 1)) // same team + 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); + else + 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); drawstring(bottomleft - '-80 173 0', "predator:", '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); } else -- 2.39.2