From a1ee3f3d8737c066454ab55c8ccbd40fdd50d542 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sun, 5 Sep 2010 01:46:24 +0300 Subject: [PATCH] Reflect HUD background brightness if bigger than 0.25 (so the color remains visible with black HUD) --- data/qcsrc/client/sbar.qc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 974a2ddc..cabd0a80 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -2906,14 +2906,23 @@ void Sbar_Draw (void) drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach", '256 256 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL); } + vector stomach_status_color; if(getstati(STAT_STOMACH_EATEN)) { - drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', Stomachstatus_Colortrans('1 0 0'), sbar_alpha_bg, DRAWFLAG_NORMAL); + stomach_status_color_x = bound(0.25, vlen(color), 1); // reflect HUD background brightness, but only up to a certain limit (so the color is still visible with black HUD) + stomach_status_color_y = 0; + stomach_status_color_z = 0; + + drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', stomach_status_color, sbar_alpha_bg, DRAWFLAG_NORMAL); drawstring(bottomleft - '-80 168 0', "predator:", '8 8 0', '0 0 0', sbar_alpha_fg, DRAWFLAG_NORMAL); } else { - drawpic(bottomleft- '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', Stomachstatus_Colortrans('0 1 0'), sbar_alpha_bg, DRAWFLAG_NORMAL); + stomach_status_color_x = 0; + stomach_status_color_y = bound(0.25, vlen(color), 1); // reflect HUD background brightness, but only up to a certain limit (so the color is still visible with black HUD) + stomach_status_color_z = 0; + + drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', stomach_status_color, sbar_alpha_bg, DRAWFLAG_NORMAL); drawstring(bottomleft - '-80 168 0', "self:", '8 8 0', '0 0 0', sbar_alpha_fg, DRAWFLAG_NORMAL); } } -- 2.39.2