seta hud_shownames_mindistance 1000 "start fading alpha/size at this distance"
seta hud_shownames_maxdistance 5000 "alpha/size is 0 at this distance"
seta hud_shownames_antioverlap 1 "if two tags overlap, fade out the one further away from you"
+seta hud_shownames_antioverlap_minalpha 0.4 "fade out overlapping tags to this alpha value"
seta hud_shownames_offset 52 "offset (along z-axis) tag from player origin by this many units"
this.alpha = max(0, this.alpha - SHOWNAMES_FADESPEED * frametime);
this.fadedelay = 0; // reset fade in delay, enemy has left the view
}
- else if (OFF_SCREEN(o) || overlap > 0) // out of view or tag overlap detected, fade out
+ else if (OFF_SCREEN(o)) // out of view, fade out
{
this.alpha = max(0, this.alpha - SHOWNAMES_FADESPEED * frametime);
}
+ else if (overlap > 0) // tag overlap detected, fade out
+ {
+ float minalpha = autocvar_hud_shownames_antioverlap_minalpha;
+ if (this.alpha >= minalpha)
+ this.alpha = max(minalpha, this.alpha - SHOWNAMES_FADESPEED * frametime);
+ else
+ this.alpha = min(minalpha, this.alpha + SHOWNAMES_FADESPEED * frametime);
+ }
else if (this.sameteam) // fade in for team mates
{
this.alpha = min(1, this.alpha + SHOWNAMES_FADESPEED * frametime);
float autocvar_hud_shownames_mindistance;
float autocvar_hud_shownames_maxdistance;
bool autocvar_hud_shownames_antioverlap;
+float autocvar_hud_shownames_antioverlap_minalpha = 0.4;
float autocvar_hud_shownames_offset;
entityclass(ShowNames);