const float CAMERA_FREE = 1;
const float CAMERA_CHASE = 2;
float reticle_type;
-string reticle_image;
string NextFrameCommand;
vector freeze_org, freeze_ang;
if(autocvar_cl_reticle)
{
+ string reticle_image = wepent.activeweapon.w_reticle;
bool wep_zoomed = false;
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
entity wepe = viewmodels[slot];
Weapon wep = wepe.activeweapon;
if(wep != WEP_Null && wep.wr_zoom)
- wep_zoomed += wep.wr_zoom(wep, NULL);
+ {
+ bool do_zoom = wep.wr_zoom(wep, NULL);
+ reticle_image = wep.w_reticle;
+ wep_zoomed += do_zoom;
+ }
}
// 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
}
else if(wep_zoomed && autocvar_cl_reticle_weapon)
{
- if(reticle_image != "") { reticle_type = 2; }
+ if(reticle_image && reticle_image != "") { reticle_type = 2; }
else { reticle_type = 0; }
}
else if(button_zoom || zoomscript_caught)
ATTRIB(Weapon, w_crosshair, string, "gfx/crosshair1");
/** A: crosshair : per-weapon crosshair size (argument two of "crosshair" field) */
ATTRIB(Weapon, w_crosshair_size, float, 1);
+ /** A: reticle : per-weapon zoom reticle */
+ ATTRIB(Weapon, w_reticle, string, "");
/** M: wepimg : "weaponfoobar" side view image file of weapon. WEAPONTODO: Move out of skin files, move to common files */
ATTRIB(Weapon, model2, string, "");
/** M: refname : reference name name */
#endif
/* crosshair */ ATTRIB(Rifle, w_crosshair, string, "gfx/crosshairrifle");
/* crosshair */ ATTRIB(Rifle, w_crosshair_size, float, 0.6);
+/* reticle */ ATTRIB(Rifle, w_reticle, string, "gfx/reticle_nex");
/* wepimg */ ATTRIB(Rifle, model2, string, "weaponrifle");
/* refname */ ATTRIB(Rifle, netname, string, "rifle");
/* wepname */ ATTRIB(Rifle, m_name, string, _("Rifle"));
{
if(button_zoom || zoomscript_caught)
{
- reticle_image = "gfx/reticle_nex";
return true;
}
else
#endif
/* crosshair */ ATTRIB(Vaporizer, w_crosshair, string, "gfx/crosshairminstanex");
/* crosshair */ ATTRIB(Vaporizer, w_crosshair_size, float, 0.6);
+/* reticle */ ATTRIB(Vaporizer, w_reticle, string, "gfx/reticle_nex");
/* wepimg */ ATTRIB(Vaporizer, model2, string, "weaponminstanex");
/* refname */ ATTRIB(Vaporizer, netname, string, "vaporizer");
/* wepname */ ATTRIB(Vaporizer, m_name, string, _("Vaporizer"));
{
if(button_zoom || zoomscript_caught)
{
- reticle_image = "gfx/reticle_nex";
return true;
}
else
#endif
/* crosshair */ ATTRIB(Vortex, w_crosshair, string, "gfx/crosshairnex");
/* crosshair */ ATTRIB(Vortex, w_crosshair_size, float, 0.65);
+/* reticle */ ATTRIB(Vortex, w_reticle, string, "gfx/reticle_nex");
/* wepimg */ ATTRIB(Vortex, model2, string, "weaponnex");
/* refname */ ATTRIB(Vortex, netname, string, "vortex");
/* wepname */ ATTRIB(Vortex, m_name, string, _("Vortex"));
}
METHOD(Vortex, wr_zoom, bool(entity thiswep, entity actor))
{
- return PHYS_INPUT_BUTTON_ATCK2(actor);
+ return PHYS_INPUT_BUTTON_ATCK2(actor) && !WEP_CVAR(vortex, secondary);
}
#endif
{
if(button_zoom || zoomscript_caught || (!WEP_CVAR(vortex, secondary) && button_attack2))
{
- reticle_image = "gfx/reticle_nex";
return true;
}
else