From e176e58788640361ffeb1fbbdaeaa5305c16c86b Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 5 Jun 2020 18:59:51 +0200 Subject: [PATCH] Crosshair blur: make playing and spectating a player behave the same, split the crosshair blur cvar into 2 (teammate/wall) (patch by martin-t, see merge request !724) --- crosshairs.cfg | 3 ++- qcsrc/client/autocvars.qh | 3 ++- qcsrc/client/view.qc | 3 ++- qcsrc/menu/xonotic/dialog_settings_game_crosshair.qc | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/crosshairs.cfg b/crosshairs.cfg index dd3302d76..db31159a5 100644 --- a/crosshairs.cfg +++ b/crosshairs.cfg @@ -33,7 +33,8 @@ seta crosshair_hitindication_speed 5 // 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, applying effects from the _blur and _scale cvars" -seta crosshair_hittest_blur 1 "blur the crosshair if the shot is obstructed" +seta crosshair_hittest_blur_teammate 0 "blur the crosshair if the shot is obstructed by a teammate" +seta crosshair_hittest_blur_wall 1 "blur the crosshair if the shot is obstructed by a wall or object" seta crosshair_hittest_scale 1.25 "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 (debug setting, very glitchy!)" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 7c6de40db..5c04cf5ea 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -121,7 +121,8 @@ string autocvar_crosshair_hitindication_color; string autocvar_crosshair_hitindication_per_weapon_color; float autocvar_crosshair_hitindication_speed; bool autocvar_crosshair_hittest; -bool autocvar_crosshair_hittest_blur; +bool autocvar_crosshair_hittest_blur_teammate = 0; +bool autocvar_crosshair_hittest_blur_wall = 1; //float autocvar_crosshair_hittest_scale = 1.25; bool autocvar_crosshair_hittest_showimpact; bool autocvar_crosshair_per_weapon; diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 1f8eb8a69..dc9995f91 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -1231,7 +1231,8 @@ void HUD_Crosshair(entity this) wcross_alpha_goal_prev = wcross_alpha; wcross_color_goal_prev = wcross_color; - if(spectatee_status == 0 && (shottype == SHOTTYPE_HITTEAM || (shottype == SHOTTYPE_HITOBSTRUCTION && autocvar_crosshair_hittest_blur && !autocvar_chase_active))) + if((shottype == SHOTTYPE_HITTEAM && autocvar_crosshair_hittest_blur_teammate) + || (shottype == SHOTTYPE_HITOBSTRUCTION && autocvar_crosshair_hittest_blur_wall && !autocvar_chase_active)) { wcross_blur = 1; wcross_alpha *= 0.75; diff --git a/qcsrc/menu/xonotic/dialog_settings_game_crosshair.qc b/qcsrc/menu/xonotic/dialog_settings_game_crosshair.qc index 2d30dc244..28a0f57a4 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_crosshair.qc +++ b/qcsrc/menu/xonotic/dialog_settings_game_crosshair.qc @@ -133,7 +133,7 @@ void XonoticGameCrosshairSettingsTab_fill(entity me) setDependent(e, "crosshair_enabled", 1, 2); me.TR(me); me.TDempty(me, 0.1); - me.TD(me, 1, 2.9, e = makeXonoticCheckBox(0, "crosshair_hittest_blur", _("Blur crosshair if the shot is obstructed"))); + me.TD(me, 1, 2.9, e = makeXonoticCheckBox(0, "crosshair_hittest_blur_wall", _("Blur crosshair if the shot is obstructed"))); setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2); me.TR(me); me.TDempty(me, 0.1); -- 2.39.2