From 4139299b2ef7626c5a070d21d8c08618ecb48c44 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sun, 5 Sep 2010 03:38:18 +0300 Subject: [PATCH] Properly cvar each component. No more adjusting brightness by HUD background and such --- data/defaultVoretournament.cfg | 4 ++++ data/qcsrc/client/sbar.qc | 18 +++++------------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/data/defaultVoretournament.cfg b/data/defaultVoretournament.cfg index 38f0dc33..ee80769c 100644 --- a/data/defaultVoretournament.cfg +++ b/data/defaultVoretournament.cfg @@ -1123,6 +1123,10 @@ 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_status_brightness 0.5 "brightness of the stomach board status" +seta sbar_stomachboard_status_alpha 0.75 "alpha of the stomach board status" +seta sbar_stomachboard_highlight_brightness 0.5 "brightness of the stomach board highlight" +seta sbar_stomachboard_highlight_alpha 0.25 "alpha of the stomach board highlight" seta sbar_timer_increment 0 "1 = show elapsed time on the timer" seta sbar_timer_scale 1 "scale multiplier of the timer" seta sbar_vote_alreadyvoted_alpha 0.75 "alpha of the vote dialog after you have voted" diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index a0ed0ab2..bbc647e6 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -965,9 +965,9 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl) 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', 0.25, DRAWFLAG_NORMAL); + 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', 0.25, DRAWFLAG_NORMAL); + 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) { @@ -2944,23 +2944,15 @@ 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)) { - 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', Stomachstatus_Colortrans(stomach_status_color), sbar_alpha_bg, DRAWFLAG_NORMAL); + drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', '1 0 0' * cvar("sbar_stomachboard_status_brightness"), cvar("sbar_stomachboard_status_alpha"), DRAWFLAG_NORMAL); drawstring(bottomleft - '-80 168 0', "predator:", '8 8 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); } else { - 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', Stomachstatus_Colortrans(stomach_status_color), sbar_alpha_bg, DRAWFLAG_NORMAL); + drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', '0 1 0' * cvar("sbar_stomachboard_status_brightness"), cvar("sbar_stomachboard_status_alpha"), DRAWFLAG_NORMAL); drawstring(bottomleft - '-80 168 0', "self:", '8 8 0', ' 1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); } } -- 2.39.2