1 #define hud_bg "gfx/vehicles/frame.tga"
2 #define hud_sh "gfx/vehicles/vh-shield.tga"
4 #define hud_hp_bar "gfx/vehicles/bar_up_left.tga"
5 #define hud_hp_ico "gfx/vehicles/health.tga"
6 #define hud_sh_bar "gfx/vehicles/bar_dwn_left.tga"
7 #define hud_sh_ico "gfx/vehicles/shield.tga"
9 #define hud_ammo1_bar "gfx/vehicles/bar_up_right.tga"
10 #define hud_ammo1_ico "gfx/vehicles/bullets.tga"
11 #define hud_ammo2_bar "gfx/vehicles/bar_dwn_right.tga"
12 #define hud_ammo2_ico "gfx/vehicles/rocket.tga"
13 #define hud_energy "gfx/vehicles/energy.tga"
16 var float autocvar_cl_vehicles_hudscale = 0.5;
17 var float autocvar_cl_vehicles_hudalpha = 0.75;
19 const float MAX_AXH = 4;
20 entity AuxiliaryXhair[MAX_AXH];
30 void vehicle_alarm(entity e, float ch, string s0und)
32 if(!autocvar_cl_vehicles_alarm)
35 sound(e, ch, s0und, VOL_BASEVOICE, ATTEN_NONE);
38 void AuxiliaryXhair_Draw2D()
42 psize = self.axh_scale * draw_getimagesize(self.axh_image);
43 loc = project_3d_to_2d(self.move_origin) - 0.5 * psize;
44 if(!(loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight))
48 drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag);
51 if(time - self.cnt > self.axh_fadetime)
52 self.draw2d = func_null;
55 void Net_AuXair2(float bIsNew)
57 float axh_id = bound(0, ReadByte(), MAX_AXH);
58 entity axh = AuxiliaryXhair[axh_id];
60 if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
63 axh.draw2d = func_null;
64 axh.drawmask = MASK_NORMAL;
65 axh.axh_drawflag = DRAWFLAG_ADDITIVE;
66 axh.axh_fadetime = 0.1;
67 axh.axh_image = "gfx/vehicles/axh-ring.tga";
70 AuxiliaryXhair[axh_id] = axh;
73 axh.move_origin_x = ReadCoord();
74 axh.move_origin_y = ReadCoord();
75 axh.move_origin_z = ReadCoord();
76 axh.colormod_x = ReadByte() / 255;
77 axh.colormod_y = ReadByte() / 255;
78 axh.colormod_z = ReadByte() / 255;
80 axh.draw2d = AuxiliaryXhair_Draw2D;
83 void Net_VehicleSetup()
87 float hud_id = ReadByte();
89 // hud_id == 0 means we exited a vehicle, so stop alarm sound/s
92 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
93 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
97 // Init auxiliary crosshairs
99 for(i = 0; i < MAX_AXH; ++i)
101 axh = AuxiliaryXhair[i];
102 if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
106 axh.draw2d = func_null;
107 axh.drawmask = MASK_NORMAL;
108 axh.axh_drawflag = DRAWFLAG_NORMAL;
109 axh.axh_fadetime = 0.1;
110 axh.axh_image = "gfx/vehicles/axh-ring.tga";
113 AuxiliaryXhair[i] = axh;
116 if(hud_id == HUD_BUMBLEBEE_GUN)
119 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
120 AuxiliaryXhair[0].axh_scale = 0.25;
122 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
123 AuxiliaryXhair[1].axh_scale = 0.25;
125 else { VEH_ACTION(hud_id, VR_SETUP); }