Dim crosshair color and / or alpha when unarmed
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 1 Mar 2011 00:08:30 +0000 (02:08 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 1 Mar 2011 00:08:30 +0000 (02:08 +0200)
data/defaultVoretournament.cfg
data/qcsrc/client/View.qc

index 4ac9a73..f563b38 100644 (file)
@@ -110,6 +110,8 @@ _cl_playerskin 0
 crosshair 11\r
 seta crosshair_pickup 1 "crosshair grows then shrinks back when picking up an item"\r
 seta crosshair_color_by_health 1 "if enabled, crosshair color will depend on current health"\r
+seta crosshair_unarmed_dim_color 0.5 "dim crosshair color by this amount when we aren't holding a weapon"\r
+seta crosshair_unarmed_dim_alpha 0.5 "dim crosshair alpha by this amount when we aren't holding a weapon"\r
 seta crosshair_pickup_speed 4 "speed of the crosshair pickup effect"\r
 seta crosshair_ring_alpha 0.5 "alpha of the crosshair ammo ring"\r
 seta crosshair_ring_size 3 "size of the crosshair ammo ring"\r
index 674fb9c..73aaf13 100644 (file)
@@ -1051,6 +1051,15 @@ void CSQC_UpdateView(float w, float h)
                                wcross_alpha = cvar("crosshair_color_alpha");\r
                                wcross_resolution = cvar("crosshair_size");\r
 \r
+                               if(!activeweapon)\r
+                               if(!swallow_indicator)\r
+                               {\r
+                                       if(cvar("crosshair_unarmed_dim_color"))\r
+                                               wcross_color *= cvar("crosshair_unarmed_dim_color");\r
+                                       if(cvar("crosshair_unarmed_dim_alpha"))\r
+                                               wcross_alpha *= cvar("crosshair_unarmed_dim_alpha");\r
+                               }\r
+\r
                                wcross_name = strcat("gfx/crosshair", wcross_style);\r
 \r
                                if(cvar("crosshair_effect_scalefade"))\r