Xonotic
cl_nexball.qc
Go to the documentation of this file.
1 #include "cl_nexball.qh"
2 
5 
6 // Nexball HUD mod icon
7 void HUD_Mod_NexBall(vector pos, vector mySize)
8 {
9  int stat_items = STAT(OBJECTIVE_STATUS);
10  float nb_pb_starttime = STAT(NB_METERSTART);
11 
12  mod_active = (stat_items & NB_CARRYING);
13 
14  //Manage the progress bar if any
15  if (nb_pb_starttime > 0)
16  {
17  float dt = (time - nb_pb_starttime) % nb_pb_period;
18  // one period of positive triangle
19  float p = 2 * dt / nb_pb_period;
20  if (p > 1)
21  p = 2 - p;
22 
24  }
25 
26  if (stat_items & NB_CARRYING)
27  drawpic_aspect_skin(pos, "nexball_carrying", eX * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
28 }
29 
31 
32 REGISTER_MUTATOR(cl_nb, true);
33 
35 {
36  if(autocvar_cl_eventchase_nexball && ISGAMETYPE(NEXBALL) && !(WepSet_GetFromStat() & WEPSET(NEXBALL)))
37  return true;
38  return false;
39 }
40 
41 MUTATOR_HOOKFUNCTION(cl_nb, DrawScoreboardAccuracy)
42 {
43  return ISGAMETYPE(NEXBALL); // accuracy is not a factor in this gamemode
44 }
45 
46 MUTATOR_HOOKFUNCTION(cl_nb, DrawScoreboardItemStats)
47 {
48  return ISGAMETYPE(NEXBALL); // hide the item stats panel
49 }
#define WEPSET(id)
Definition: all.qh:37
float panel_fg_alpha
Definition: hud.qh:166
REGISTER_MUTATOR(cl_nb, true)
void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
Definition: hud.qc:270
const vector eY
Definition: vector.qh:45
bool mod_active
Definition: modicons.qh:7
int WantEventchase(entity this, bool want_vehiclechase)
Definition: view.qc:590
void HUD_Mod_NexBall(vector pos, vector mySize)
Definition: cl_nexball.qc:7
#define drawpic_aspect_skin(pos, pic, sz, color, theAlpha, drawflag)
Definition: draw.qh:78
const float DRAWFLAG_NORMAL
Definition: csprogsdefs.qc:317
MUTATOR_HOOKFUNCTION(cl_nb, WantEventchase)
Definition: cl_nexball.qc:34
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float nb_pb_period
Definition: cl_nexball.qh:7
const vector eX
Definition: vector.qh:44
#define ISGAMETYPE(NAME)
Definition: main.qh:32
float autocvar_hud_progressbar_alpha
Definition: hud.qh:201
float time
Definition: csprogsdefs.qc:16
int autocvar_cl_eventchase_nexball
Definition: cl_nexball.qc:30
vector autocvar_hud_progressbar_nexball_color
Definition: cl_nexball.qh:3