Xonotic
shownames.qh File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 classfield (ShowNames) .float healthvalue
 
void Draw_ShowNames_All ()
 
 entityclass (ShowNames)
 

Variables

bool autocvar_hud_shownames
 
float autocvar_hud_shownames_alpha
 
bool autocvar_hud_shownames_antioverlap
 
float autocvar_hud_shownames_antioverlap_minalpha = 0.4
 
float autocvar_hud_shownames_aspect
 
float autocvar_hud_shownames_crosshairdistance
 
float autocvar_hud_shownames_crosshairdistance_antioverlap
 
float autocvar_hud_shownames_crosshairdistance_time
 
int autocvar_hud_shownames_decolorize
 
bool autocvar_hud_shownames_enemies
 
float autocvar_hud_shownames_fontsize
 
float autocvar_hud_shownames_maxdistance
 
float autocvar_hud_shownames_mindistance
 
float autocvar_hud_shownames_offset
 
bool autocvar_hud_shownames_resize
 
bool autocvar_hud_shownames_self
 
bool autocvar_hud_shownames_status
 
float autocvar_hud_shownames_statusbar_height
 
float autocvar_hud_shownames_statusbar_highlight = 1
 

Function Documentation

◆ classfield()

classfield ( ShowNames  )

◆ Draw_ShowNames_All()

void Draw_ShowNames_All ( )

Definition at line 220 of file shownames.qc.

References assert, autocvar_hud_shownames, Draw_ShowNames(), entity(), eprint(), GetResource(), getthink, LL_EACH, make_impure, make_pure, setorigin(), and SetResourceExplicit().

Referenced by CSQC_UpdateView().

221 {
222  if (!autocvar_hud_shownames) return;
223  LL_EACH(shownames_ent, true, {
224  entity entcs = entcs_receiver(i);
225  if (!entcs)
226  {
227  make_pure(it);
228  continue;
229  }
230  make_impure(it);
231  assert(getthink(entcs), eprint(entcs));
232  getthink(entcs)(entcs);
233  if (!entcs.has_origin) continue;
234  if (entcs.m_entcs_private)
235  {
236  it.healthvalue = entcs.healthvalue;
237  SetResourceExplicit(it, RES_ARMOR, GetResource(entcs, RES_ARMOR));
238  it.sameteam = true;
239  }
240  else
241  {
242  it.healthvalue = 0;
243  SetResourceExplicit(it, RES_ARMOR, 0);
244  it.sameteam = false;
245  }
246  bool dead = entcs_IsDead(i) || entcs_IsSpectating(i);
247  if ((!it.csqcmodel_isdead || it.alpha > 0) && entcs.origin != it.origin)
248  setorigin(it, entcs.origin);
249  it.csqcmodel_isdead = dead;
250  Draw_ShowNames(it);
251  });
252 }
bool autocvar_hud_shownames
Definition: shownames.qh:3
#define assert(expr,...)
Definition: log.qh:8
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
Definition: cl_resources.qc:15
#define getthink(e)
#define LL_EACH(list, cond, body)
Definition: linkedlist.qh:73
entity() spawn
void Draw_ShowNames(entity this)
Definition: shownames.qc:40
LinkedList shownames_ent
Definition: shownames.qc:22
#define make_impure(e)
Definition: oo.qh:15
#define make_pure(e)
Definition: oo.qh:12
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
Definition: cl_resources.qc:10
setorigin(ent, v)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ entityclass()

entityclass ( ShowNames  )

Variable Documentation

◆ autocvar_hud_shownames

bool autocvar_hud_shownames

Definition at line 3 of file shownames.qh.

Referenced by Draw_ShowNames_All().

◆ autocvar_hud_shownames_alpha

float autocvar_hud_shownames_alpha

Definition at line 15 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_antioverlap

bool autocvar_hud_shownames_antioverlap

Definition at line 19 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_antioverlap_minalpha

float autocvar_hud_shownames_antioverlap_minalpha = 0.4

Definition at line 20 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_aspect

float autocvar_hud_shownames_aspect

Definition at line 12 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_crosshairdistance

float autocvar_hud_shownames_crosshairdistance

Definition at line 5 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_crosshairdistance_antioverlap

float autocvar_hud_shownames_crosshairdistance_antioverlap

Definition at line 7 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_crosshairdistance_time

float autocvar_hud_shownames_crosshairdistance_time

Definition at line 6 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_decolorize

int autocvar_hud_shownames_decolorize

Definition at line 14 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_enemies

bool autocvar_hud_shownames_enemies

Definition at line 4 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_fontsize

float autocvar_hud_shownames_fontsize

Definition at line 13 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_maxdistance

float autocvar_hud_shownames_maxdistance

Definition at line 18 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_mindistance

float autocvar_hud_shownames_mindistance

Definition at line 17 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_offset

float autocvar_hud_shownames_offset

Definition at line 21 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_resize

bool autocvar_hud_shownames_resize

Definition at line 16 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_self

bool autocvar_hud_shownames_self

Definition at line 8 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_status

bool autocvar_hud_shownames_status

Definition at line 9 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_statusbar_height

float autocvar_hud_shownames_statusbar_height

Definition at line 10 of file shownames.qh.

Referenced by Draw_ShowNames().

◆ autocvar_hud_shownames_statusbar_highlight

float autocvar_hud_shownames_statusbar_highlight = 1

Definition at line 11 of file shownames.qh.

Referenced by Draw_ShowNames().