set g_multijump_add 0 "0 = make the current z velocity equal to jumpvelocity, 1 = add jumpvelocity to the current z velocity"\r
set g_multijump_speed -125 "Minimum vertical speed a player must have in order to jump again"\r
\r
+set g_gundisplay_warn_load 10 "display digits will show in warning mode when weapon load is below this amount"\r
+set g_gundisplay_warn_ammo 50 "display digits will show in warning mode when ammo is below this amount"\r
+\r
// effects\r
r_glsl_postprocess 1\r
r_picmipsprites 0 // Voretournament uses sprites that should never be picmipped (team mate, typing, waypoints)\r
void W_DisplayDigitThink()\r
{\r
self.nextthink = time;\r
+ float w_load, w_ammo;\r
+ w_load = self.owner.weapon_load[self.owner.weapon];\r
+ w_ammo = self.owner.(self.owner.current_ammo);\r
\r
// the owner has switched to another weapon, remove the digits\r
if(self.weapon != self.owner.weapon || self.owner.classname != "player" || self.deadflag != DEAD_NO)\r
string txt;\r
if(self.team) // weapon load display\r
{\r
- if(self.owner.weapon_load[self.owner.weapon] <= 0)\r
+ if(w_load <= 0)\r
{\r
self.skin = 11; // unavailable digit\r
return;\r
}\r
else\r
{\r
- txt = ftos(floor(self.owner.weapon_load[self.owner.weapon]));\r
+ txt = ftos(floor(w_load));\r
txt = substring(txt, self.cnt - 1, 1);\r
}\r
+\r
+ if(self.owner.weapon_load[self.owner.weapon] <= ceil(cvar("g_gundisplay_warn_load")))\r
+ {\r
+ // in warning mode, only keep red color\r
+ if(!self.colormod)\r
+ self.colormod = '1 1 1';\r
+ self.colormod_y = 0;\r
+ self.colormod_z = 0;\r
+ }\r
}\r
else // ammo display\r
{\r
- txt = ftos(floor(self.owner.(self.owner.current_ammo)));\r
+ txt = ftos(floor(w_ammo));\r
txt = substring(txt, self.cnt - 1, 1);\r
+\r
+ if(w_ammo <= ceil(cvar("g_gundisplay_warn_ammo")))\r
+ {\r
+ // in warning mode, only keep red color\r
+ if(!self.colormod)\r
+ self.colormod = '1 1 1';\r
+ self.colormod_y = 0;\r
+ self.colormod_z = 0;\r
+ }\r
}\r
\r
if((!txt || txt == ""))\r
\r
- 0.7: Make sure all effects work for spectators too (such as the macro earthquake effect)\r
\r
-- 0.7 | 0.8: Make display digits red when ammo or load are too low\r
-\r
- 0.7 | 0.8: The stomach gurgle sound duration does not match the pitch properly
\ No newline at end of file