allow a custom color on the crosshair dot
authorFruitieX <fruitiex@gmail.com>
Sat, 27 Nov 2010 20:07:35 +0000 (22:07 +0200)
committerFruitieX <fruitiex@gmail.com>
Sat, 27 Nov 2010 20:07:35 +0000 (22:07 +0200)
defaultXonotic.cfg
qcsrc/client/View.qc

index 25e3209..9f6359a 100644 (file)
@@ -96,6 +96,7 @@ seta crosshair_size 0.35
 seta crosshair_dot 1
 seta crosshair_dot_alpha 1
 seta crosshair_dot_size 1
+seta crosshair_dot_color 0 "when != 0, use custom color for the crosshair dot"
 seta crosshair_pickup 0.25
 seta crosshair_pickup_speed 4
 seta crosshair_per_weapon 0    "when 1, each gun will display a different crosshair"
index 65f36cf..a3fa9c2 100644 (file)
@@ -1001,7 +1001,14 @@ void CSQC_UpdateView(float w, float h)
                        CROSSHAIR_DRAW(wcross_resolution, wcross_name, wcross_alpha * f);
 
                        if(cvar("crosshair_dot"))
+            {
+                vector wcross_color_old;
+                wcross_color_old = wcross_color;
+                if(cvar_string("crosshair_dot_color") != "0")
+                    wcross_color = stov(cvar_string("crosshair_dot_color"));
                                CROSSHAIR_DRAW(wcross_resolution * cvar("crosshair_dot_size"), "gfx/crosshairdot.tga", wcross_alpha * f * cvar("crosshair_dot_alpha"));
+                wcross_color = wcross_color_old;
+            }
 
                        wcross_name_alpha_goal_prev = f;
                }