From: MirceaKitsune Date: Sat, 4 Sep 2010 22:24:03 +0000 (+0300) Subject: Color transition effect for stomach board status indicator X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6352cd0afd0366de4b774c1fcce40685906fdc73;p=voretournament%2Fvoretournament.git Color transition effect for stomach board status indicator --- diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index d6384a65..e62cca4a 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -2587,6 +2587,30 @@ float vote_prev; // previous state of vote_active to check for a change float vote_alpha; float vote_change; // "time" when vote_active changed +vector colortrans_current; +vector Stomachstatus_Colortrans(vector target_color) +{ + local float step; + step = 0.0125; + + if(colortrans_current_x > target_color_x + step) + colortrans_current_x -= step; + else if(colortrans_current_x < target_color_x - step) + colortrans_current_x += step; + + if(colortrans_current_y > target_color_y + step) + colortrans_current_y -= step; + else if(colortrans_current_y < target_color_y - step) + colortrans_current_y += step; + + if(colortrans_current_z > target_color_z + step) + colortrans_current_z -= step; + else if(colortrans_current_z < target_color_z - step) + colortrans_current_z += step; + + return colortrans_current; +} + void Sbar_Draw (void) { // vectors for top right, bottom right, bottom and bottom left corners @@ -2882,12 +2906,12 @@ void Sbar_Draw (void) } if(getstati(STAT_STOMACH_EATEN)) { - drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', '1 0 0', sbar_alpha_bg, DRAWFLAG_NORMAL); + drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', Stomachstatus_Colortrans('1 0 0'), 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', '0 1 0', sbar_alpha_bg, DRAWFLAG_NORMAL); + drawpic(bottomleft- '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', Stomachstatus_Colortrans('0 1 0'), sbar_alpha_bg, DRAWFLAG_NORMAL); drawstring(bottomleft - '-80 168 0', "self:", '8 8 0', '0 0 0', sbar_alpha_fg, DRAWFLAG_NORMAL); } }