From: Mario Date: Tue, 7 Apr 2015 13:21:52 +0000 (+1000) Subject: Allow items to fade out rather than disappear with distance, also add an option to... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=350ffb4047e3f8685d72b167b91be71502525e48;p=xonotic%2Fxonotic-data.pk3dir.git Allow items to fade out rather than disappear with distance, also add an option to disable the function completely --- diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 72b1a1cb8..b9ad42205 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -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 diff --git a/qcsrc/common/jeff.qh b/qcsrc/common/jeff.qh index e21c469b9..1676c1f38 100644 --- a/qcsrc/common/jeff.qh +++ b/qcsrc/common/jeff.qh @@ -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 diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 34a699fe0..b1d3d4f37 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -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)