]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Tweak frozen colorflash effect to be less intrusive, especially during autorevival
authorterencehill <piuntn@gmail.com>
Fri, 12 Jun 2020 22:41:03 +0000 (00:41 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 12 Jun 2020 22:41:03 +0000 (00:41 +0200)
qcsrc/client/view.qc

index 05d2306695076006f86478c26d5852bc74760b77..b8f33d2a10c710ea35a7eba6410e067bc9d85fa7 100644 (file)
@@ -925,9 +925,11 @@ void HUD_Draw(entity this)
        else if(STAT(FROZEN))
        {
                vector col = '0.25 0.90 1';
-               if(STAT(REVIVE_PROGRESS))
-                       col += vec3(STAT(REVIVE_PROGRESS), -STAT(REVIVE_PROGRESS), -STAT(REVIVE_PROGRESS));
-               drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), col, autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+               float col_fade = max(0, STAT(REVIVE_PROGRESS) * 2 - 1);
+               float alpha_fade = 0.3 + 0.7 * (1 - max(0, STAT(REVIVE_PROGRESS) * 4 - 3));
+               if(col_fade)
+                       col += vec3(col_fade, -col_fade, -col_fade);
+               drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), col, autocvar_hud_colorflash_alpha * alpha_fade, DRAWFLAG_ADDITIVE);
        }
 
        HUD_Scale_Enable();