From 2aadc1d1af4c0a106c07b1977980e1779e72b960 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Sat, 30 Oct 2010 17:33:23 +0300 Subject: [PATCH] All shall be cvared! --- defaultXonotic.cfg | 4 ++++ qcsrc/client/View.qc | 19 +++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index b89fdda7e..4e24b0ce4 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -96,6 +96,10 @@ seta crosshair_size 0.35 seta crosshair_dot 1 seta crosshair_dot_alpha 1 seta crosshair_dot_size 1 + +seta crosshair_pickup 1 +seta crosshair_pickup_speed 0.01 + seta crosshair_per_weapon 0 "when 1, each gun will display a different crosshair" seta crosshair_color_override 0 "when 1, crosshair_color_* overrides the per-weapon color" seta crosshair_effect_speed -1 "how fast (in seconds) some crosshair effects should take place, 0 = instant, -1 = 2x weapon switch time" diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index df2f52e4c..8bfccde47 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -771,16 +771,19 @@ void CSQC_UpdateView(float w, float h) wcross_scale = 1; } - if(pickup_crosshair_time < getstatf(STAT_PICKUP_CROSSHAIR)) + if(cvar("crosshair_pickup")) { - pickup_crosshair_fade = 1; - pickup_crosshair_time = getstatf(STAT_PICKUP_CROSSHAIR); + if(pickup_crosshair_time < getstatf(STAT_PICKUP_CROSSHAIR)) + { + pickup_crosshair_fade = 1; + pickup_crosshair_time = getstatf(STAT_PICKUP_CROSSHAIR); + } + if(pickup_crosshair_fade > 0) + pickup_crosshair_fade -= cvar("crosshair_pickup_speed"); + else + pickup_crosshair_fade = 0; + wcross_scale += sin(pickup_crosshair_fade) * cvar("crosshair_pickup"); } - if(pickup_crosshair_fade > 0) - pickup_crosshair_fade -= 0.01; - else - pickup_crosshair_fade = 0; - wcross_scale += sin(pickup_crosshair_fade); if(shottype == SHOTTYPE_HITENEMY) wcross_scale *= cvar("crosshair_hittest"); // is not queried if hittest is 0 -- 2.39.2