73 if (d * d > w * w + h * h) this.pointtime =
time;
81 #define OFF_SCREEN(o) (o.z < 0 || o.x < 0 || o.y < 0 || o.x > vid_conwidth || o.y > vid_conheight) 86 LL_EACH(shownames_ent, it !=
this, {
87 entcs = entcs_receiver(i);
88 if (!(entcs && entcs.has_origin))
106 else if (!this.sameteam && !hit)
115 else if (overlap > 0)
118 if (this.
alpha >= minalpha)
123 else if (this.sameteam)
127 else if (
time > this.fadedelay || this.
alpha > 0)
134 float f = entcs_GetAlpha(this.
sv_entnum - 1);
152 a *= (f -
max(0, dist - autocvar_hud_shownames_mindistance)) / f;
157 if (!a || o.z < 0)
return;
167 resize = 0.5 + 0.5 * (f -
max(0, dist - autocvar_hud_shownames_mindistance)) / f;
170 vector myPos = o -
vec2(0.5 * mySize.x, mySize.y);
173 myPos.x += 0.5 * (mySize.x / resize - mySize.x);
174 myPos.y += (mySize.y / resize - mySize.y);
176 this.
box_org = myPos + mySize / 2;
179 float namewidth = mySize.x;
187 this.
box_org.y = myPos.y + (mySize.y + sz.y) / 2;
193 if (this.healthvalue > 0)
209 string s = entcs_GetName(this.
sv_entnum - 1);
211 s = playername(s, entcs_GetTeam(this.
sv_entnum - 1),
true);
215 myPos.x = o.x - (width * resize) / 2;
224 entity entcs = entcs_receiver(i);
233 if (!entcs.has_origin)
continue;
234 if (entcs.m_entcs_private)
236 it.healthvalue = entcs.healthvalue;
246 bool dead = entcs_IsDead(i) || entcs_IsSpectating(i);
247 if ((!it.csqcmodel_isdead || it.alpha > 0) && entcs.origin != it.origin)
249 it.csqcmodel_isdead = dead;
bool autocvar_hud_shownames
STATIC_INIT(shownames_ent)
void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
vector project_3d_to_2d(vector vec)
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
#define LL_EACH(list, cond, body)
float trace_networkentity
bool autocvar_hud_shownames_self
string textShortenToWidth(string theText, float maxWidth, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
void Draw_ShowNames(entity this)
float autocvar_hud_shownames_maxdistance
bool autocvar_hud_shownames_antioverlap
entity LL_PUSH(LinkedList this, entity e)
Push to tail.
const float SHOWNAMES_FADEDELAY
const float MOVE_NOMONSTERS
ERASEABLE float boxesoverlap(vector m1, vector m2, vector m3, vector m4)
requires that m2>m1 in all coordinates, and that m4>m3
bool autocvar_hud_shownames_resize
float autocvar_hud_shownames_crosshairdistance
float autocvar_hud_shownames_aspect
float autocvar_hud_shownames_alpha
const float DRAWFLAG_NORMAL
int autocvar_hud_panel_healtharmor_maxhealth
bool autocvar_hud_shownames_enemies
float autocvar_hud_shownames_crosshairdistance_antioverlap
float autocvar_hud_shownames_antioverlap_minalpha
float autocvar_hud_shownames_offset
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
float autocvar_hud_shownames_crosshairdistance_time
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
bool autocvar_hud_shownames_status
int autocvar_hud_panel_healtharmor_maxarmor
#define MUTATOR_CALLHOOK(id,...)
float spectatee_status_changed_time
float autocvar_hud_shownames_statusbar_height
#define new_pure(class)
purely logical entities (.origin doesn't work)
int autocvar_hud_shownames_decolorize
int autocvar_chase_active
float autocvar_hud_shownames_statusbar_highlight
Header file that describes the resource system.
void Draw_ShowNames_All()
float autocvar_hud_shownames_fontsize
const float SHOWNAMES_FADESPEED
float autocvar_hud_shownames_mindistance