From: Mircea Kitsune Date: Sat, 30 Oct 2010 14:17:00 +0000 (+0300) Subject: Second and final part: Apply the changes to the crosshair. Code still incomplete... X-Git-Tag: xonotic-v0.1.0preview~224^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b61b88f389c8bb5a8edca4dc4b4fc5a1b4df600c;p=xonotic%2Fxonotic-data.pk3dir.git Second and final part: Apply the changes to the crosshair. Code still incomplete, nonfunctional and in the works. --- diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 39f0586b1..60be1ebef 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -349,6 +349,8 @@ void CSQC_RAPTOR_HUD(); vector freeze_pmove_org, freeze_input_angles; entity nightvision_noise, nightvision_noise2; +float pickup_crosshair_time, pickup_crosshair_fade; + void CSQC_UpdateView(float w, float h) { entity e; @@ -768,6 +770,19 @@ void CSQC_UpdateView(float w, float h) { wcross_scale = 1; } +if(!pickup_crosshair_fade) +pickup_crosshair_fade = 1; + 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 -= 0.01; + else + pickup_crosshair_fade = 0; + wcross_scale += sin(pickup_crosshair_fade); + dprint(strcat(" ------------> ", ftos(getstatf(STAT_PICKUP_CROSSHAIR)), " <-------------\n")); if(shottype == SHOTTYPE_HITENEMY) wcross_scale *= cvar("crosshair_hittest"); // is not queried if hittest is 0