diff options
-rw-r--r-- | src/cgame/cg_draw.c | 5 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 1 | ||||
-rw-r--r-- | src/cgame/cg_servercmds.c | 3 | ||||
-rw-r--r-- | src/game/bg_public.h | 89 | ||||
-rw-r--r-- | src/game/g_cmds.c | 2 |
5 files changed, 55 insertions, 45 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 96319e94..848b20d3 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -3080,8 +3080,9 @@ static void CG_DrawVote( team_t team ) Q_strncpyz( nokey, CG_KeyBinding( va( "%svote no", team == TEAM_NONE ? "" : "team" ) ), sizeof( nokey ) ); - s = va( "%sVOTE(%i): \"%s\" [%s]Yes:%i [%s]No:%i", - team == TEAM_NONE ? "" : "TEAM", sec, cgs.voteString[ team ], + s = va( "%sVOTE(%i): \"%s\" called by \"%s" S_COLOR_WHITE "\" [%s]Yes:%i [%s]No:%i", + team == TEAM_NONE ? "" : "TEAM", sec, + cgs.voteString[ team ], cgs.voteCaller[ team ], yeskey, cgs.voteYes[ team ], nokey, cgs.voteNo[ team ] ); UI_Text_Paint( 8, team == TEAM_NONE ? 340 : 360, 0.3f, white, s, 0, 0, ITEM_TEXTSTYLE_NORMAL ); diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 266d0c8b..6bc011f7 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1351,6 +1351,7 @@ typedef struct int voteTime[ NUM_TEAMS ]; int voteYes[ NUM_TEAMS ]; int voteNo[ NUM_TEAMS ]; + char voteCaller[ NUM_TEAMS ][ MAX_NAME_LENGTH ]; qboolean voteModified[ NUM_TEAMS ];// beep whenever changed char voteString[ NUM_TEAMS ][ MAX_STRING_TOKENS ]; diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index db1b2262..b5a85a5b 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -342,6 +342,9 @@ static void CG_ConfigStringModified( void ) else if( num >= CS_VOTE_STRING && num < CS_VOTE_STRING + NUM_TEAMS ) Q_strncpyz( cgs.voteString[ num - CS_VOTE_STRING ], str, sizeof( cgs.voteString[ num - CS_VOTE_STRING ] ) ); + else if( num >= CS_VOTE_CALLER && num < CS_VOTE_CALLER + NUM_TEAMS ) + Q_strncpyz( cgs.voteCaller[ num - CS_VOTE_CALLER ], str, + sizeof( cgs.voteCaller[ num - CS_VOTE_CALLER ] ) ); else if( num == CS_INTERMISSION ) cg.intermissionStarted = atoi( str ); else if( num >= CS_MODELS && num < CS_MODELS+MAX_MODELS ) diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 62c981d2..4a343b13 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -39,45 +39,58 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define CROUCH_VIEWHEIGHT 12 #define DEAD_VIEWHEIGHT 4 // height from ground +// player teams +typedef enum +{ + TEAM_NONE, + TEAM_ALIENS, + TEAM_HUMANS, + + NUM_TEAMS +} team_t; + // // config strings are a general means of communicating variable length strings // from the server to all connected clients. // // CS_SERVERINFO and CS_SYSTEMINFO are defined in q_shared.h -#define CS_MUSIC 2 -#define CS_MESSAGE 3 // from the map worldspawn's message field -#define CS_MOTD 4 // g_motd string for server message of the day -#define CS_WARMUP 5 // server time when the match will be restarted -// 6 UNUSED -// 7 UNUSED -#define CS_VOTE_TIME 8 -#define CS_VOTE_STRING (CS_VOTE_TIME + NUM_TEAMS) -#define CS_VOTE_YES (CS_VOTE_STRING + NUM_TEAMS) -#define CS_VOTE_NO (CS_VOTE_YES + NUM_TEAMS) - -#define CS_GAME_VERSION 20 -#define CS_LEVEL_START_TIME 21 // so the timer only shows the current level -#define CS_INTERMISSION 22 // when 1, fraglimit/timelimit has been hit and intermission will start in a second or two -#define CS_WINNER 23 // string indicating round winner -#define CS_SHADERSTATE 24 -#define CS_BOTINFO 25 -#define CS_CLIENTS_READY 26 - -#define CS_ALIEN_STAGES 29 -#define CS_HUMAN_STAGES 30 - -#define CS_MODELS 33 -#define CS_SOUNDS (CS_MODELS+MAX_MODELS) -#define CS_SHADERS (CS_SOUNDS+MAX_SOUNDS) -#define CS_PARTICLE_SYSTEMS (CS_SHADERS+MAX_GAME_SHADERS) -#define CS_PLAYERS (CS_PARTICLE_SYSTEMS+MAX_GAME_PARTICLE_SYSTEMS) -#define CS_LOCATIONS (CS_PLAYERS+MAX_CLIENTS) - -#define CS_MAX (CS_LOCATIONS+MAX_LOCATIONS) - -#if (CS_MAX) > MAX_CONFIGSTRINGS -#error overflow: (CS_MAX) > MAX_CONFIGSTRINGS +enum +{ + CS_MUSIC = 2, + CS_MESSAGE, // from the map worldspawn's message field + CS_MOTD, // g_motd string for server message of the day + CS_WARMUP, // server time when the match will be restarted + + CS_VOTE_TIME, // Vote stuff each needs NUM_TEAMS slots + CS_VOTE_STRING = CS_VOTE_TIME + NUM_TEAMS, + CS_VOTE_YES = CS_VOTE_STRING + NUM_TEAMS, + CS_VOTE_NO = CS_VOTE_YES + NUM_TEAMS, + CS_VOTE_CALLER = CS_VOTE_NO + NUM_TEAMS, + + CS_GAME_VERSION = CS_VOTE_CALLER + NUM_TEAMS, + CS_LEVEL_START_TIME, // so the timer only shows the current level + CS_INTERMISSION, // when 1, fraglimit/timelimit has been hit and intermission will start in a second or two + CS_WINNER , // string indicating round winner + CS_SHADERSTATE, + CS_BOTINFO, + CS_CLIENTS_READY, + + CS_ALIEN_STAGES, + CS_HUMAN_STAGES, + + CS_MODELS, + CS_SOUNDS = CS_MODELS + MAX_MODELS, + CS_SHADERS = CS_SOUNDS + MAX_SOUNDS, + CS_PARTICLE_SYSTEMS = CS_SHADERS + MAX_GAME_SHADERS, + CS_PLAYERS = CS_PARTICLE_SYSTEMS + MAX_GAME_PARTICLE_SYSTEMS, + CS_LOCATIONS = CS_PLAYERS + MAX_CLIENTS, + + CS_MAX = CS_LOCATIONS + MAX_LOCATIONS +}; + +#if CS_MAX > MAX_CONFIGSTRINGS +#error overflow: CS_MAX > MAX_CONFIGSTRINGS #endif typedef enum @@ -825,16 +838,6 @@ typedef enum SPECTATOR_SCOREBOARD } spectatorState_t; -// player teams -typedef enum -{ - TEAM_NONE, - TEAM_ALIENS, - TEAM_HUMANS, - - NUM_TEAMS -} team_t; - // modes of text communication typedef enum { diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index cbcc18b7..c6052eb4 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1421,6 +1421,8 @@ void Cmd_CallVote_f( gentity_t *ent ) va( "%d", level.voteTime[ team ] ) ); trap_SetConfigstring( CS_VOTE_STRING + team, level.voteDisplayString[ team ] ); + trap_SetConfigstring( CS_VOTE_CALLER + team, + ent->client->pers.netname ); ent->client->pers.namelog->voteCount++; ent->client->pers.vote |= 1 << team; |