From 3a182381c2f8825d9ad3bf6c0558a013728dc633 Mon Sep 17 00:00:00 2001 From: avirox Date: Fri, 6 Jan 2006 13:59:12 +0000 Subject: [PATCH] Fixed GUI menu flicker and added support to select Yellow and Green (pink in GUI menu for now) teams. git-svn-id: svn://svn.icculus.org/nexuiz/trunk@776 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- TeamNexuiz/game/gamec/cl_client.c | 10 ++++++++++ TeamNexuiz/game/gamec/cl_impulse.c | 4 ++++ TeamNexuiz/game/gamec/cl_weapons.c | 3 +++ TeamNexuiz/game/gamec/tfdefs.c | 4 ++++ TeamNexuiz/game/gamec/tffunctions.c | 11 +++++++++-- TeamNexuiz/game/gamec/tfgrenades.c | 2 +- 6 files changed, 31 insertions(+), 3 deletions(-) diff --git a/TeamNexuiz/game/gamec/cl_client.c b/TeamNexuiz/game/gamec/cl_client.c index 87be19e1e..7a5e16b09 100644 --- a/TeamNexuiz/game/gamec/cl_client.c +++ b/TeamNexuiz/game/gamec/cl_client.c @@ -1237,6 +1237,16 @@ void SV_ParseClientCommand (string s) TeamFortress_TeamSet (1); PutClientInServer (); } + if (d == "yellow" || d == "3") + { + TeamFortress_TeamSet (3); + PutClientInServer (); + } + if (d == "green" || d == "pink" || d == "3") // Morphed set it to Pink in the menus. I think + { // we should make it white instead. + TeamFortress_TeamSet (4); + PutClientInServer (); + } return; } if (c == "selectclass") diff --git a/TeamNexuiz/game/gamec/cl_impulse.c b/TeamNexuiz/game/gamec/cl_impulse.c index 9ba45114f..6164c0fd0 100644 --- a/TeamNexuiz/game/gamec/cl_impulse.c +++ b/TeamNexuiz/game/gamec/cl_impulse.c @@ -22,6 +22,9 @@ void ImpulseCommands (void) { local float swpn; + if (self.impulse_wait > time) // So the GUI menus doesnt flicker + return; + if (self.playerclass < 1) // Bring up menu if no team/class { if (self.team_no < 1) @@ -33,6 +36,7 @@ void ImpulseCommands (void) stuffcmd(self, "set scmenu_directmenu ClassSelect; togglemenu\n"); } self.impulse = 0; + self.impulse_wait = time + .5; return; } if (self.impulse == 71) diff --git a/TeamNexuiz/game/gamec/cl_weapons.c b/TeamNexuiz/game/gamec/cl_weapons.c index dc970fe1a..4ca5379b1 100644 --- a/TeamNexuiz/game/gamec/cl_weapons.c +++ b/TeamNexuiz/game/gamec/cl_weapons.c @@ -123,6 +123,8 @@ void(float wpn, float wrequest) weapon_action = void () CheckTeamClass = { + if (self.impulse_wait > time) // So the GUI menus doesnt flicker + return; if (self.playerclass < 1) // Bring up menu if no team/class { if (self.team_no < 1) @@ -133,6 +135,7 @@ void () CheckTeamClass = { stuffcmd(self, "set scmenu_directmenu ClassSelect; togglemenu\n"); } + self.impulse_wait = time + .5; return; } }; diff --git a/TeamNexuiz/game/gamec/tfdefs.c b/TeamNexuiz/game/gamec/tfdefs.c index 8a64bfdb9..6ec72a78a 100644 --- a/TeamNexuiz/game/gamec/tfdefs.c +++ b/TeamNexuiz/game/gamec/tfdefs.c @@ -257,6 +257,10 @@ float modelindex_null = 0; .float has_turretized_tesla; // is the player's tesla turretized? float modelindex_eyes = 0; +// non-tf files +// cl_impulses +.float impulse_wait; // time when player can next use an impulse + // classes // engiener .float is_building; // is the player in the middle of building something diff --git a/TeamNexuiz/game/gamec/tffunctions.c b/TeamNexuiz/game/gamec/tffunctions.c index a53001c03..035fd2da2 100644 --- a/TeamNexuiz/game/gamec/tffunctions.c +++ b/TeamNexuiz/game/gamec/tffunctions.c @@ -48,7 +48,14 @@ void SV_ChangeTeam(float color) if (self.team_no == 2 && color != 4) { setcolor(self, 4,4); -// stuffcmd(self, "color 4\n"); + } + if (self.team_no == 3 && color != 12) + { + setcolor(self, 12,12); + } + if (self.team_no == 4 && color != 11) + { + setcolor(self, 11,11); } }; @@ -2170,7 +2177,7 @@ void (vector vect_a, vector vect_b) launch_spike = newmis.nextthink = (time + 3); if (deathmsg != 9) { - setmodel (newmis, "progs/syringe.mdl"); + setmodel (newmis, "models/plasmatrail.mdl"); } setsize (newmis, '0 0 0', '0 0 0'); setorigin (newmis, vect_a); diff --git a/TeamNexuiz/game/gamec/tfgrenades.c b/TeamNexuiz/game/gamec/tfgrenades.c index 4d886a739..e1a2f572d 100644 --- a/TeamNexuiz/game/gamec/tfgrenades.c +++ b/TeamNexuiz/game/gamec/tfgrenades.c @@ -528,7 +528,7 @@ void () TeamFortress_PrimeGrenade = else { sound (self, CHAN_WEAPON, "weapons/prime.wav", 1, ATTN_STATIC); - stuffcmd (self, "play weapons/gren.wav\n"); + sound (self, CHAN_AUTO, "weapons/gren.wav", 1, ATTN_STATIC); ptime = ftos (3); sprint (self, gs); sprint (self, " primed, "); -- 2.39.2