]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow items to fade out rather than disappear with distance, also add an option to...
authorMario <zacjardine@y7mail.com>
Tue, 7 Apr 2015 13:21:52 +0000 (23:21 +1000)
committerMario <zacjardine@y7mail.com>
Tue, 7 Apr 2015 13:21:52 +0000 (23:21 +1000)
qcsrc/client/autocvars.qh
qcsrc/common/jeff.qh
qcsrc/server/t_items.qc

index 72b1a1cb8e4495605de5245d93328e76cb5698d8..b9ad42205c77db997b4f4f65b924d7c3c3183584 100644 (file)
@@ -491,4 +491,5 @@ vector autocvar_crosshair_rpc_color = '0.2 1.0 0.2';
 float autocvar_crosshair_rpc_alpha = 1;
 float autocvar_crosshair_rpc_size = 1;
 int autocvar_cl_nade_timer;
+bool autocvar_cl_items_nofade;
 #endif
index e21c469b92917e068e5ec06603c3a069fb52ddcb..1676c1f38a4c04654c00e073b6b138fd77503533 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef JEFF_H
 #define JEFF_H
 
+#ifdef JEFF
+
 #define JEFF_ANCE_NOTIF \
     MSG_ANNCE_NOTIF(1, ANNCE_JEFF_BOOSTER,              CH_INFO, "booster",                 VOL_BASEVOICE, ATTEN_NONE) \
     MSG_ANNCE_NOTIF(1, ANNCE_JEFF_BIOHAZARD,            CH_INFO, "biohazard",               VOL_BASEVOICE, ATTEN_NONE) \
@@ -55,4 +57,8 @@
     MSG_ANNCE_NOTIF(1, ANNCE_JEFF_WRECKER,              CH_INFO, "wrecker",                 VOL_BASEVOICE, ATTEN_NONE) \
     MSG_ANNCE_NOTIF(1, ANNCE_JEFF_EXCELLENT,            CH_INFO, "excellent",               VOL_BASEVOICE, ATTEN_NONE) 
 
+#else
+    #define JEFF_ANCE_NOTIF
+#endif
+
 #endif
index 34a699fe08e2840948a6a381b1f839a199f4d874..b1d3d4f370425ebf813efc9d0836d390c80b76c3 100644 (file)
@@ -91,6 +91,8 @@ void Item_PreDraw()
        else
                alph = 1;
        //printf("%v <-> %v\n", view_origin, self.origin + 0.5 * (self.mins + self.maxs));
+       if(self.ItemStatus & ITS_AVAILABLE)
+               self.alpha = alph;
        if(alph <= 0)
                self.drawmask = 0;
        else
@@ -173,7 +175,7 @@ void ItemRead(float _IsNew)
 
         self.fade_end = ReadShort();
         self.fade_start = ReadShort();
-        if(self.fade_start)
+        if(self.fade_start && !autocvar_cl_items_nofade)
                self.predraw = Item_PreDraw;
 
         if(self.mdl)