1 #include "cl_nexball.qh"
3 #include <client/hud/panel/modicons.qh>
4 #include <common/mutators/base.qh>
6 // Nexball HUD mod icon
7 void HUD_Mod_NexBall(vector pos, vector mySize)
9 float nb_pb_starttime, dt, p;
12 stat_items = STAT(ITEMS);
13 nb_pb_starttime = STAT(NB_METERSTART);
15 if (stat_items & IT_KEY1)
20 //Manage the progress bar if any
21 if (nb_pb_starttime > 0)
23 dt = (time - nb_pb_starttime) % nb_pb_period;
24 // one period of positive triangle
25 p = 2 * dt / nb_pb_period;
29 HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", p, (mySize.x <= mySize.y), 0, autocvar_hud_progressbar_nexball_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
32 if (stat_items & IT_KEY1)
33 drawpic_aspect_skin(pos, "nexball_carrying", eX * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
36 int autocvar_cl_eventchase_nexball = 1;
38 REGISTER_MUTATOR(cl_nb, true);
40 MUTATOR_HOOKFUNCTION(cl_nb, WantEventchase)
42 if(autocvar_cl_eventchase_nexball && ISGAMETYPE(NEXBALL) && !(WepSet_GetFromStat() & WEPSET(NEXBALL)))
47 MUTATOR_HOOKFUNCTION(cl_nb, DrawScoreboardAccuracy)
49 return ISGAMETYPE(NEXBALL); // accuracy is not a factor in this gamemode