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 int stat_items = STAT(OBJECTIVE_STATUS);
10 float nb_pb_starttime = STAT(NB_METERSTART);
12 mod_active = (stat_items & NB_CARRYING);
14 //Manage the progress bar if any
15 if (nb_pb_starttime > 0)
17 float dt = (time - nb_pb_starttime) % nb_pb_period;
18 // one period of positive triangle
19 float p = 2 * dt / nb_pb_period;
23 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);
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);
30 int autocvar_cl_eventchase_nexball = 1;
32 REGISTER_MUTATOR(cl_nb, true);
34 MUTATOR_HOOKFUNCTION(cl_nb, WantEventchase)
36 if(autocvar_cl_eventchase_nexball && ISGAMETYPE(NEXBALL) && !(WepSet_GetFromStat() & WEPSET(NEXBALL)))
41 MUTATOR_HOOKFUNCTION(cl_nb, DrawScoreboardAccuracy)
43 return ISGAMETYPE(NEXBALL); // accuracy is not a factor in this gamemode
46 MUTATOR_HOOKFUNCTION(cl_nb, DrawScoreboardItemStats)
48 return ISGAMETYPE(NEXBALL); // hide the item stats panel