// hit testing/tracing for special effects for the crosshair
set g_trueaim_minrange 44 "TrueAim minimum range (TrueAim adjusts shots so they hit the crosshair point even though the gun is not at the screen center)"
-seta crosshair_hittest 1 "do a crosshair hit evaluation; also, the crosshair is scaled by the given number when aiming at an enemy, and blurred when aiming at a team mate"
+seta crosshair_hittest 1 "do a crosshair hit evaluation, applying effects from the _blur, _scale, and _showipact cvars"
seta crosshair_hittest_blur 1 "blur the crosshair if the shot is obstructed"
+seta crosshair_hittest_scale 1.25 "enlarge crosshair if aiming at an enemy, shrink crosshair if shot is obstructed or aiming at a teammate"
seta crosshair_hittest_showimpact 0 "move the crosshair to the actual impact location if obstructed"
// change color based on special case
// wcross_origin = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight;
wcross_origin = project_3d_to_2d(view_origin + MAX_SHOT_DISTANCE * view_forward);
wcross_origin_z = 0;
- if(autocvar_crosshair_hittest)
+
+ if(
+ autocvar_crosshair_hittest
+ &&
+ (
+ autocvar_crosshair_hittest_blur
+ ||
+ autocvar_crosshair_hittest_scale
+ ||
+ autocvar_crosshair_hittest_showimpact
+ )
+ )
{
vector wcross_oldorigin;
wcross_oldorigin = wcross_origin;
if(!autocvar_crosshair_hittest_showimpact)
wcross_origin = wcross_oldorigin;
}
- else
- shottype = SHOTTYPE_HITWORLD;
+ else { shottype = SHOTTYPE_HITWORLD; }
vector wcross_color = '0 0 0', wcross_size = '0 0 0';
string wcross_wep = "", wcross_name;
}
if(shottype == SHOTTYPE_HITENEMY)
- wcross_scale *= autocvar_crosshair_hittest; // is not queried if hittest is 0
+ wcross_scale *= autocvar_crosshair_hittest_scale; // is not queried if hittest is 0
if(shottype == SHOTTYPE_HITTEAM)
- wcross_scale /= autocvar_crosshair_hittest; // is not queried if hittest is 0
+ wcross_scale /= autocvar_crosshair_hittest_scale; // is not queried if hittest is 0
f = fabs(autocvar_crosshair_effect_time);
if(wcross_scale != wcross_scale_goal_prev || wcross_alpha != wcross_alpha_goal_prev || wcross_color != wcross_color_goal_prev)
float autocvar_crosshair_hitindication_speed;
float autocvar_crosshair_hittest;
float autocvar_crosshair_hittest_blur;
+var float autocvar_crosshair_hittest_scale = 1.25;
float autocvar_crosshair_hittest_showimpact;
float autocvar_crosshair_per_weapon;
float autocvar_crosshair_pickup;
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_gentle", _("Disable gore effects and harsh language"))); // also set sv_gentle
-
- me.gotoRC(me, 2, 3); me.setFirstColumn(me, me.currentColumn);
- me.TDempty(me, 0.5);
- me.TD(me, 1, 2, e = makeXonoticButton(_("Crosshair"), '0 0 0'));
- e.onClick = DialogOpenButton_Click;
- e.onClickEntity = main.crosshairDialog;
- setDependent(e, "crosshair_enabled", 1, 2);
- // TODO: show status of crosshair dot and hittest and pickups and such here with text
- me.TR(me);
- me.TDempty(me, 0.5);
- me.TD(me, 1, 2, e = makeXonoticButton(_("HUD"), '0 0 0'));
- e.onClick = DialogOpenButton_Click;
- e.onClickEntity = main.hudDialog;
- // TODO: show hud config name with text here
- me.TR(me);
- me.TDempty(me, 0.5);
- me.TD(me, 1, 2, e = makeXonoticButton(_("Notification"), '0 0 0'));
- e.onClick = DialogOpenButton_Click;
- e.onClickEntity = main.notificationDialog;
- // TODO: Show all the notification stuff here
- me.TR(me);
- me.TDempty(me, 0.5);
- me.TD(me, 1, 2, e = makeXonoticButton(_("Playermodel"), '0 0 0'));
- e.onClick = DialogOpenButton_Click;
- e.onClickEntity = main.modelDialog;
- // TODO: show csqc model settings like forcemyplayer and deglowing/ghosting bodies with text here
- me.TR(me);
- me.TDempty(me, 0.5);
- me.TD(me, 1, 2, e = makeXonoticButton(_("View"), '0 0 0'));
- e.onClick = DialogOpenButton_Click;
- e.onClickEntity = main.viewDialog;
- // TODO: show fov and other settings with text here
- me.TR(me);
- me.TDempty(me, 0.5);
- me.TD(me, 1, 2, e = makeXonoticButton(_("Weapon"), '0 0 0'));
- e.onClick = DialogOpenButton_Click;
- e.onClickEntity = main.weaponsDialog;
- // I don't really think this is useful as is, and especially it doesn't look very clean...
- // In the future, if ALL of these buttons had some information, then it would be justified/clean
- //me.TD(me, 1, 1, e0 = makeXonoticTextLabel(0, string_null));
- // e0.textEntity = main.weaponsDialog;
- // e0.allowCut = 1;
-
- //me.gotoRC(me, me.rows - 1, 0);
- // me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "color -1 -1;name \"$_cl_name\";sendcvar cl_weaponpriority;sendcvar cl_autoswitch;sendcvar cl_forceplayermodels;sendcvar cl_forceplayermodelsfromxonotic;playermodel $_cl_playermodel;playerskin $_cl_playerskin", COMMANDBUTTON_APPLY));
-*/
-
-
- me.gotoRC(me, me.rows - 1, 0);
- me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "sendcvar cl_gentle; sendcvar cl_allow_uidtracking; sendcvar cl_allow_uid2name;", COMMANDBUTTON_APPLY));
+ */
}
#endif
{
entity e;
- me.TR(me);
+ me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center crosshair dot")));
setDependent(e, "crosshair_enabled", 1, 2);
me.TR(me);
me.TR(me);
me.TR(me);
me.TR(me);
- me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Crosshair animations:")));
- /*me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_effect_scalefade", _("Smooth effects of crosshairs")));
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_ring", _("Use rings to indicate weapon status")));
+ makeMulti(e, "crosshair_ring_reload");
setDependent(e, "crosshair_enabled", 1, 2);
me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_ring", _("Use rings to indicate weapon status")));
- makeMulti(e, "crosshair_ring_reload");
+ me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "crosshair_hitindication", _("Animate crosshair when hitting an enemy")));
setDependent(e, "crosshair_enabled", 1, 2);
me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.25, 0, "crosshair_pickup", _("Animate crosshair when picking up an item")));
+ setDependent(e, "crosshair_enabled", 1, 2);
me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Hit testing:")));
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_effect_scalefade", _("Smooth effects of crosshairs")));
+ setDependent(e, "crosshair_enabled", 1, 2);
+ me.TR(me);
+ /*me.TR(me);
+ me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Hit testing:")));
me.TD(me, 1, 2, e = makeXonoticTextSlider("crosshair_hittest"));
e.addValue(e, ZCTX(_("HTTST^Disabled")), "0");
e.addValue(e, ZCTX(_("HTTST^TrueAim")), "1");
e.addValue(e, ZCTX(_("HTTST^Enemies")), "1.25");
e.configureXonoticTextSliderValues(e);
- setDependent(e, "crosshair_enabled", 1, 2);
+ setDependent(e, "crosshair_enabled", 1, 2);*/
+
me.TR(me);
- me.TDempty(me, 0.2);
me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "crosshair_hittest_blur", _("Blur crosshair if the shot is obstructed")));
setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2);
me.TR(me);
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.5, 0, "crosshair_hitindication", _("Animate when hitting an enemy")));
- setDependent(e, "crosshair_enabled", 1, 2);
- me.TR(me);
- me.TDempty(me, 0.2);
- me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.25, 0, "crosshair_pickup", _("Animate when picking up an item")));
- setDependent(e, "crosshair_enabled", 1, 2);
+ me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(1.25, 0, "crosshair_hittest_scale", _("Enlarge crosshair if targeting an enemy")));
+ setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2);
- me.TR(me);
+ /*me.TR(me);
me.gotoRC(me, me.rows - 1, 0);
me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));