Commit 6565970c authored by terencehill's avatar terencehill

Simplify modicons panel fading code

parent 795844d0
Pipeline #5734770 passed with stages
in 21 minutes and 44 seconds
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment