if(autocvar_cl_reticle)
{
- if(autocvar_cl_reticle_item_normal) { precache_pic("gfx/reticle_normal"); }
- if(autocvar_cl_reticle_item_vortex) { precache_pic("gfx/reticle_nex"); }
+ precache_pic("gfx/reticle_normal");
+ // weapon reticles are precached in weapon files
}
get_mi_min_max_texcoords(1); // try the CLEVER way first
const float CAMERA_FREE = 1;
const float CAMERA_CHASE = 2;
float reticle_type;
+string reticle_image;
string NextFrameCommand;
void CSQC_SPIDER_HUD();
void CSQC_RAPTOR_HUD();
R_EndPolygon();
}
- // Draw the aiming reticle for weapons that use it
- // reticle_type is changed to the item we are zooming / aiming with, to decide which reticle to use
- // It must be a persisted float for fading out to work properly (you let go of the zoom button for
- // the view to go back to normal, so reticle_type would become 0 as we fade out)
- if(spectatee_status || is_dead || hud != HUD_NORMAL)
- reticle_type = 0; // prevent reticle from showing during the respawn zoom effect or for spectators
- else if((activeweapon == WEP_VORTEX || activeweapon == WEP_RIFLE || activeweapon == WEP_VAPORIZER) && (button_zoom || zoomscript_caught))
- reticle_type = 2; // nex zoom
- else if(button_zoom || zoomscript_caught)
- reticle_type = 1; // normal zoom
- else if((activeweapon == WEP_VORTEX) && button_attack2)
- reticle_type = 2; // nex zoom
-
- if(reticle_type && autocvar_cl_reticle)
+ if(autocvar_cl_reticle)
{
- if(autocvar_cl_reticle_stretch)
+ // Draw the aiming reticle for weapons that use it
+ // reticle_type is changed to the item we are zooming / aiming with, to decide which reticle to use
+ // It must be a persisted float for fading out to work properly (you let go of the zoom button for
+ // the view to go back to normal, so reticle_type would become 0 as we fade out)
+ if(spectatee_status || is_dead || hud != HUD_NORMAL)
{
- reticle_size_x = vid_conwidth;
- reticle_size_y = vid_conheight;
- reticle_pos_x = 0;
- reticle_pos_y = 0;
+ // no zoom reticle while dead
+ reticle_type = 0;
}
- else
+ else if(WEP_ACTION(activeweapon, WR_ZOOMRETICLE) && autocvar_cl_reticle_weapon)
{
- reticle_size_x = max(vid_conwidth, vid_conheight);
- reticle_size_y = max(vid_conwidth, vid_conheight);
- reticle_pos_x = (vid_conwidth - reticle_size_x) / 2;
- reticle_pos_y = (vid_conheight - reticle_size_y) / 2;
+ if(reticle_image != "") { reticle_type = 2; }
+ else { reticle_type = 0; }
}
-
- f = current_zoomfraction;
- if(zoomscript_caught)
- f = 1;
- if(autocvar_cl_reticle_item_normal)
+ else if(button_zoom || zoomscript_caught)
{
- if(reticle_type == 1 && f)
- drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_normal, DRAWFLAG_NORMAL);
+ // normal zoom
+ reticle_type = 1;
}
- if(autocvar_cl_reticle_item_vortex)
+
+ if(reticle_type)
{
- if(reticle_type == 2 && f)
- drawpic(reticle_pos, "gfx/reticle_nex", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_vortex, DRAWFLAG_NORMAL);
+ if(autocvar_cl_reticle_stretch)
+ {
+ reticle_size_x = vid_conwidth;
+ reticle_size_y = vid_conheight;
+ reticle_pos_x = 0;
+ reticle_pos_y = 0;
+ }
+ else
+ {
+ reticle_size_x = max(vid_conwidth, vid_conheight);
+ reticle_size_y = max(vid_conwidth, vid_conheight);
+ reticle_pos_x = (vid_conwidth - reticle_size_x) / 2;
+ reticle_pos_y = (vid_conheight - reticle_size_y) / 2;
+ }
+
+ if(zoomscript_caught)
+ f = 1;
+ else
+ f = current_zoomfraction;
+
+ if(f)
+ {
+ switch(reticle_type)
+ {
+ case 1: drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * autocvar_cl_reticle_normal_alpha, DRAWFLAG_NORMAL); break;
+ case 2: drawpic(reticle_pos, reticle_image, reticle_size, '1 1 1', f * autocvar_cl_reticle_weapon_alpha, DRAWFLAG_NORMAL); break;
+ }
+ }
}
}
+ else
+ {
+ if(reticle_type != 0) { reticle_type = 0; }
+ }
// improved polyblend
float autocvar_cl_projectiles_sloppy;
float autocvar_cl_readpicture_force;
var float autocvar_cl_reticle = 1;
-float autocvar_cl_reticle_item_vortex;
-float autocvar_cl_reticle_item_normal;
+var float autocvar_cl_reticle_normal_alpha = 1;
+var float autocvar_cl_reticle_weapon = 1;
+var float autocvar_cl_reticle_weapon_alpha = 1;
float autocvar_cl_reticle_stretch;
float autocvar_cl_spawn_event_particles;
var float autocvar_cl_spawn_event_sound = 1;
precache_sound("weapons/arc_impact_combo.wav");
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
}
precache_sound("weapons/laserimpact.wav");
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
precache_sound("weapons/crylink_impact.wav");
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
}
precache_sound("weapons/rocket_impact.wav");
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
}
precache_sound("weapons/electro_impact_combo.wav");
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
}
precache_sound("weapons/fireball_impact2.wav");
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
precache_sound("weapons/hagexp3.wav");
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
}
precache_sound("weapons/laserimpact.wav");
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
}
precache_sound("weapons/hookbomb_impact.wav");
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
}
precache_sound("weapons/ric3.wav");
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
}
precache_sound("weapons/mine_exp.wav");
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
}
precache_sound("weapons/grenade_impact.wav");
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
}
// nothing to do
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
}
precache_sound("weapons/ric1.wav");
precache_sound("weapons/ric2.wav");
precache_sound("weapons/ric3.wav");
+ if(autocvar_cl_reticle && autocvar_cl_reticle_weapon)
+ {
+ precache_pic("gfx/reticle_nex");
+ }
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ if(button_zoom || zoomscript_caught)
+ {
+ reticle_image = "gfx/reticle_nex";
+ return TRUE;
+ }
+ else
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
+ }
}
return TRUE;
precache_sound("weapons/tag_impact.wav");
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
//precache_sound("weapons/ric3.wav");
return FALSE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
}
precache_sound("weapons/ric3.wav");
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
}
return TRUE;
}
float W_Tuba(float req)
{
// nothing to do here; particles of tuba are handled differently
+ // WEAPONTODO
+
+ switch(req)
+ {
+ case WR_ZOOMRETICLE:
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
+ }
return TRUE;
}
case WR_INIT:
{
precache_sound("weapons/neximpact.wav");
+ if(autocvar_cl_reticle && autocvar_cl_reticle_weapon)
+ {
+ precache_pic("gfx/reticle_nex");
+ }
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ if(button_zoom || zoomscript_caught)
+ {
+ reticle_image = "gfx/reticle_nex";
+ return TRUE;
+ }
+ else
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
+ }
}
return TRUE;
}
}
#endif
#ifdef CSQC
+var float autocvar_g_balance_vortex_secondary = 0; // WEAPONTODO
float W_Vortex(float req)
{
switch(req)
case WR_INIT:
{
precache_sound("weapons/neximpact.wav");
+ if(autocvar_cl_reticle && autocvar_cl_reticle_weapon)
+ {
+ precache_pic("gfx/reticle_nex");
+ }
return TRUE;
}
+ case WR_ZOOMRETICLE:
+ {
+ if(button_zoom || zoomscript_caught || (!WEP_CVAR(vortex, secondary) && button_attack2))
+ {
+ reticle_image = "gfx/reticle_nex";
+ return TRUE;
+ }
+ else
+ {
+ // no weapon specific image for this weapon
+ return FALSE;
+ }
+ }
}
return TRUE;
}
#define WR_SWITCHABLE 12 // (CLIENT) impact effect
#define WR_PLAYERDEATH 13 // (SERVER) does not need to do anything
#define WR_GONETHINK 14 // (SERVER) logic to run every frame, also if no longer having the weapon as long as the switch away has not been performed
-#define WR_CONFIG 15 // (ALL)
+#define WR_CONFIG 15 // (ALL)
+#define WR_ZOOMRETICLE 16 // (CLIENT) weapon specific zoom reticle
// WEAPONTODO
const float IT_UNLIMITED_WEAPON_AMMO = 1;
.WepSet weapons; // WEPSET_...
.string netname; // short name
.string message; // human readable name
-.float items; // IT_...
+.float items; // IT_... // WEAPONTODO: I thought I removed items from weapons... ?
.float(float) weapon_func; // w_...
.vector wpcolor; // waypointsprite color
.string mdl; // modelname without g_, v_, w_
.float impulse; // weapon impulse
.float bot_pickupbasevalue; // bot weapon priority
.string model2; // wpn- sprite name
+.string message2; // zoom reticle image
..float current_ammo; // main ammo field
// other useful macros