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

Go to the source code of this file.

Functions

void HUD_Mod_Dom (vector myPos, vector mySize)
 
void HUD_Mod_Dom_Export (int fh)
 

Function Documentation

◆ HUD_Mod_Dom()

void HUD_Mod_Dom ( vector  myPos,
vector  mySize 
)

Definition at line 64 of file cl_domination.qc.

References autocvar_hud_panel_modicons_dom_layout, ceil(), DrawDomItem(), HUD_GetRowCount(), mod_active, team_count, vec2, and vector().

65 {
66  mod_active = 1; // required in each mod function that always shows something
67 
69  int rows, columns;
70  float aspect_ratio;
71  aspect_ratio = (layout) ? 3 : 1;
72  rows = HUD_GetRowCount(team_count, mySize, aspect_ratio);
73  columns = ceil(team_count/rows);
74 
75  int i;
76  float row = 0, column = 0;
77  vector pos, itemSize;
78  itemSize = vec2(mySize.x / columns, mySize.y / rows);
79  for(i=0; i<team_count; ++i)
80  {
81  pos = myPos + vec2(column * itemSize.x, row * itemSize.y);
82 
83  DrawDomItem(pos, itemSize, aspect_ratio, layout, i);
84 
85  ++row;
86  if(row >= rows)
87  {
88  row = 0;
89  ++column;
90  }
91  }
92 }
float HUD_GetRowCount(int item_count, vector size, float item_aspect)
Definition: hud.qc:165
bool mod_active
Definition: modicons.qh:7
int autocvar_hud_panel_modicons_dom_layout
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float team_count
Definition: main.qh:45
#define vec2(...)
Definition: vector.qh:90
void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, int layout, int i)
+ Here is the call graph for this function:

◆ HUD_Mod_Dom_Export()

void HUD_Mod_Dom_Export ( int  fh)

Definition at line 6 of file cl_domination.qc.

References HUD_Write_Cvar.

7 {
8  HUD_Write_Cvar("hud_panel_modicons_dom_layout");
9 }
#define HUD_Write_Cvar(cvar)
Definition: hud_config.qh:38