1 #include "cl_nexball.qh"
3 #include <client/hud/panel/modicons.qh>
5 // Nexball HUD mod icon
6 void HUD_Mod_NexBall(vector pos, vector mySize)
8 float nb_pb_starttime, dt, p;
11 stat_items = STAT(ITEMS);
12 nb_pb_starttime = STAT(NB_METERSTART);
14 if (stat_items & IT_KEY1)
19 //Manage the progress bar if any
20 if (nb_pb_starttime > 0)
22 dt = (time - nb_pb_starttime) % nb_pb_period;
23 // one period of positive triangle
24 p = 2 * dt / nb_pb_period;
28 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);
31 if (stat_items & IT_KEY1)
32 drawpic_aspect_skin(pos, "nexball_carrying", eX * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
35 int autocvar_cl_eventchase_nexball = 1;
37 REGISTER_MUTATOR(cl_nb, true);
39 MUTATOR_HOOKFUNCTION(cl_nb, WantEventchase)
41 if(autocvar_cl_eventchase_nexball && ISGAMETYPE(NEXBALL) && !(WepSet_GetFromStat() & WEPSET(NEXBALL)))