]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Crosshair style based on weapon and firing type
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 19 Jul 2011 12:10:02 +0000 (15:10 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 19 Jul 2011 12:10:02 +0000 (15:10 +0300)
data/defaultVT.cfg
data/qcsrc/client/View.qc
data/qcsrc/server/w_grabber.qc

index 198f5679e81a8b8770d64f76b2efc26aed7d6fc0..c73f43cca19cf0ac680c180c24a6b2d5ac524492 100644 (file)
@@ -107,7 +107,9 @@ _cl_color 187
 _cl_name "Player"\r
 _cl_playermodel models/player/vixen.zym\r
 _cl_playerskin 0\r
-crosshair 13\r
+seta crosshair 13\r
+seta crosshair_primary 14\r
+seta crosshair_secondary 15\r
 seta crosshair_color "1 1 0.5"\r
 seta crosshair_alpha 1\r
 seta crosshair_size 0.35\r
index c5d359ad45d3495f6c4f568be8c19f12b944f01e..aed53ade42fb5300c4baec8435bdb186847f822e 100644 (file)
@@ -1113,7 +1113,15 @@ void CSQC_UpdateView(float w, float h)
                        else if(swallow_indicator < 0)\r
                                wcross_style = "_canswallow_no.tga";\r
                        else\r
-                               wcross_style = cvar_string("crosshair");\r
+                       {\r
+                               // normal crosshair, based on what weapon we have and what firing type we can use\r
+                               if(!activeweapon)\r
+                                       wcross_style = cvar_string("crosshair");\r
+                               else if(getstati(STAT_CROSSHAIR_STYLE))\r
+                                       wcross_style = cvar_string("crosshair_secondary");\r
+                               else\r
+                                       wcross_style = cvar_string("crosshair_primary");\r
+                       }\r
 \r
                        if (wcross_style != "0") {\r
                                vector wcross_color, wcross_size;\r
index 26f379486a1dee5cb29b73dc93f4e2c654ff15aa..4de8425b4c7446db31e52610e1c7a6fed9e2629b 100644 (file)
@@ -82,9 +82,9 @@ float w_grabber(float req)
                W_SetupShot (self, TRUE, 0, "", 0); // do this to update w_shotorg\r
                WarpZone_traceline_antilag(self, w_shotorg, w_shotorg + w_shotdir * cvar("g_balance_grabber_secondary_radius"), FALSE, self, ANTILAG_LATENCY(self));\r
                if(trace_fraction < 1)\r
-                       dprint("!!!!!!!!!!!!!!!!!!!!!!!\n");\r
+                       self.stat_crosshair_style = 1;\r
                else\r
-                       dprint("#######################\n");\r
+                       self.stat_crosshair_style = 0;\r
 \r
                grabbered_fuel = cvar("g_balance_grabber_primary_grabbered_fuel");\r
                // forced reload\r