Client: add a subtle tint to the damage display. Set cg_damageFill to tweak.

This commit is contained in:
Marco Cawthorne 2024-03-06 18:59:29 -08:00
parent f2aba72c0c
commit 5324616382
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 10 additions and 0 deletions

View File

@ -3,6 +3,8 @@ var string g_damage_spr_b;
var string g_damage_spr_l;
var string g_damage_spr_r;
var float autocvar_cg_damageFill = 0.25f;
void
Damage_Precache(void)
{
@ -12,6 +14,8 @@ Damage_Precache(void)
g_damage_spr_l = spriteframe("sprites/640_pain.spr", 3, 0.0f);
}
void HUD_DamageNotify_Check();
void
Damage_Draw(void)
@ -58,5 +62,11 @@ Damage_Draw(void)
[48,128], [1,1,1], rt_alpha, DRAWFLAG_ADDITIVE);
}
if (autocvar_cg_damageFill > 0.0) {
vector finalColor = [1,1,1];
finalColor[1] = finalColor[2] = 1.0 - (pSeat->m_flDamageAlpha * autocvar_cg_damageFill);
drawpic(video_mins, "fade_modulate", video_res, finalColor, 1.0, DRAWFLAG_NORMAL);
}
pSeat->m_flDamageAlpha -= clframetime;
}