From 10dbb6a3ee8d8d8d39afc69d984aaa84ec7bca6f Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Fri, 15 Apr 2011 18:44:15 +0300 Subject: [PATCH] Use a simpler method of fetching colors. Needed for a change that's about to follow. --- data/qcsrc/client/sbar.qc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 527872bc..8dde732f 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) @@ -932,12 +933,13 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl) if(getstati(STAT_VORE_EATEN)) { 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); + hl_color = stov(cvar_string("sbar_stomachboard_color2")); 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); + 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) { @@ -2928,19 +2930,23 @@ void Sbar_Draw (void) } } + vector hl_color; + string hl_string; if(getstati(STAT_VORE_EATEN)) { 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); + hl_color = stov(cvar_string("sbar_stomachboard_color2")); 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); + 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 -- 2.39.2