]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Color transition effect for stomach board status indicator
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 4 Sep 2010 22:24:03 +0000 (01:24 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 4 Sep 2010 22:24:03 +0000 (01:24 +0300)
data/qcsrc/client/sbar.qc

index d6384a655421565d979b2b28bf53503102c3e902..e62cca4a22a977b8cfba5b0606f9404da4c3fda5 100644 (file)
@@ -2587,6 +2587,30 @@ float vote_prev; // previous state of vote_active to check for a change
 float vote_alpha;\r
 float vote_change; // "time" when vote_active changed\r
 \r
+vector colortrans_current;\r
+vector Stomachstatus_Colortrans(vector target_color)\r
+{\r
+       local float step;\r
+       step = 0.0125;\r
+\r
+       if(colortrans_current_x > target_color_x + step)\r
+               colortrans_current_x -= step;\r
+       else if(colortrans_current_x < target_color_x - step)\r
+               colortrans_current_x += step;\r
+\r
+       if(colortrans_current_y > target_color_y + step)\r
+               colortrans_current_y -= step;\r
+       else if(colortrans_current_y < target_color_y - step)\r
+               colortrans_current_y += step;\r
+\r
+       if(colortrans_current_z > target_color_z + step)\r
+               colortrans_current_z -= step;\r
+       else if(colortrans_current_z < target_color_z - step)\r
+               colortrans_current_z += step;\r
+\r
+       return colortrans_current;\r
+}\r
+\r
 void Sbar_Draw (void)\r
 {\r
        // vectors for top right, bottom right, bottom and bottom left corners\r
@@ -2882,12 +2906,12 @@ void Sbar_Draw (void)
                        }\r
                        if(getstati(STAT_STOMACH_EATEN))\r
                        {\r
-                               drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', '1 0 0', sbar_alpha_bg, DRAWFLAG_NORMAL);\r
+                               drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', Stomachstatus_Colortrans('1 0 0'), sbar_alpha_bg, DRAWFLAG_NORMAL);\r
                                drawstring(bottomleft - '-80 168 0', "predator:", '8 8 0', '0 0 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                        }\r
                        else\r
                        {\r
-                               drawpic(bottomleft- '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', '0 1 0', sbar_alpha_bg, DRAWFLAG_NORMAL);\r
+                               drawpic(bottomleft- '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', Stomachstatus_Colortrans('0 1 0'), sbar_alpha_bg, DRAWFLAG_NORMAL);\r
                                drawstring(bottomleft - '-80 168 0', "self:", '8 8 0', '0 0 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                        }\r
                }\r