From 6565970c1681bfeb2678f2dbb8c3348ed48c5361 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 9 Jan 2017 19:51:20 +0100 Subject: [PATCH] Simplify modicons panel fading code --- qcsrc/client/hud/panel/modicons.qc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/qcsrc/client/hud/panel/modicons.qc b/qcsrc/client/hud/panel/modicons.qc index bf302fdfa..a728f2447 100644 --- a/qcsrc/client/hud/panel/modicons.qc +++ b/qcsrc/client/hud/panel/modicons.qc @@ -715,9 +715,7 @@ void HUD_ModIcons_SetFunc() HUD_ModIcons_GameType = gametype.m_modicons; } -int mod_prev; // previous state of mod_active to check for a change float mod_alpha; -float mod_change; // "time" when mod_active changed void HUD_ModIcons() { @@ -727,16 +725,10 @@ void HUD_ModIcons() if(!HUD_ModIcons_GameType) return; } - - if(mod_active != mod_prev) { - mod_change = time; - mod_prev = mod_active; - } - if(mod_active || autocvar__hud_configure) - mod_alpha = bound(0, (time - mod_change) * 2, 1); + mod_alpha = min(mod_alpha + frametime * 2, 1); else - mod_alpha = bound(0, 1 - (time - mod_change) * 2, 1); + mod_alpha = max(mod_alpha - frametime * 2, 0); //if(mod_alpha <= 0) // return; -- 2.39.2