summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cgame/cg_consolecmds.c8
-rw-r--r--src/cgame/cg_draw.c2
-rw-r--r--src/cgame/cg_local.h15
-rw-r--r--src/cgame/cg_main.c12
-rw-r--r--src/cgame/cg_players.c74
-rw-r--r--src/cgame/cg_tutorial.c1
-rw-r--r--src/client/cl_cgame.c5
-rw-r--r--src/client/cl_console.c30
-rw-r--r--src/client/cl_input.c8
-rw-r--r--src/client/cl_keys.c51
-rw-r--r--src/client/cl_main.c33
-rw-r--r--src/client/cl_scrn.c2
-rw-r--r--src/client/cl_ui.c5
-rw-r--r--src/client/client.h3
-rw-r--r--src/game/g_client.c27
-rw-r--r--src/game/g_local.h1
-rw-r--r--src/qcommon/qcommon.h4
-rw-r--r--src/sdl/sdl_gamma.c28
-rw-r--r--src/sdl/sdl_glimp.c2
-rw-r--r--src/sdl/sdl_input.c4
-rw-r--r--src/sys/sys_main.c2
-rw-r--r--src/ui/ui_main.c6
-rw-r--r--src/ui/ui_shared.c135
-rw-r--r--src/ui/ui_shared.h3
-rw-r--r--ui/createserver.menu14
-rw-r--r--ui/findplayer.menu8
-rw-r--r--ui/ingame_game.menu2410
-rw-r--r--ui/joinserver.menu16
-rw-r--r--ui/main.menu1
-rw-r--r--ui/mod.menu6
-rw-r--r--ui/options.menu6
-rw-r--r--ui/quit.menu8
-rw-r--r--ui/serverinfo.menu14
-rw-r--r--ui/teamscore.menu28
34 files changed, 220 insertions, 2752 deletions
diff --git a/src/cgame/cg_consolecmds.c b/src/cgame/cg_consolecmds.c
index 3dc7ef4d..65177875 100644
--- a/src/cgame/cg_consolecmds.c
+++ b/src/cgame/cg_consolecmds.c
@@ -282,13 +282,6 @@ void CG_InitConsoleCommands( void )
trap_AddCommand( "say" );
trap_AddCommand( "say_team" );
trap_AddCommand( "tell" );
- trap_AddCommand( "vsay" );
- trap_AddCommand( "vsay_team" );
- trap_AddCommand( "vtell" );
- trap_AddCommand( "vtaunt" );
- trap_AddCommand( "vosay" );
- trap_AddCommand( "vosay_team" );
- trap_AddCommand( "votell" );
trap_AddCommand( "give" );
trap_AddCommand( "god" );
trap_AddCommand( "notarget" );
@@ -303,7 +296,6 @@ void CG_InitConsoleCommands( void )
trap_AddCommand( "callteamvote" );
trap_AddCommand( "teamvote" );
trap_AddCommand( "stats" );
- trap_AddCommand( "teamtask" );
trap_AddCommand( "class" );
trap_AddCommand( "build" );
trap_AddCommand( "buy" );
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 774b10c4..a5d458cf 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -2802,7 +2802,7 @@ CG_ShowTeamMenus
*/
void CG_ShowTeamMenu( void )
{
- Menus_OpenByName( "teamMenu" );
+ Menus_ActivateByName( "teamMenu" );
}
/*
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 4952eef4..2ed268e7 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -79,10 +79,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define TEAM_OVERLAY_MAXNAME_WIDTH 12
#define TEAM_OVERLAY_MAXLOCATION_WIDTH 16
-#define DEFAULT_MODEL "sarge"
-#define DEFAULT_TEAM_MODEL "sarge"
-#define DEFAULT_TEAM_HEAD "sarge"
-
typedef enum
{
FOOTSTEP_NORMAL,
@@ -708,8 +704,6 @@ typedef struct
char name[ MAX_QPATH ];
pTeam_t team;
- int botSkill; // 0 = not bot, 1-5 = bot
-
vec3_t color1;
vec3_t color2;
@@ -720,10 +714,6 @@ typedef struct
int curWeapon;
int handicap;
- int wins, losses; // in tourney mode
-
- int teamTask; // task in teamplay (offence/defence)
- qboolean teamLeader; // true when this is a team leader
int medkitUsageTime;
int invulnerabilityStartTime;
@@ -736,8 +726,6 @@ typedef struct
// gameplay
char modelName[ MAX_QPATH ];
char skinName[ MAX_QPATH ];
- char headModelName[ MAX_QPATH ];
- char headSkinName[ MAX_QPATH ];
qboolean newAnims; // true if using the new mission pack animations
qboolean fixedlegs; // true if legs yaw is always the same as torso yaw
@@ -1461,7 +1449,6 @@ extern vmCvar_t cg_forceModel;
extern vmCvar_t cg_buildScript;
extern vmCvar_t cg_paused;
extern vmCvar_t cg_blood;
-extern vmCvar_t cg_predictItems;
extern vmCvar_t cg_deferPlayers;
extern vmCvar_t cg_drawFriend;
extern vmCvar_t cg_teamChatsOnly;
@@ -1471,7 +1458,6 @@ extern vmCvar_t cg_scorePlum;
extern vmCvar_t cg_smoothClients;
extern vmCvar_t pmove_fixed;
extern vmCvar_t pmove_msec;
-//extern vmCvar_t cg_pmove_fixed;
extern vmCvar_t cg_cameraOrbit;
extern vmCvar_t cg_cameraOrbitDelay;
extern vmCvar_t cg_timescaleFadeEnd;
@@ -1486,7 +1472,6 @@ extern vmCvar_t cg_oldRail;
extern vmCvar_t cg_oldRocket;
extern vmCvar_t cg_oldPlasma;
extern vmCvar_t cg_trueLightning;
-extern vmCvar_t cg_creepRes;
extern vmCvar_t cg_drawSurfNormal;
extern vmCvar_t cg_drawBBOX;
extern vmCvar_t cg_debugAlloc;
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 3f20ce20..9bc39014 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -170,7 +170,6 @@ vmCvar_t cg_buildScript;
vmCvar_t cg_forceModel;
vmCvar_t cg_paused;
vmCvar_t cg_blood;
-vmCvar_t cg_predictItems;
vmCvar_t cg_deferPlayers;
vmCvar_t cg_drawTeamOverlay;
vmCvar_t cg_teamOverlayUserinfo;
@@ -182,7 +181,6 @@ vmCvar_t cg_hudFiles;
vmCvar_t cg_scorePlum;
vmCvar_t cg_smoothClients;
vmCvar_t pmove_fixed;
-//vmCvar_t cg_pmove_fixed;
vmCvar_t pmove_msec;
vmCvar_t cg_pmove_msec;
vmCvar_t cg_cameraMode;
@@ -199,7 +197,6 @@ vmCvar_t cg_oldRail;
vmCvar_t cg_oldRocket;
vmCvar_t cg_oldPlasma;
vmCvar_t cg_trueLightning;
-vmCvar_t cg_creepRes;
vmCvar_t cg_drawSurfNormal;
vmCvar_t cg_drawBBOX;
vmCvar_t cg_debugAlloc;
@@ -306,7 +303,6 @@ static cvarTable_t cvarTable[ ] =
{ &cg_thirdPersonAngle, "cg_thirdPersonAngle", "0", CVAR_CHEAT },
{ &cg_thirdPerson, "cg_thirdPerson", "0", CVAR_CHEAT },
{ &cg_forceModel, "cg_forceModel", "0", CVAR_ARCHIVE },
- { &cg_predictItems, "cg_predictItems", "1", CVAR_ARCHIVE },
{ &cg_deferPlayers, "cg_deferPlayers", "1", CVAR_ARCHIVE },
{ &cg_drawTeamOverlay, "cg_drawTeamOverlay", "0", CVAR_ARCHIVE },
{ &cg_teamOverlayUserinfo, "teamoverlay", "0", CVAR_ROM | CVAR_USERINFO },
@@ -315,7 +311,6 @@ static cvarTable_t cvarTable[ ] =
{ &cg_teamChatsOnly, "cg_teamChatsOnly", "0", CVAR_ARCHIVE },
{ &cg_noVoiceChats, "cg_noVoiceChats", "0", CVAR_ARCHIVE },
{ &cg_noVoiceText, "cg_noVoiceText", "0", CVAR_ARCHIVE },
- { &cg_creepRes, "cg_creepRes", "16", CVAR_ARCHIVE },
{ &cg_drawSurfNormal, "cg_drawSurfNormal", "0", CVAR_CHEAT },
{ &cg_drawBBOX, "cg_drawBBOX", "0", CVAR_CHEAT },
{ &cg_debugAlloc, "cg_debugAlloc", "0", 0 },
@@ -366,7 +361,6 @@ static cvarTable_t cvarTable[ ] =
{ &cg_timescaleFadeEnd, "cg_timescaleFadeEnd", "1", 0},
{ &cg_timescaleFadeSpeed, "cg_timescaleFadeSpeed", "0", 0},
{ &cg_timescale, "timescale", "1", 0},
- { &cg_scorePlum, "cg_scorePlums", "1", CVAR_USERINFO | CVAR_ARCHIVE},
{ &cg_smoothClients, "cg_smoothClients", "0", CVAR_USERINFO | CVAR_ARCHIVE},
{ &cg_cameraMode, "com_cameraMode", "0", CVAR_CHEAT},
@@ -380,7 +374,6 @@ static cvarTable_t cvarTable[ ] =
{ &cg_oldRocket, "cg_oldRocket", "1", CVAR_ARCHIVE},
{ &cg_oldPlasma, "cg_oldPlasma", "1", CVAR_ARCHIVE},
{ &cg_trueLightning, "cg_trueLightning", "0.0", CVAR_ARCHIVE}
-// { &cg_pmove_fixed, "cg_pmove_fixed", "0", CVAR_USERINFO | CVAR_ARCHIVE }
};
static int cvarTableSize = sizeof( cvarTable ) / sizeof( cvarTable[0] );
@@ -409,11 +402,6 @@ void CG_RegisterCvars( void )
trap_Cvar_VariableStringBuffer( "sv_running", var, sizeof( var ) );
cgs.localServer = atoi( var );
forceModelModificationCount = cg_forceModel.modificationCount;
-
- trap_Cvar_Register( NULL, "model", DEFAULT_MODEL, CVAR_USERINFO | CVAR_ARCHIVE );
- trap_Cvar_Register( NULL, "headmodel", DEFAULT_MODEL, CVAR_USERINFO | CVAR_ARCHIVE );
- trap_Cvar_Register( NULL, "team_model", DEFAULT_TEAM_MODEL, CVAR_USERINFO | CVAR_ARCHIVE );
- trap_Cvar_Register( NULL, "team_headmodel", DEFAULT_TEAM_HEAD, CVAR_USERINFO | CVAR_ARCHIVE );
}
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index f0800fa5..ad517800 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -484,15 +484,6 @@ static qboolean CG_RegisterClientModelname( clientInfo_t *ci, const char *modelN
return qfalse;
}
- //FIXME: skins do not load without icon present. do we want icons anyway?
-/* Com_sprintf( filename, sizeof( filename ), "models/players/%s/icon_%s.tga", modelName, skinName );
- ci->modelIcon = trap_R_RegisterShaderNoMip( filename );
- if( !ci->modelIcon )
- {
- Com_Printf( "Failed to load icon file: %s\n", filename );
- return qfalse;
- }*/
-
return qtrue;
}
@@ -535,24 +526,16 @@ Load it now, taking the disk hits
*/
static void CG_LoadClientInfo( clientInfo_t *ci )
{
- const char *dir, *fallback;
+ const char *dir;
int i;
const char *s;
int clientNum;
if( !CG_RegisterClientModelname( ci, ci->modelName, ci->skinName ) )
- {
- if( cg_buildScript.integer )
- CG_Error( "CG_RegisterClientModelname( %s, %s ) failed", ci->modelName, ci->skinName );
-
- // fall back
- if( !CG_RegisterClientModelname( ci, DEFAULT_MODEL, "default" ) )
- CG_Error( "DEFAULT_MODEL (%s) failed to register", DEFAULT_MODEL );
- }
+ CG_Error( "CG_RegisterClientModelname( %s, %s ) failed", ci->modelName, ci->skinName );
// sounds
dir = ci->modelName;
- fallback = DEFAULT_MODEL;
for( i = 0; i < MAX_CUSTOM_SOUNDS; i++ )
{
@@ -578,15 +561,11 @@ static void CG_LoadClientInfo( clientInfo_t *ci )
s = cg_customSoundNames[ 0 ]; //death1
ci->sounds[ i ] = trap_S_RegisterSound( va( "sound/player/%s/%s", dir, s + 1 ), qfalse );
- if( !ci->sounds[ i ] )
- ci->sounds[ i ] = trap_S_RegisterSound( va( "sound/player/%s/%s", fallback, s + 1 ), qfalse );
}
}
else
{
ci->sounds[ i ] = trap_S_RegisterSound( va( "sound/player/%s/%s", dir, s + 1 ), qfalse );
- if( !ci->sounds[ i ] )
- ci->sounds[ i ] = trap_S_RegisterSound( va( "sound/player/%s/%s", fallback, s + 1 ), qfalse );
}
}
@@ -728,19 +707,12 @@ void CG_PrecacheClientInfo( pClass_t class, char *model, char *skin )
// model
Q_strncpyz( newInfo.modelName, model, sizeof( newInfo.modelName ) );
- Q_strncpyz( newInfo.headModelName, model, sizeof( newInfo.headModelName ) );
- // modelName didn not include a skin name
+ // modelName did not include a skin name
if( !skin )
- {
Q_strncpyz( newInfo.skinName, "default", sizeof( newInfo.skinName ) );
- Q_strncpyz( newInfo.headSkinName, "default", sizeof( newInfo.headSkinName ) );
- }
else
- {
Q_strncpyz( newInfo.skinName, skin, sizeof( newInfo.skinName ) );
- Q_strncpyz( newInfo.headSkinName, skin, sizeof( newInfo.headSkinName ) );
- }
newInfo.infoValid = qtrue;
@@ -786,34 +758,14 @@ void CG_NewClientInfo( int clientNum )
v = Info_ValueForKey( configstring, "c2" );
CG_ColorFromString( v, newInfo.color2 );
- // bot skill
- v = Info_ValueForKey( configstring, "skill" );
- newInfo.botSkill = atoi( v );
-
// handicap
v = Info_ValueForKey( configstring, "hc" );
newInfo.handicap = atoi( v );
- // wins
- v = Info_ValueForKey( configstring, "w" );
- newInfo.wins = atoi( v );
-
- // losses
- v = Info_ValueForKey( configstring, "l" );
- newInfo.losses = atoi( v );
-
// team
v = Info_ValueForKey( configstring, "t" );
newInfo.team = atoi( v );
- // team task
- v = Info_ValueForKey( configstring, "tt" );
- newInfo.teamTask = atoi( v );
-
- // team leader
- v = Info_ValueForKey( configstring, "tl" );
- newInfo.teamLeader = atoi( v );
-
// model
v = Info_ValueForKey( configstring, "model" );
Q_strncpyz( newInfo.modelName, v, sizeof( newInfo.modelName ) );
@@ -832,26 +784,6 @@ void CG_NewClientInfo( int clientNum )
*slash = 0;
}
- //CG_Printf( "NCI: %s\n", v );
-
- // head model
- v = Info_ValueForKey( configstring, "hmodel" );
- Q_strncpyz( newInfo.headModelName, v, sizeof( newInfo.headModelName ) );
-
- slash = strchr( newInfo.headModelName, '/' );
-
- if( !slash )
- {
- // modelName didn not include a skin name
- Q_strncpyz( newInfo.headSkinName, "default", sizeof( newInfo.headSkinName ) );
- }
- else
- {
- Q_strncpyz( newInfo.headSkinName, slash + 1, sizeof( newInfo.headSkinName ) );
- // truncate modelName
- *slash = 0;
- }
-
// replace whatever was there with the new one
newInfo.infoValid = qtrue;
*ci = newInfo;
diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c
index 9997abcd..21242a75 100644
--- a/src/cgame/cg_tutorial.c
+++ b/src/cgame/cg_tutorial.c
@@ -646,6 +646,7 @@ const char *CG_TutorialText( void )
break;
case PCL_HUMAN:
+ case PCL_HUMAN_BSUIT:
CG_HumanText( text, ps );
break;
diff --git a/src/client/cl_cgame.c b/src/client/cl_cgame.c
index 40714a56..84b58d74 100644
--- a/src/client/cl_cgame.c
+++ b/src/client/cl_cgame.c
@@ -385,7 +385,7 @@ CL_ShutdonwCGame
====================
*/
void CL_ShutdownCGame( void ) {
- cls.keyCatchers &= ~KEYCATCH_CGAME;
+ Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_CGAME );
cls.cgameStarted = qfalse;
if ( !cgvm ) {
return;
@@ -619,7 +619,8 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) {
case CG_KEY_GETCATCHER:
return Key_GetCatcher();
case CG_KEY_SETCATCHER:
- Key_SetCatcher( args[1] );
+ // Don't allow the cgame module to close the console
+ Key_SetCatcher( args[1] | ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) );
return 0;
case CG_KEY_GETKEY:
return Key_GetKey( VMA(1) );
diff --git a/src/client/cl_console.c b/src/client/cl_console.c
index 9d2d8e7c..d740696d 100644
--- a/src/client/cl_console.c
+++ b/src/client/cl_console.c
@@ -70,14 +70,14 @@ Con_ToggleConsole_f
*/
void Con_ToggleConsole_f (void) {
// Can't toggle the console when it's the only thing available
- if ( cls.state == CA_DISCONNECTED && cls.keyCatchers == KEYCATCH_CONSOLE ) {
+ if ( cls.state == CA_DISCONNECTED && Key_GetCatcher( ) == KEYCATCH_CONSOLE ) {
return;
}
Field_Clear( &g_consoleField );
g_consoleField.widthInChars = g_console_field_width;
- cls.keyCatchers ^= KEYCATCH_CONSOLE;
+ Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_CONSOLE );
}
/*
@@ -91,7 +91,7 @@ void Con_MessageMode_f (void) {
Field_Clear( &chatField );
chatField.widthInChars = 30;
- cls.keyCatchers ^= KEYCATCH_MESSAGE;
+ Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_MESSAGE );
}
/*
@@ -104,7 +104,7 @@ void Con_MessageMode2_f (void) {
chat_team = qtrue;
Field_Clear( &chatField );
chatField.widthInChars = 25;
- cls.keyCatchers ^= KEYCATCH_MESSAGE;
+ Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_MESSAGE );
}
/*
@@ -121,7 +121,7 @@ void Con_MessageMode3_f (void) {
chat_team = qfalse;
Field_Clear( &chatField );
chatField.widthInChars = 30;
- cls.keyCatchers ^= KEYCATCH_MESSAGE;
+ Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_MESSAGE );
}
/*
@@ -138,7 +138,7 @@ void Con_MessageMode4_f (void) {
chat_team = qfalse;
Field_Clear( &chatField );
chatField.widthInChars = 30;
- cls.keyCatchers ^= KEYCATCH_MESSAGE;
+ Key_SetCatcher( Key_GetCatcher( ) ^ KEYCATCH_MESSAGE );
}
/*
@@ -377,7 +377,7 @@ void CL_ConsolePrint( char *txt ) {
con.initialized = qtrue;
}
- if( !skipnotify && !( cls.keyCatchers & KEYCATCH_CONSOLE ) ) {
+ if( !skipnotify && !( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) ) {
Cmd_SaveCmdContext( );
// feed the text to cgame
@@ -453,7 +453,7 @@ Draw the editline after a ] prompt
void Con_DrawInput (void) {
int y;
- if ( cls.state != CA_DISCONNECTED && !(cls.keyCatchers & KEYCATCH_CONSOLE ) ) {
+ if ( cls.state != CA_DISCONNECTED && !(Key_GetCatcher( ) & KEYCATCH_CONSOLE ) ) {
return;
}
@@ -594,7 +594,7 @@ void Con_DrawConsole( void ) {
// if disconnected, render console full screen
if ( cls.state == CA_DISCONNECTED ) {
- if ( !( cls.keyCatchers & (KEYCATCH_UI | KEYCATCH_CGAME)) ) {
+ if ( !( Key_GetCatcher( ) & (KEYCATCH_UI | KEYCATCH_CGAME)) ) {
Con_DrawSolidConsole( 1.0 );
return;
}
@@ -604,11 +604,11 @@ void Con_DrawConsole( void ) {
Con_DrawSolidConsole( con.displayFrac );
}
- if( cls.keyCatchers & ( KEYCATCH_UI | KEYCATCH_CGAME ) )
+ if( Key_GetCatcher( ) & ( KEYCATCH_UI | KEYCATCH_CGAME ) )
return;
// draw the chat line
- if( cls.keyCatchers & KEYCATCH_MESSAGE )
+ if( Key_GetCatcher( ) & KEYCATCH_MESSAGE )
{
int skip;
@@ -638,12 +638,8 @@ Scroll it up or down
==================
*/
void Con_RunConsole (void) {
- // Don't allow any key states at all when keycatching
- if ( cls.keyCatchers != 0 )
- Key_ClearStates( );
-
// decide on the destination height of the console
- if ( cls.keyCatchers & KEYCATCH_CONSOLE )
+ if ( Key_GetCatcher( ) & KEYCATCH_CONSOLE )
con.finalFrac = 0.5; // half screen
else
con.finalFrac = 0; // none visible
@@ -697,7 +693,7 @@ void Con_Close( void ) {
return;
}
Field_Clear( &g_consoleField );
- cls.keyCatchers &= ~KEYCATCH_CONSOLE;
+ Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_CONSOLE );
con.finalFrac = 0; // none visible
con.displayFrac = 0;
}
diff --git a/src/client/cl_input.c b/src/client/cl_input.c
index 6faec21c..e5c87f14 100644
--- a/src/client/cl_input.c
+++ b/src/client/cl_input.c
@@ -352,9 +352,9 @@ CL_MouseEvent
=================
*/
void CL_MouseEvent( int dx, int dy, int time ) {
- if ( cls.keyCatchers & KEYCATCH_UI ) {
+ if ( Key_GetCatcher( ) & KEYCATCH_UI ) {
VM_Call( uivm, UI_MOUSE_EVENT, dx, dy );
- } else if (cls.keyCatchers & KEYCATCH_CGAME) {
+ } else if (Key_GetCatcher( ) & KEYCATCH_CGAME) {
VM_Call (cgvm, CG_MOUSE_EVENT, dx, dy);
} else {
cl.mouseDx[cl.mouseIndex] += dx;
@@ -488,13 +488,13 @@ void CL_CmdButtons( usercmd_t *cmd ) {
in_buttons[i].wasPressed = qfalse;
}
- if ( cls.keyCatchers ) {
+ if ( Key_GetCatcher( ) ) {
cmd->buttons |= BUTTON_TALK;
}
// allow the game to know if any key at all is
// currently pressed, even if it isn't bound to anything
- if ( anykeydown && !cls.keyCatchers ) {
+ if ( anykeydown && Key_GetCatcher( ) == 0 ) {
cmd->buttons |= BUTTON_ANY;
}
}
diff --git a/src/client/cl_keys.c b/src/client/cl_keys.c
index e6e8261c..b23247bd 100644
--- a/src/client/cl_keys.c
+++ b/src/client/cl_keys.c
@@ -721,7 +721,7 @@ void Message_Key( int key ) {
if (key == K_ESCAPE) {
- cls.keyCatchers &= ~KEYCATCH_MESSAGE;
+ Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_MESSAGE );
Field_Clear( &chatField );
return;
}
@@ -743,7 +743,7 @@ void Message_Key( int key ) {
CL_AddReliableCommand( buffer );
}
- cls.keyCatchers &= ~KEYCATCH_MESSAGE;
+ Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_MESSAGE );
Field_Clear( &chatField );
return;
}
@@ -1174,7 +1174,8 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
// keys can still be used for bound actions
- if ( down && ( key < 128 || key == K_MOUSE1 ) && ( clc.demoplaying || cls.state == CA_CINEMATIC ) && !cls.keyCatchers) {
+ if ( down && ( key < 128 || key == K_MOUSE1 ) &&
+ ( clc.demoplaying || cls.state == CA_CINEMATIC ) && Key_GetCatcher( ) == 0 ) {
if (Cvar_VariableValue ("com_cameraMode") == 0) {
Cvar_Set ("nextdemo","");
@@ -1185,20 +1186,20 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
// escape is always handled special
if ( key == K_ESCAPE && down ) {
- if ( cls.keyCatchers & KEYCATCH_MESSAGE ) {
+ if ( Key_GetCatcher( ) & KEYCATCH_MESSAGE ) {
// clear message mode
Message_Key( key );
return;
}
// escape always gets out of CGAME stuff
- if (cls.keyCatchers & KEYCATCH_CGAME) {
- cls.keyCatchers &= ~KEYCATCH_CGAME;
+ if (Key_GetCatcher( ) & KEYCATCH_CGAME) {
+ Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_CGAME );
VM_Call (cgvm, CG_EVENT_HANDLING, CGAME_EVENT_NONE);
return;
}
- if ( !( cls.keyCatchers & KEYCATCH_UI ) ) {
+ if ( !( Key_GetCatcher( ) & KEYCATCH_UI ) ) {
if ( cls.state == CA_ACTIVE && !clc.demoplaying ) {
VM_Call( uivm, UI_SET_ACTIVE_MENU, UIMENU_INGAME );
}
@@ -1225,12 +1226,12 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
kb = keys[key].binding;
CL_AddKeyUpCommands( key, kb, time );
+ }
- if ( cls.keyCatchers & KEYCATCH_UI && uivm ) {
- VM_Call( uivm, UI_KEY_EVENT, key, down );
- } else if ( cls.keyCatchers & KEYCATCH_CGAME && cgvm ) {
- VM_Call( cgvm, CG_KEY_EVENT, key, down );
- }
+ if ( Key_GetCatcher( ) & KEYCATCH_UI && uivm ) {
+ VM_Call( uivm, UI_KEY_EVENT, key, down );
+ } else if ( Key_GetCatcher( ) & KEYCATCH_CGAME && cgvm ) {
+ VM_Call( cgvm, CG_KEY_EVENT, key, down );
}
return;
@@ -1238,17 +1239,17 @@ void CL_KeyEvent (int key, qboolean down, unsigned time) {
// distribute the key down event to the apropriate handler
- if ( cls.keyCatchers & KEYCATCH_CONSOLE ) {
+ if ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) {
Console_Key( key );
- } else if ( cls.keyCatchers & KEYCATCH_UI ) {
+ } else if ( Key_GetCatcher( ) & KEYCATCH_UI ) {
if ( uivm ) {
VM_Call( uivm, UI_KEY_EVENT, key, down );
}
- } else if ( cls.keyCatchers & KEYCATCH_CGAME ) {
+ } else if ( Key_GetCatcher( ) & KEYCATCH_CGAME ) {
if ( cgvm ) {
VM_Call( cgvm, CG_KEY_EVENT, key, down );
}
- } else if ( cls.keyCatchers & KEYCATCH_MESSAGE ) {
+ } else if ( Key_GetCatcher( ) & KEYCATCH_MESSAGE ) {
Message_Key( key );
} else if ( cls.state == CA_DISCONNECTED ) {
Console_Key( key );
@@ -1316,15 +1317,15 @@ void CL_CharEvent( int key ) {
}
// distribute the key down event to the apropriate handler
- if ( cls.keyCatchers & KEYCATCH_CONSOLE )
+ if ( Key_GetCatcher( ) & KEYCATCH_CONSOLE )
{
Field_CharEvent( &g_consoleField, key );
}
- else if ( cls.keyCatchers & KEYCATCH_UI )
+ else if ( Key_GetCatcher( ) & KEYCATCH_UI )
{
VM_Call( uivm, UI_KEY_EVENT, key | K_CHAR_FLAG, qtrue );
}
- else if ( cls.keyCatchers & KEYCATCH_MESSAGE )
+ else if ( Key_GetCatcher( ) & KEYCATCH_MESSAGE )
{
Field_CharEvent( &chatField, key );
}
@@ -1382,22 +1383,28 @@ void Key_GetBindingBuf( int keynum, char *buf, int buflen ) {
}
}
+static int keyCatchers = 0;
+
/*
====================
Key_GetCatcher
====================
*/
int Key_GetCatcher( void ) {
- return cls.keyCatchers;
+ return keyCatchers;
}
/*
====================
-Ket_SetCatcher
+Key_SetCatcher
====================
*/
void Key_SetCatcher( int catcher ) {
- cls.keyCatchers = catcher;
+ // If the catcher state is changing, clear all key states
+ if( catcher != keyCatchers )
+ Key_ClearStates( );
+
+ keyCatchers = catcher;
}
// This must not exceed MAX_CMD_LINE
diff --git a/src/client/cl_main.c b/src/client/cl_main.c
index fc73ad47..413a0948 100644
--- a/src/client/cl_main.c
+++ b/src/client/cl_main.c
@@ -653,7 +653,7 @@ Closing the main menu will restart the demo loop
void CL_StartDemoLoop( void ) {
// start the demo loop again
Cbuf_AddText ("d1\n");
- cls.keyCatchers = 0;
+ Key_SetCatcher( 0 );
}
/*
@@ -798,7 +798,7 @@ memory on the hunk from cgame, ui, and renderer
void CL_MapLoading( void ) {
if ( com_dedicated->integer ) {
cls.state = CA_DISCONNECTED;
- cls.keyCatchers = KEYCATCH_CONSOLE;
+ Key_SetCatcher( KEYCATCH_CONSOLE );
return;
}
@@ -807,7 +807,7 @@ void CL_MapLoading( void ) {
}
Con_Close();
- cls.keyCatchers = 0;
+ Key_SetCatcher( 0 );
// if we are already connected to the local host, stay connected
if ( cls.state >= CA_CONNECTED && !Q_stricmp( cls.servername, "localhost" ) ) {
@@ -821,7 +821,7 @@ void CL_MapLoading( void ) {
CL_Disconnect( qtrue );
Q_strncpyz( cls.servername, "localhost", sizeof(cls.servername) );
cls.state = CA_CHALLENGING; // so the connect screen is drawn
- cls.keyCatchers = 0;
+ Key_SetCatcher( 0 );
SCR_UpdateScreen();
clc.connectTime = -RETRANSMIT_TIMEOUT;
NET_StringToAdr( cls.servername, &clc.serverAddress);
@@ -1169,7 +1169,7 @@ void CL_Connect_f( void ) {
cls.state = CA_CONNECTING;
}
- cls.keyCatchers = 0;
+ Key_SetCatcher( 0 );
clc.connectTime = -99999; // CL_CheckForResend() will fire immediately
clc.connectPacketCount = 0;
@@ -2181,7 +2181,7 @@ void CL_Frame ( int msec ) {
}
#endif
- if ( cls.state == CA_DISCONNECTED && !( cls.keyCatchers & KEYCATCH_UI )
+ if ( cls.state == CA_DISCONNECTED && !( Key_GetCatcher( ) & KEYCATCH_UI )
&& !com_sv_running->integer ) {
// if disconnected, bring up the menu
S_StopAllSounds();
@@ -2598,8 +2598,6 @@ CL_Init
====================
*/
void CL_Init( void ) {
- const char *playerName;
-
Com_Printf( "----- Client Initialization -----\n" );
Con_Init ();
@@ -2691,32 +2689,16 @@ void CL_Init( void ) {
cl_guidServerUniq = Cvar_Get ("cl_guidServerUniq", "1", CVAR_ARCHIVE);
// userinfo
- playerName = getenv( "USER" ); // Unixy stuff
- if( playerName == NULL )
- {
- playerName = getenv( "USERNAME" ); // Windows
- if( playerName == NULL )
- {
- playerName = "Newbie"; // Default
- }
- }
- Cvar_Get ("name", playerName, CVAR_USERINFO | CVAR_ARCHIVE );
+ Cvar_Get ("name", Sys_GetCurrentUser( ), CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("snaps", "20", CVAR_USERINFO | CVAR_ARCHIVE );
- Cvar_Get ("model", "sarge", CVAR_USERINFO | CVAR_ARCHIVE );
- Cvar_Get ("headmodel", "sarge", CVAR_USERINFO | CVAR_ARCHIVE );
- Cvar_Get ("team_model", "james", CVAR_USERINFO | CVAR_ARCHIVE );
- Cvar_Get ("team_headmodel", "*james", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("color1", "4", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("color2", "5", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("handicap", "100", CVAR_USERINFO | CVAR_ARCHIVE );
- Cvar_Get ("teamtask", "0", CVAR_USERINFO );
Cvar_Get ("sex", "male", CVAR_USERINFO | CVAR_ARCHIVE );
- Cvar_Get ("cl_anonymous", "0", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("password", "", CVAR_USERINFO);
- Cvar_Get ("cg_predictItems", "1", CVAR_USERINFO | CVAR_ARCHIVE );
// cgame might not be initialized before menu is used
@@ -2820,6 +2802,7 @@ void CL_Shutdown( void ) {
recursive = qfalse;
Com_Memset( &cls, 0, sizeof( cls ) );
+ Key_SetCatcher( 0 );
Com_Printf( "-----------------------\n" );
diff --git a/src/client/cl_scrn.c b/src/client/cl_scrn.c
index f5c6cb9b..25217072 100644
--- a/src/client/cl_scrn.c
+++ b/src/client/cl_scrn.c
@@ -467,7 +467,7 @@ void SCR_DrawScreenField( stereoFrame_t stereoFrame ) {
}
// the menu draws next
- if ( cls.keyCatchers & KEYCATCH_UI && uivm ) {
+ if ( Key_GetCatcher( ) & KEYCATCH_UI && uivm ) {
VM_Call( uivm, UI_REFRESH, cls.realtime );
}
diff --git a/src/client/cl_ui.c b/src/client/cl_ui.c
index 6a4bb16f..8aa4550f 100644
--- a/src/client/cl_ui.c
+++ b/src/client/cl_ui.c
@@ -853,7 +853,8 @@ intptr_t CL_UISystemCalls( intptr_t *args ) {
return Key_GetCatcher();
case UI_KEY_SETCATCHER:
- Key_SetCatcher( args[1] );
+ // Don't allow the ui module to close the console
+ Key_SetCatcher( args[1] | ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) );
return 0;
case UI_GETCLIPBOARDDATA:
@@ -1032,7 +1033,7 @@ CL_ShutdownUI
====================
*/
void CL_ShutdownUI( void ) {
- cls.keyCatchers &= ~KEYCATCH_UI;
+ Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_UI );
cls.uiStarted = qfalse;
if ( !uivm ) {
return;
diff --git a/src/client/client.h b/src/client/client.h
index 12d13f9c..5e68edff 100644
--- a/src/client/client.h
+++ b/src/client/client.h
@@ -270,7 +270,6 @@ typedef struct {
typedef struct {
connstate_t state; // connection status
- int keyCatchers; // bit flags
qboolean cddialog; // bring up the cd needed dialog next frame
@@ -444,6 +443,8 @@ void CL_VerifyCode( void );
float CL_KeyState (kbutton_t *key);
char *Key_KeynumToString (int keynum);
+int Key_GetCatcher( void );
+void Key_SetCatcher( int catcher );
//
// cl_parse.c
diff --git a/src/game/g_client.c b/src/game/g_client.c
index bed2fefd..66ba3b6f 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -944,7 +944,7 @@ if desired.
void ClientUserinfoChanged( int clientNum )
{
gentity_t *ent;
- int teamTask, teamLeader, health;
+ int health;
char *s;
char model[ MAX_QPATH ];
char buffer[ MAX_QPATH ];
@@ -974,14 +974,6 @@ void ClientUserinfoChanged( int clientNum )
if( !strcmp( s, "localhost" ) )
client->pers.localClient = qtrue;
- // check the item prediction
- s = Info_ValueForKey( userinfo, "cg_predictItems" );
-
- if( !atoi( s ) )
- client->pers.predictItemPickup = qfalse;
- else
- client->pers.predictItemPickup = qtrue;
-
// set name
Q_strncpyz( oldname, client->pers.netname, sizeof( oldname ) );
s = Info_ValueForKey( userinfo, "name" );
@@ -1118,16 +1110,11 @@ void ClientUserinfoChanged( int clientNum )
// teamInfo
s = Info_ValueForKey( userinfo, "teamoverlay" );
- if( ! *s || atoi( s ) != 0 )
+ if( !*s || atoi( s ) != 0 )
client->pers.teamInfo = qtrue;
else
client->pers.teamInfo = qfalse;
- // team task (0 = none, 1 = offence, 2 = defence)
- teamTask = atoi( Info_ValueForKey( userinfo, "teamtask" ) );
- // team Leader (1 = leader, 0 is normal player)
- teamLeader = client->sess.teamLeader;
-
// colors
strcpy( c1, Info_ValueForKey( userinfo, "color1" ) );
strcpy( c2, Info_ValueForKey( userinfo, "color2" ) );
@@ -1141,12 +1128,10 @@ void ClientUserinfoChanged( int clientNum )
// print scoreboards, display models, and play custom sounds
Com_sprintf( userinfo, sizeof( userinfo ),
- "n\\%s\\t\\%i\\model\\%s\\hmodel\\%s\\c1\\%s\\c2\\%s\\"
- "hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\"
- "tl\\%d\\ig\\%16s",
- client->pers.netname, team, model, model, c1, c2,
- client->pers.maxHealth, client->sess.wins, client->sess.losses, teamTask,
- teamLeader, BG_ClientListString( &client->sess.ignoreList ) );
+ "n\\%s\\t\\%i\\model\\%s\\c1\\%s\\c2\\%s\\"
+ "hc\\%i\\ig\\%16s",
+ client->pers.netname, team, model, c1, c2,
+ client->pers.maxHealth, BG_ClientListString( &client->sess.ignoreList ) );
trap_SetConfigstring( CS_PLAYERS + clientNum, userinfo );
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 643757aa..54600578 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -322,7 +322,6 @@ typedef struct
usercmd_t cmd; // we would lose angles if not persistant
qboolean localClient; // true if "ip" info key is "localhost"
qboolean initialSpawn; // the first spawn should be at a cool location
- qboolean predictItemPickup; // based on cg_predictItems userinfo
qboolean pmoveFixed; //
char netname[ MAX_NETNAME ];
int maxHealth; // for handicapping
diff --git a/src/qcommon/qcommon.h b/src/qcommon/qcommon.h
index 7e6c40cd..59332068 100644
--- a/src/qcommon/qcommon.h
+++ b/src/qcommon/qcommon.h
@@ -683,10 +683,12 @@ MISC
// vsnprintf is ISO/IEC 9899:1999
// abstracting this to make it portable
-#ifdef WIN32
+#ifdef _WIN32
#define Q_vsnprintf _vsnprintf
+#define Q_snprintf _snprintf
#else
#define Q_vsnprintf vsnprintf
+#define Q_snprintf snprintf
#endif
// returned by Sys_GetProcessorFeatures
diff --git a/src/sdl/sdl_gamma.c b/src/sdl/sdl_gamma.c
index 70e00b25..0b63b85a 100644
--- a/src/sdl/sdl_gamma.c
+++ b/src/sdl/sdl_gamma.c
@@ -48,23 +48,25 @@ void GLimp_SetGamma( unsigned char red[256], unsigned char green[256], unsigned
#include <windows.h>
// Win2K and newer put this odd restriction on gamma ramps...
- OSVERSIONINFO vinfo;
-
- vinfo.dwOSVersionInfoSize = sizeof( vinfo );
- GetVersionEx( &vinfo );
- if( vinfo.dwMajorVersion >= 5 && vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
{
- Com_DPrintf( "performing gamma clamp.\n" );
- for( j = 0 ; j < 3 ; j++ )
+ OSVERSIONINFO vinfo;
+
+ vinfo.dwOSVersionInfoSize = sizeof( vinfo );
+ GetVersionEx( &vinfo );
+ if( vinfo.dwMajorVersion >= 5 && vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
{
- for( i = 0 ; i < 128 ; i++ )
+ Com_DPrintf( "performing gamma clamp.\n" );
+ for( j = 0 ; j < 3 ; j++ )
{
- if( table[ j ] [ i] > ( ( 128 + i ) << 8 ) )
- table[ j ][ i ] = ( 128 + i ) << 8;
- }
+ for( i = 0 ; i < 128 ; i++ )
+ {
+ if( table[ j ] [ i] > ( ( 128 + i ) << 8 ) )
+ table[ j ][ i ] = ( 128 + i ) << 8;
+ }
- if( table[ j ] [127 ] > 254 << 8 )
- table[ j ][ 127 ] = 254 << 8;
+ if( table[ j ] [127 ] > 254 << 8 )
+ table[ j ][ 127 ] = 254 << 8;
+ }
}
}
#endif
diff --git a/src/sdl/sdl_glimp.c b/src/sdl/sdl_glimp.c
index a980b0ed..1f5c3434 100644
--- a/src/sdl/sdl_glimp.c
+++ b/src/sdl/sdl_glimp.c
@@ -115,6 +115,7 @@ static int GLimp_SetMode( int mode, qboolean fullscreen )
int tcolorbits, tdepthbits, tstencilbits;
int i = 0;
SDL_Surface *vidscreen = NULL;
+ Uint32 flags = SDL_OPENGL;
ri.Printf( PRINT_ALL, "Initializing OpenGL display\n");
@@ -127,7 +128,6 @@ static int GLimp_SetMode( int mode, qboolean fullscreen )
}
ri.Printf( PRINT_ALL, " %d %d\n", glConfig.vidWidth, glConfig.vidHeight);
- Uint32 flags = SDL_OPENGL;
if (fullscreen)
{
flags |= SDL_FULLSCREEN;
diff --git a/src/sdl/sdl_input.c b/src/sdl/sdl_input.c
index 6ad660bc..1e2ca988 100644
--- a/src/sdl/sdl_input.c
+++ b/src/sdl/sdl_input.c
@@ -651,7 +651,7 @@ static void IN_ProcessEvents( void )
if( !SDL_WasInit( SDL_INIT_VIDEO ) )
return;
- if( cls.keyCatchers == 0 && keyRepeatEnabled )
+ if( Key_GetCatcher( ) == 0 && keyRepeatEnabled )
{
SDL_EnableKeyRepeat( 0, 0 );
keyRepeatEnabled = qfalse;
@@ -730,7 +730,7 @@ void IN_Frame (void)
IN_JoyMove( );
// Release the mouse if the console if down and we're windowed
- if( ( cls.keyCatchers & KEYCATCH_CONSOLE ) && !r_fullscreen->integer )
+ if( ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) && !r_fullscreen->integer )
IN_DeactivateMouse( );
else
IN_ActivateMouse( );
diff --git a/src/sys/sys_main.c b/src/sys/sys_main.c
index b235c6c0..3f3bd7d5 100644
--- a/src/sys/sys_main.c
+++ b/src/sys/sys_main.c
@@ -463,7 +463,7 @@ void *Sys_LoadDll( const char *name, char *fqpath ,
assert( name );
getcwd(curpath, sizeof(curpath));
- snprintf (fname, sizeof(fname), "%s" ARCH_STRING DLL_EXT, name);
+ Q_snprintf (fname, sizeof(fname), "%s" ARCH_STRING DLL_EXT, name);
// TODO: use fs_searchpaths from files.c
pwdpath = Sys_Cwd();
diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c
index 0af801a0..768008f6 100644
--- a/src/ui/ui_main.c
+++ b/src/ui/ui_main.c
@@ -1612,7 +1612,7 @@ static const char *UI_AIFromName(const char *name) {
return uiInfo.aliasList[j].ai;
}
}
- return "James";
+ return "";
}
static qboolean updateOpponentModel = qtrue;
@@ -3926,7 +3926,7 @@ static void UI_RunMenuScript(char **args) {
UI_BuildServerDisplayList(qtrue);
} else {
Menus_CloseByName("joinserver");
- Menus_OpenByName("main");
+ Menus_ActivateByName("main");
}
} else if (Q_stricmp(name, "StopRefresh") == 0) {
UI_StopServerRefresh();
@@ -6092,7 +6092,7 @@ static cvarTable_t cvarTable[] = {
{ &ui_captureLimit, "ui_captureLimit", "5", 0},
{ &ui_smallFont, "ui_smallFont", "0.2", CVAR_ARCHIVE},
{ &ui_bigFont, "ui_bigFont", "0.5", CVAR_ARCHIVE},
- { &ui_findPlayer, "ui_findPlayer", "Sarge", CVAR_ARCHIVE},
+ { &ui_findPlayer, "ui_findPlayer", "", CVAR_ARCHIVE},
{ &ui_Q3Model, "ui_q3model", "0", CVAR_ARCHIVE},
{ &ui_hudFiles, "cg_hudFiles", "ui/hud.txt", CVAR_ARCHIVE},
{ &ui_recordSPDemo, "ui_recordSPDemo", "0", CVAR_ARCHIVE},
diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c
index 0bb5b748..0a8a3c25 100644
--- a/src/ui/ui_shared.c
+++ b/src/ui/ui_shared.c
@@ -1014,17 +1014,6 @@ menuDef_t *Menus_FindByName(const char *p) {
return NULL;
}
-void Menus_ShowByName(const char *p) {
- menuDef_t *menu = Menus_FindByName(p);
- if (menu) {
- Menus_Activate(menu);
- }
-}
-
-void Menus_OpenByName(const char *p) {
- Menus_ActivateByName(p);
-}
-
static void Menu_RunCloseScript(menuDef_t *menu) {
if (menu && menu->window.flags & WINDOW_VISIBLE && menu->onClose) {
itemDef_t item;
@@ -1033,20 +1022,29 @@ static void Menu_RunCloseScript(menuDef_t *menu) {
}
}
-void Menus_CloseByName(const char *p) {
- menuDef_t *menu = Menus_FindByName(p);
+static void Menus_Close( menuDef_t *menu )
+{
if (menu != NULL) {
Menu_RunCloseScript(menu);
menu->window.flags &= ~(WINDOW_VISIBLE | WINDOW_HASFOCUS);
+
+ openMenuCount--;
+ if( openMenuCount > 0 )
+ Menus_Activate( menuStack[ openMenuCount - 1 ] );
}
}
+void Menus_CloseByName(const char *p) {
+ Menus_Close( Menus_FindByName(p) );
+}
+
void Menus_CloseAll( void ) {
int i;
for (i = 0; i < menuCount; i++) {
- Menu_RunCloseScript(&Menus[i]);
- Menus[i].window.flags &= ~(WINDOW_HASFOCUS | WINDOW_VISIBLE);
+ Menus_Close(&Menus[i]);
}
+
+ openMenuCount = 0;
}
@@ -1083,7 +1081,7 @@ void Script_FadeOut(itemDef_t *item, char **args) {
void Script_Open(itemDef_t *item, char **args) {
const char *name;
if (String_Parse(args, &name)) {
- Menus_OpenByName(name);
+ Menus_ActivateByName(name);
}
}
@@ -1096,9 +1094,9 @@ void Script_ConditionalOpen(itemDef_t *item, char **args) {
if ( String_Parse(args, &cvar) && String_Parse(args, &name1) && String_Parse(args, &name2) ) {
val = DC->getCVarValue( cvar );
if ( val == 0.f ) {
- Menus_OpenByName(name2);
+ Menus_ActivateByName(name2);
} else {
- Menus_OpenByName(name1);
+ Menus_ActivateByName(name1);
}
}
}
@@ -2549,21 +2547,47 @@ static void Display_CloseCinematics( void ) {
}
}
-void Menus_Activate(menuDef_t *menu) {
+void Menus_Activate( menuDef_t *menu )
+{
+ int i;
+ qboolean onTopOfMenuStack = qfalse;
+
+ if( openMenuCount > 0 && menuStack[ openMenuCount - 1 ] == menu )
+ onTopOfMenuStack = qtrue;
+
menu->window.flags |= (WINDOW_HASFOCUS | WINDOW_VISIBLE);
- if (menu->onOpen) {
- itemDef_t item;
- item.parent = menu;
- Item_RunScript(&item, menu->onOpen);
- }
- if (menu->soundName && *menu->soundName) {
-// DC->stopBackgroundTrack(); // you don't want to do this since it will reset s_rawend
- DC->startBackgroundTrack(menu->soundName, menu->soundName);
- }
+ // If being opened for the first time
+ if( !onTopOfMenuStack )
+ {
+ if( menu->onOpen )
+ {
+ itemDef_t item;
+ item.parent = menu;
+ Item_RunScript( &item, menu->onOpen );
+ }
+
+ if( menu->soundName && *menu->soundName )
+ DC->startBackgroundTrack(menu->soundName, menu->soundName);
- Display_CloseCinematics();
+ Display_CloseCinematics( );
+ Menu_HandleMouseMove( menu, DC->cursorx, DC->cursory ); // force the item under the cursor to focus
+
+ for( i = 0; i < menu->itemCount; i++ ) // reset selection in listboxes when opened
+ {
+ if( menu->items[ i ]->type == ITEM_TYPE_LISTBOX )
+ {
+ listBoxDef_t *listPtr = (listBoxDef_t*)menu->items[ i ]->typeData;
+ menu->items[ i ]->cursorPos = 0;
+ listPtr->startPos = 0;
+ DC->feederSelection( menu->items[ i ]->special, 0 );
+ }
+ }
+
+ if( openMenuCount < MAX_OPEN_MENUS )
+ menuStack[ openMenuCount++ ] = menu;
+ }
}
int Display_VisibleMenuCount( void ) {
@@ -2584,14 +2608,12 @@ void Menus_HandleOOBClick(menuDef_t *menu, int key, qboolean down) {
// the cursor is within any of them.. if not close them otherwise activate them and pass the
// key on.. force a mouse move to activate focus and script stuff
if (down && menu->window.flags & WINDOW_OOB_CLICK) {
- Menu_RunCloseScript(menu);
- menu->window.flags &= ~(WINDOW_HASFOCUS | WINDOW_VISIBLE);
+ Menus_Close( menu );
}
for (i = 0; i < menuCount; i++) {
if (Menu_OverActiveItem(&Menus[i], DC->cursorx, DC->cursory)) {
- Menu_RunCloseScript(menu);
- menu->window.flags &= ~(WINDOW_HASFOCUS | WINDOW_VISIBLE);
+ Menus_Close( menu );
Menus_Activate(&Menus[i]);
Menu_HandleMouseMove(&Menus[i], DC->cursorx, DC->cursory);
Menu_HandleKey(&Menus[i], key, down);
@@ -3968,14 +3990,14 @@ void Item_ListBox_Paint(itemDef_t *item) {
x = item->window.rect.x + 1;
y = item->window.rect.y + 1;
for (i = listPtr->startPos; i < count; i++) {
- const char *text;
+ char text[ MAX_STRING_CHARS ];
// always draw at least one
// which may overdraw the box if it is too small for the element
if (listPtr->numColumns > 0) {
int j;
for (j = 0; j < listPtr->numColumns; j++) {
- text = DC->feederItemText(item->special, i, j, &optionalImage);
+ Q_strncpyz( text, DC->feederItemText(item->special, i, j, &optionalImage), sizeof( text ) );
if (optionalImage >= 0) {
DC->drawHandlePic(x + 4 + listPtr->columnInfo[j].pos, y - 1 + listPtr->elementHeight / 2, listPtr->columnInfo[j].width, listPtr->columnInfo[j].width, optionalImage);
} else if (text) {
@@ -3983,6 +4005,13 @@ void Item_ListBox_Paint(itemDef_t *item) {
tw = DC->textWidth( text, item->textscale, 0 );
+ // Shorten the string if it's too long
+ while( tw > listPtr->columnInfo[ j ].width )
+ {
+ text[ strlen( text ) - 1 ] = '\0';
+ tw = DC->textWidth( text, item->textscale, 0 );
+ }
+
switch( listPtr->columnInfo[ j ].align )
{
case ITEM_ALIGN_LEFT:
@@ -4003,11 +4032,11 @@ void Item_ListBox_Paint(itemDef_t *item) {
DC->drawText( x + 4 + listPtr->columnInfo[j].pos + alignOffset, y + listPtr->elementHeight,
item->textscale, item->window.foreColor, text, 0,
- listPtr->columnInfo[j].maxChars, item->textStyle );
+ 0, item->textStyle );
}
}
} else {
- text = DC->feederItemText(item->special, i, 0, &optionalImage);
+ Q_strncpyz( text, DC->feederItemText(item->special, i, 0, &optionalImage), sizeof( text ) );
if (optionalImage >= 0) {
//DC->drawHandlePic(x + 4 + listPtr->elementHeight, y, listPtr->columnInfo[j].width, listPtr->columnInfo[j].width, optionalImage);
} else if (text) {
@@ -4366,35 +4395,25 @@ qboolean Menus_AnyFullScreenVisible( void ) {
}
menuDef_t *Menus_ActivateByName(const char *p) {
- int i, j;
+ int i;
menuDef_t *m = NULL;
- menuDef_t *focus = Menu_GetFocused();
+ // Activate one menu
for (i = 0; i < menuCount; i++) {
if (Q_stricmp(Menus[i].window.name, p) == 0) {
m = &Menus[i];
Menus_Activate(m);
- Menu_HandleMouseMove( m, DC->cursorx, DC->cursory ); // force the item under the cursor to focus
-
- for( j = 0; j < m->itemCount; j++ ) // reset selection in listboxes when opened
- {
- if( m->items[ j ]->type == ITEM_TYPE_LISTBOX )
- {
- listBoxDef_t *listPtr = (listBoxDef_t*)m->items[ j ]->typeData;
- m->items[ j ]->cursorPos = 0;
- listPtr->startPos = 0;
- DC->feederSelection( m->items[ j ]->special, 0 );
- }
- }
+ break;
+ }
+ }
- if (openMenuCount < MAX_OPEN_MENUS && focus != NULL) {
- menuStack[openMenuCount++] = focus;
- }
- } else {
+ // Defocus the others
+ for (i = 0; i < menuCount; i++) {
+ if (Q_stricmp(Menus[i].window.name, p) != 0) {
Menus[i].window.flags &= ~WINDOW_HASFOCUS;
}
}
- Display_CloseCinematics();
+
return m;
}
@@ -4861,16 +4880,14 @@ qboolean ItemParse_columns( itemDef_t *item, int handle ) {
}
listPtr->numColumns = num;
for (i = 0; i < num; i++) {
- int pos, width, maxChars, align;
+ int pos, width, align;
if( PC_Int_Parse( handle, &pos ) &&
PC_Int_Parse( handle, &width ) &&
- PC_Int_Parse( handle, &maxChars ) &&
PC_Int_Parse( handle, &align ) )
{
listPtr->columnInfo[i].pos = pos;
listPtr->columnInfo[i].width = width;
- listPtr->columnInfo[i].maxChars = maxChars;
listPtr->columnInfo[i].align = align;
} else {
return qfalse;
diff --git a/src/ui/ui_shared.h b/src/ui/ui_shared.h
index 81d629b5..2fd396d0 100644
--- a/src/ui/ui_shared.h
+++ b/src/ui/ui_shared.h
@@ -170,7 +170,6 @@ typedef struct {
typedef struct columnInfo_s {
int pos;
int width;
- int maxChars;
int align;
} columnInfo_t;
@@ -420,9 +419,7 @@ void *Display_CaptureItem(int x, int y);
qboolean Display_MouseMove(void *p, int x, int y);
int Display_CursorType(int x, int y);
qboolean Display_KeyBindPending( void );
-void Menus_OpenByName(const char *p);
menuDef_t *Menus_FindByName(const char *p);
-void Menus_ShowByName(const char *p);
void Menus_CloseByName(const char *p);
void Display_HandleKey(int key, qboolean down, int x, int y);
void LerpColor(vec4_t a, vec4_t b, vec4_t c, float t);
diff --git a/ui/createserver.menu b/ui/createserver.menu
index abd93cee..f13bafc0 100644
--- a/ui/createserver.menu
+++ b/ui/createserver.menu
@@ -19,14 +19,12 @@
hide accept_alt;
show accept;
hide back_alt;
- show back;
- hide grpmessage
+ show back
}
onEsc
{
- close createserver;
- open joinserver
+ close createserver
}
itemDef
@@ -108,7 +106,7 @@
outlinecolor 0.1 0.1 0.1 0.5
visible 1
columns 1
- 2 190 25 ITEM_ALIGN_LEFT
+ 2 190 ITEM_ALIGN_LEFT
}
@@ -415,8 +413,7 @@
action
{
play "sound/misc/menu4.wav";
- close createserver;
- open joinserver
+ close createserver
}
mouseEnter
@@ -452,8 +449,7 @@
action
{
play "sound/misc/menu4.wav";
- close createserver;
- open joinserver
+ close createserver
}
}
diff --git a/ui/findplayer.menu b/ui/findplayer.menu
index 82a864a3..f19428f7 100644
--- a/ui/findplayer.menu
+++ b/ui/findplayer.menu
@@ -151,10 +151,10 @@
notselectable
visible 1
columns 4
- 2 40 20 ITEM_ALIGN_LEFT
- 40 40 10 ITEM_ALIGN_LEFT
- 90 40 10 ITEM_ALIGN_LEFT
- 135 40 20 ITEM_ALIGN_LEFT
+ 2 90 ITEM_ALIGN_LEFT
+ 34 40 ITEM_ALIGN_LEFT
+ 66 40 ITEM_ALIGN_LEFT
+ 100 150 ITEM_ALIGN_LEFT
}
itemDef
diff --git a/ui/ingame_game.menu b/ui/ingame_game.menu
index 0200ed95..77931914 100644
--- a/ui/ingame_game.menu
+++ b/ui/ingame_game.menu
@@ -747,2413 +747,9 @@
feeder FEEDER_IGNORE_LIST
visible 0
columns 3
- 2 40 32 ITEM_ALIGN_LEFT
- 150 15 1 ITEM_ALIGN_LEFT
- 190 15 1 ITEM_ALIGN_LEFT
- doubleClick {
- play "sound/misc/menu1.wav";
- uiScript ToggleIgnore
- }
- }
-
- itemDef
- {
- name ignore
- text "Ignore Player"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 60 210 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript IgnorePlayer
- }
- }
-
- itemDef
- {
- name ignore
- text "Stop Ignoring Player"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 190 210 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript UnIgnorePlayer
- }
- }
-
- }
-}
-#include "ui/menudef.h"
-
-{
- \\ INGAME GAME BOX \\
-
- menuDef
- {
- name "ingame_game"
- visible 0
- fullscreen 0
- outOfBoundsClick // this closes the window if it gets a click out of the rectangle
- rect 10 56 292 280
- focusColor 1 .75 0 1
- onopen
- {
- uiScript InitIgnoreList;
- uiScript loadArenas;
- uiScript loadServerInfo;
- hide gameGrp;
- show vote;
- show mapvote;
-
- setitemcolor voteBtn forecolor 0.2 0.2 0.2 1.0;
- setitemcolor ignoreBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor infoBtn forecolor 1.0 1.0 1.0 1.0
- }
-
- itemDef
- {
- name window
- rect 10 5 292 270
- style WINDOW_STYLE_FILLED
- backcolor 0 0 0 1
- visible 1
- decoration
-
- border WINDOW_BORDER_KCGRADIENT
- borderSize 2.0
- borderColor 0.5 0.5 0.5 1
- }
-
- //Section menus
- itemDef
- {
- name voteBtn
- text "Vote"
- group menuGrp
- style WINDOW_STYLE_EMPTY
- rect 35 22 40 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- textscale .35
- forecolor 1 1 1 1
- visible 1
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show vote;
- show mapvote;
-
- setitemcolor infoBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor voteBtn forecolor 0.2 0.2 0.2 1.0;
- setitemcolor ignoreBtn forecolor 1.0 1.0 1.0 1.0
- }
- }
-
- itemDef
- {
- name ignoreBtn
- text "Ignore"
- group menuGrp
- style WINDOW_STYLE_EMPTY
- rect 100 22 40 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- textscale .35
- forecolor 1 1 1 1
- visible 1
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show ignore;
-
- setitemcolor infoBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor voteBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor ignoreBtn forecolor 0.2 0.2 0.2 1.0
- }
- }
-
- itemDef
- {
- name infoBtn
- text "Info"
- group menuGrp
- style WINDOW_STYLE_EMPTY
- rect 165 22 40 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- textscale .35
- forecolor 1 1 1 1
- visible 1
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show info;
-
- setitemcolor infoBtn forecolor 0.2 0.2 0.2 1.0;
- setitemcolor voteBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor ignoreBtn forecolor 1.0 1.0 1.0 1.0
- }
- }
-
-
-//////// INFO
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 55 256 20
- type 4
- style 0
- text "Server Name:"
- cvar ui_serverinfo_hostname
- maxPaintChars 32
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 70 256 20
- type 4
- style 0
- text "Time Limit:"
- maxPaintChars 12
- cvar ui_serverinfo_timelimit
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 85 256 20
- type 4
- style 0
- text "Sudden Death Time:"
- cvar ui_serverinfo_sd
- maxPaintChars 12
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 100 256 20
- type 4
- style 0
- text "Max Clients:"
- cvar ui_serverinfo_maxclients
- maxPaintChars 12
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 115 256 20
- type 4
- style 0
- text "Map Name:"
- cvar ui_serverinfo_mapname
- maxPaintChars 12
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 130 256 20
- type 11
- style 0
- text "Lag Correction:"
- cvar ui_serverinfo_unlagged
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 145 256 20
- type 11
- style 0
- text "Friendly Fire:"
- cvar ui_serverinfo_ff
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 160 256 20
- type 4
- style 0
- text "Version:"
- cvar version
- maxPaintChars 45
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
-//////// VOTE
-
- //Vote menu
- itemDef
- {
- name vote
- text "Map"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 20 60 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show mapvote;
- show vote;
- }
- }
-
- itemDef
- {
- name vote
- text "Players"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 20 85 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show playervote;
- show vote;
- }
- }
-
- itemDef
- {
- name vote
- text "Team"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 20 110 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show teamvote;
- show vote;
- }
- }
-
-///// Map Vote
- itemDef
- {
- name mapvote
- group gameGrp
- style 0
- ownerdraw UI_STARTMAPCINEMATIC
- rect 111 61 80 60
- border 1
- bordercolor .5 .5 .5 .5
- visible 0
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- style WINDOW_STYLE_FILLED
- rect 110 60 82 62
- border 1
- bordercolor .5 .5 .5 .5
- visible 0
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- text ""
- ownerdraw UI_ALLMAPS_SELECTION
- textscale .225
- rect 200 80 110 20
- textalign 0
- textalignx 0
- textaligny 16
- forecolor 1 1 1 1
- decoration
- visible 0
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- rect 110 122 150 85
- type ITEM_TYPE_LISTBOX
- style WINDOW_STYLE_EMPTY
- elementwidth 120
- elementheight 15
- textscale .225
- elementtype LISTBOX_TEXT
- feeder FEEDER_ALLMAPS
- border 1
- bordercolor 0.5 0.5 0.5 0.5
- forecolor 1 1 1 1
- backcolor 0.2 0.2 0.2 1
- outlinecolor 0.1 0.1 0.1 0.5
- visible 0
- doubleclick
- {
- play "sound/misc/menu1.wav";
- uiScript voteMap;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- text "Load Selected Map"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 210 80 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteMap;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- text "Restart Current Map"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 230 90 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- exec "cmd callvote map_restart";
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- text "End Match In Draw"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 250 110 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- exec "cmd callvote draw";
- uiScript closeingame
- }
- }
-
-///// Player Vote
- itemDef
- {
- name playervote
- group gameGrp
- text "Selected Player:"
- ownerdraw UI_PLAYERLIST_SELECTION
- textscale .225
- rect 110 60 110 20
- textalign 0
- textalignx 0
- textaligny 16
- forecolor 1 1 1 1
- decoration
- visible 0
- }
-
- itemDef
- {
- name playervote
- group gameGrp
- rect 110 80 170 85
- style WINDOW_STYLE_EMPTY
- type ITEM_TYPE_LISTBOX
- elementwidth 120
- elementheight 15
- textscale .225
- elementtype LISTBOX_TEXT
- feeder FEEDER_PLAYER_LIST
- border 1
- bordercolor 0.5 0.5 0.5 0.5
- forecolor 1 1 1 1
- backcolor 0.2 0.2 0.2 1
- outlinecolor 0.1 0.1 0.1 0.5
- visible 0
- }
-
- itemDef
- {
- name playervote
- group gameGrp
- text "Kick Selected Player"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 175 90 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteKick;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name playervote
- group gameGrp
- text "Mute Selected Player"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 195 90 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteMute;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name playervote
- group gameGrp
- text "Un-Mute Selected Player"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 215 100 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteUnMute;
- uiScript closeingame
- }
- }
-
-
-///// Team Vote
- itemDef
- {
- name teamvote
- group gameGrp
- text "Selected Teammate:"
- ownerdraw UI_TEAMLIST_SELECTION
- textscale .225
- rect 110 60 110 20
- textalign 0
- textalignx 0
- textaligny 16
- forecolor 1 1 1 1
- decoration
- visible 0
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- rect 110 80 170 85
- style WINDOW_STYLE_EMPTY
- type ITEM_TYPE_LISTBOX
- elementwidth 120
- elementheight 15
- textscale .225
- elementtype LISTBOX_TEXT
- feeder FEEDER_TEAM_LIST
- border 1
- bordercolor 0.5 0.5 0.5 0.5
- forecolor 1 1 1 1
- backcolor 0.2 0.2 0.2 1
- outlinecolor 0.1 0.1 0.1 0.5
- visible 0
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- text "Kick Selected Teammate"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 175 100 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteTeamKick;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- text "Deny Building For Selected Teammate"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 195 150 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteTeamDenyBuild;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- text "Allow Building For Selected Teammate"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 215 150 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteTeamAllowBuild;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- text "Admit Defeat"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 235 150 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- exec "cmd callteamvote admitdefeat";
- uiScript closeingame
- }
- }
-
-//////// IGNORE
- itemDef
- {
- name ignore
- group gameGrp
- rect 45 70 40 5
- text "Player Name"
- visible 0
- type ITEM_TYPE_TEXT
- textscale .225
- }
- itemDef
- {
- name ignore
- group gameGrp
- rect 190 70 40 5
- text "Ignored"
- visible 0
- type ITEM_TYPE_TEXT
- textscale .225
- }
- itemDef
- {
- name ignore
- group gameGrp
- rect 230 70 40 5
- text "Ignoring You"
- visible 0
- type ITEM_TYPE_TEXT
- textscale .225
- }
- itemDef
- {
- name ignore
- group gameGrp
- rect 35 75 240 130
- type ITEM_TYPE_LISTBOX
- style WINDOW_STYLE_EMPTY
- elementwidth 120
- elementheight 16
- textscale .225
- border 1
- bordersize 1
- bordercolor .5 .5 .5 1
- forecolor 1 1 1 1
- backcolor 0.2 0.2 0.2 1
- outlinecolor 0.1 0.1 0.1 0.5
- elementtype LISTBOX_TEXT
- feeder FEEDER_IGNORE_LIST
- visible 0
- columns 3
- 2 40 32 ITEM_ALIGN_LEFT
- 150 15 1 ITEM_ALIGN_LEFT
- 190 15 1 ITEM_ALIGN_LEFT
- doubleClick {
- play "sound/misc/menu1.wav";
- uiScript ToggleIgnore
- }
- }
-
- itemDef
- {
- name ignore
- text "Ignore Player"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 60 210 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript IgnorePlayer
- }
- }
-
- itemDef
- {
- name ignore
- text "Stop Ignoring Player"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 190 210 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript UnIgnorePlayer
- }
- }
-
- }
-}
-#include "ui/menudef.h"
-
-{
- \\ INGAME GAME BOX \\
-
- menuDef
- {
- name "ingame_game"
- visible 0
- fullscreen 0
- outOfBoundsClick // this closes the window if it gets a click out of the rectangle
- rect 10 56 292 280
- focusColor 1 .75 0 1
- onopen
- {
- uiScript InitIgnoreList;
- uiScript loadArenas;
- uiScript loadServerInfo;
- hide gameGrp;
- show vote;
- show mapvote;
-
- setitemcolor voteBtn forecolor 0.2 0.2 0.2 1.0;
- setitemcolor ignoreBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor infoBtn forecolor 1.0 1.0 1.0 1.0
- }
-
- itemDef
- {
- name window
- rect 10 5 292 270
- style WINDOW_STYLE_FILLED
- backcolor 0 0 0 1
- visible 1
- decoration
-
- border WINDOW_BORDER_KCGRADIENT
- borderSize 2.0
- borderColor 0.5 0.5 0.5 1
- }
-
- //Section menus
- itemDef
- {
- name voteBtn
- text "Vote"
- group menuGrp
- style WINDOW_STYLE_EMPTY
- rect 35 22 40 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- textscale .35
- forecolor 1 1 1 1
- visible 1
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show vote;
- show mapvote;
-
- setitemcolor infoBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor voteBtn forecolor 0.2 0.2 0.2 1.0;
- setitemcolor ignoreBtn forecolor 1.0 1.0 1.0 1.0
- }
- }
-
- itemDef
- {
- name ignoreBtn
- text "Ignore"
- group menuGrp
- style WINDOW_STYLE_EMPTY
- rect 100 22 40 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- textscale .35
- forecolor 1 1 1 1
- visible 1
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show ignore;
-
- setitemcolor infoBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor voteBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor ignoreBtn forecolor 0.2 0.2 0.2 1.0
- }
- }
-
- itemDef
- {
- name infoBtn
- text "Info"
- group menuGrp
- style WINDOW_STYLE_EMPTY
- rect 165 22 40 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- textscale .35
- forecolor 1 1 1 1
- visible 1
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show info;
-
- setitemcolor infoBtn forecolor 0.2 0.2 0.2 1.0;
- setitemcolor voteBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor ignoreBtn forecolor 1.0 1.0 1.0 1.0
- }
- }
-
-
-//////// INFO
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 55 256 20
- type 4
- style 0
- text "Server Name:"
- cvar ui_serverinfo_hostname
- maxPaintChars 32
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 70 256 20
- type 4
- style 0
- text "Time Limit:"
- maxPaintChars 12
- cvar ui_serverinfo_timelimit
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 85 256 20
- type 4
- style 0
- text "Sudden Death Time:"
- cvar ui_serverinfo_sd
- maxPaintChars 12
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 100 256 20
- type 4
- style 0
- text "Max Clients:"
- cvar ui_serverinfo_maxclients
- maxPaintChars 12
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 115 256 20
- type 4
- style 0
- text "Map Name:"
- cvar ui_serverinfo_mapname
- maxPaintChars 12
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 130 256 20
- type 11
- style 0
- text "Lag Correction:"
- cvar ui_serverinfo_unlagged
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 145 256 20
- type 11
- style 0
- text "Friendly Fire:"
- cvar ui_serverinfo_ff
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 160 256 20
- type 4
- style 0
- text "Version:"
- cvar version
- maxPaintChars 45
- textalign ITEM_ALIGN_RIGHT
- textaligny 12
- textalignx 75
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
-//////// VOTE
-
- //Vote menu
- itemDef
- {
- name vote
- text "Map"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 20 60 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show mapvote;
- show vote;
- }
- }
-
- itemDef
- {
- name vote
- text "Players"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 20 85 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show playervote;
- show vote;
- }
- }
-
- itemDef
- {
- name vote
- text "Team"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 20 110 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show teamvote;
- show vote;
- }
- }
-
-///// Map Vote
- itemDef
- {
- name mapvote
- group gameGrp
- style 0
- ownerdraw UI_STARTMAPCINEMATIC
- rect 111 61 80 60
- border 1
- bordercolor .5 .5 .5 .5
- visible 0
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- style WINDOW_STYLE_FILLED
- rect 110 60 82 62
- border 1
- bordercolor .5 .5 .5 .5
- visible 0
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- text ""
- ownerdraw UI_ALLMAPS_SELECTION
- textscale .225
- rect 200 80 110 20
- textalign 0
- textalignx 0
- textaligny 16
- forecolor 1 1 1 1
- decoration
- visible 0
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- rect 110 122 150 85
- type ITEM_TYPE_LISTBOX
- style WINDOW_STYLE_EMPTY
- elementwidth 120
- elementheight 15
- textscale .225
- elementtype LISTBOX_TEXT
- feeder FEEDER_ALLMAPS
- border 1
- bordercolor 0.5 0.5 0.5 0.5
- forecolor 1 1 1 1
- backcolor 0.2 0.2 0.2 1
- outlinecolor 0.1 0.1 0.1 0.5
- visible 0
- doubleclick
- {
- play "sound/misc/menu1.wav";
- uiScript voteMap;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- text "Load Selected Map"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 210 80 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteMap;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- text "Restart Current Map"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 230 90 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- exec "cmd callvote map_restart";
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- text "End Match In Draw"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 250 110 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- exec "cmd callvote draw";
- uiScript closeingame
- }
- }
-
-///// Player Vote
- itemDef
- {
- name playervote
- group gameGrp
- text "Selected Player:"
- ownerdraw UI_PLAYERLIST_SELECTION
- textscale .225
- rect 110 60 110 20
- textalign 0
- textalignx 0
- textaligny 16
- forecolor 1 1 1 1
- decoration
- visible 0
- }
-
- itemDef
- {
- name playervote
- group gameGrp
- rect 110 80 170 85
- style WINDOW_STYLE_EMPTY
- type ITEM_TYPE_LISTBOX
- elementwidth 120
- elementheight 15
- textscale .225
- elementtype LISTBOX_TEXT
- feeder FEEDER_PLAYER_LIST
- border 1
- bordercolor 0.5 0.5 0.5 0.5
- forecolor 1 1 1 1
- backcolor 0.2 0.2 0.2 1
- outlinecolor 0.1 0.1 0.1 0.5
- visible 0
- }
-
- itemDef
- {
- name playervote
- group gameGrp
- text "Kick Selected Player"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 175 90 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteKick;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name playervote
- group gameGrp
- text "Mute Selected Player"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 195 90 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteMute;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name playervote
- group gameGrp
- text "Un-Mute Selected Player"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 215 100 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteUnMute;
- uiScript closeingame
- }
- }
-
-
-///// Team Vote
- itemDef
- {
- name teamvote
- group gameGrp
- text "Selected Teammate:"
- ownerdraw UI_TEAMLIST_SELECTION
- textscale .225
- rect 110 60 110 20
- textalign 0
- textalignx 0
- textaligny 16
- forecolor 1 1 1 1
- decoration
- visible 0
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- rect 110 80 170 85
- style WINDOW_STYLE_EMPTY
- type ITEM_TYPE_LISTBOX
- elementwidth 120
- elementheight 15
- textscale .225
- elementtype LISTBOX_TEXT
- feeder FEEDER_TEAM_LIST
- border 1
- bordercolor 0.5 0.5 0.5 0.5
- forecolor 1 1 1 1
- backcolor 0.2 0.2 0.2 1
- outlinecolor 0.1 0.1 0.1 0.5
- visible 0
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- text "Kick Selected Teammate"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 175 100 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteTeamKick;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- text "Deny Building For Selected Teammate"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 195 150 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteTeamDenyBuild;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- text "Allow Building For Selected Teammate"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 215 150 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteTeamAllowBuild;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- text "Admit Defeat"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 235 150 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- exec "cmd callteamvote admitdefeat";
- uiScript closeingame
- }
- }
-
-//////// IGNORE
- itemDef
- {
- name ignore
- group gameGrp
- rect 45 70 40 5
- text "Player Name"
- visible 0
- type ITEM_TYPE_TEXT
- textscale .225
- }
- itemDef
- {
- name ignore
- group gameGrp
- rect 190 70 40 5
- text "Ignored"
- visible 0
- type ITEM_TYPE_TEXT
- textscale .225
- }
- itemDef
- {
- name ignore
- group gameGrp
- rect 230 70 40 5
- text "Ignoring You"
- visible 0
- type ITEM_TYPE_TEXT
- textscale .225
- }
- itemDef
- {
- name ignore
- group gameGrp
- rect 35 75 240 130
- type ITEM_TYPE_LISTBOX
- style WINDOW_STYLE_EMPTY
- elementwidth 120
- elementheight 16
- textscale .225
- border 1
- bordersize 1
- bordercolor .5 .5 .5 1
- forecolor 1 1 1 1
- backcolor 0.2 0.2 0.2 1
- outlinecolor 0.1 0.1 0.1 0.5
- elementtype LISTBOX_TEXT
- feeder FEEDER_IGNORE_LIST
- visible 0
- columns 3
- 2 40 32 ITEM_ALIGN_LEFT
- 150 15 1 ITEM_ALIGN_LEFT
- 190 15 1 ITEM_ALIGN_LEFT
- doubleClick {
- play "sound/misc/menu1.wav";
- uiScript ToggleIgnore
- }
- }
-
- itemDef
- {
- name ignore
- text "Ignore Player"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 60 210 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript IgnorePlayer
- }
- }
-
- itemDef
- {
- name ignore
- text "Stop Ignoring Player"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 190 210 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript UnIgnorePlayer
- }
- }
-
- }
-}
-#include "ui/menudef.h"
-
-{
- \\ INGAME GAME BOX \\
-
- menuDef
- {
- name "ingame_game"
- visible 0
- fullscreen 0
- outOfBoundsClick // this closes the window if it gets a click out of the rectangle
- rect 10 56 292 280
- focusColor 1 .75 0 1
- onopen
- {
- uiScript InitIgnoreList;
- uiScript loadArenas;
- uiScript loadServerInfo;
- hide gameGrp;
- show vote;
- show mapvote;
-
- setitemcolor voteBtn forecolor 0.2 0.2 0.2 1.0;
- setitemcolor ignoreBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor infoBtn forecolor 1.0 1.0 1.0 1.0
- }
-
- itemDef
- {
- name window
- rect 10 5 292 270
- style WINDOW_STYLE_FILLED
- backcolor 0 0 0 1
- visible 1
- decoration
-
- border WINDOW_BORDER_KCGRADIENT
- borderSize 2.0
- borderColor 0.5 0.5 0.5 1
- }
-
- //Section menus
- itemDef
- {
- name voteBtn
- text "Vote"
- group menuGrp
- style WINDOW_STYLE_EMPTY
- rect 35 22 40 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- textscale .35
- forecolor 1 1 1 1
- visible 1
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show vote;
- show mapvote;
-
- setitemcolor infoBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor voteBtn forecolor 0.2 0.2 0.2 1.0;
- setitemcolor ignoreBtn forecolor 1.0 1.0 1.0 1.0
- }
- }
-
- itemDef
- {
- name ignoreBtn
- text "Ignore"
- group menuGrp
- style WINDOW_STYLE_EMPTY
- rect 100 22 40 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- textscale .35
- forecolor 1 1 1 1
- visible 1
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show ignore;
-
- setitemcolor infoBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor voteBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor ignoreBtn forecolor 0.2 0.2 0.2 1.0
- }
- }
-
- itemDef
- {
- name infoBtn
- text "Info"
- group menuGrp
- style WINDOW_STYLE_EMPTY
- rect 165 22 40 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- textscale .35
- forecolor 1 1 1 1
- visible 1
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show info;
-
- setitemcolor infoBtn forecolor 0.2 0.2 0.2 1.0;
- setitemcolor voteBtn forecolor 1.0 1.0 1.0 1.0;
- setitemcolor ignoreBtn forecolor 1.0 1.0 1.0 1.0
- }
- }
-
-
-//////// ABOUT
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 55 256 20
- type 4
- style 0
- text "Server Name:"
- cvar ui_serverinfo_hostname
- maxPaintChars 12
- textalign ITEM_ALIGN_RIGHT
- textalignx 128
- textaligny 12
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 70 256 20
- type 4
- style 0
- text "Time Limit:"
- maxPaintChars 12
- cvar ui_serverinfo_timelimit
- textalign ITEM_ALIGN_RIGHT
- textalignx 128
- textaligny 12
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 85 256 20
- type 4
- style 0
- text "Sudden Death Time:"
- cvar ui_serverinfo_sd
- maxPaintChars 12
- textalign ITEM_ALIGN_RIGHT
- textalignx 128
- textaligny 12
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 100 256 20
- type 4
- style 0
- text "Max Clients:"
- cvar ui_serverinfo_maxclients
- maxPaintChars 12
- textalign ITEM_ALIGN_RIGHT
- textalignx 128
- textaligny 12
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 115 256 20
- type 4
- style 0
- text "Map Name:"
- cvar ui_serverinfo_mapname
- maxPaintChars 12
- textalign ITEM_ALIGN_RIGHT
- textalignx 128
- textaligny 12
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 130 256 20
- type 11
- style 0
- text "Lag Correction:"
- cvar ui_serverinfo_unlagged
- textalign ITEM_ALIGN_RIGHT
- textalignx 128
- textaligny 12
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 145 256 20
- type 11
- style 0
- text "Friendly Fire:"
- cvar ui_serverinfo_ff
- textalign ITEM_ALIGN_RIGHT
- textalignx 128
- textaligny 12
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
- itemDef
- {
- name info
- group gameGrp
- rect 30 160 256 20
- type 4
- style 0
- text "Version:"
- cvar version
- maxPaintChars 45
- textalign ITEM_ALIGN_LEFT
- textalignx 128
- textaligny 12
- textalign 1
- textscale .25
- forecolor 1 1 1 1
- visible 0
- decoration
- }
-
-//////// VOTE
-
- //Vote menu
- itemDef
- {
- name vote
- text "Map"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 20 60 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show mapvote;
- show vote;
- }
- }
-
- itemDef
- {
- name vote
- text "Players"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 20 85 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show playervote;
- show vote;
- }
- }
-
- itemDef
- {
- name vote
- text "Team"
- group gameGrp
- style WINDOW_STYLE_EMPTY
- rect 20 110 64 20
- type ITEM_TYPE_BUTTON
- textalign ITEM_ALIGN_RIGHT
- textalignx 64
- textaligny 16
- textscale .25
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- hide gameGrp;
- show teamvote;
- show vote;
- }
- }
-
-///// Map Vote
- itemDef
- {
- name mapvote
- group gameGrp
- style 0
- ownerdraw UI_STARTMAPCINEMATIC
- rect 111 61 80 60
- border 1
- bordercolor .5 .5 .5 .5
- visible 0
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- style WINDOW_STYLE_FILLED
- rect 110 60 82 62
- border 1
- bordercolor .5 .5 .5 .5
- visible 0
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- text ""
- ownerdraw UI_ALLMAPS_SELECTION
- textscale .225
- rect 200 80 110 20
- textalign 0
- textalignx 0
- textaligny 16
- forecolor 1 1 1 1
- decoration
- visible 0
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- rect 110 122 150 85
- type ITEM_TYPE_LISTBOX
- style WINDOW_STYLE_EMPTY
- elementwidth 120
- elementheight 15
- textscale .225
- elementtype LISTBOX_TEXT
- feeder FEEDER_ALLMAPS
- border 1
- bordercolor 0.5 0.5 0.5 0.5
- forecolor 1 1 1 1
- backcolor 0.2 0.2 0.2 1
- outlinecolor 0.1 0.1 0.1 0.5
- visible 0
- doubleclick
- {
- play "sound/misc/menu1.wav";
- uiScript voteMap;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- text "Load Selected Map"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 210 80 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteMap;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- text "Restart Current Map"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 230 90 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- exec "cmd callvote map_restart";
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name mapvote
- group gameGrp
- text "End Match In Draw"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 250 110 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- exec "cmd callvote draw";
- uiScript closeingame
- }
- }
-
-///// Player Vote
- itemDef
- {
- name playervote
- group gameGrp
- text "Selected Player:"
- ownerdraw UI_PLAYERLIST_SELECTION
- textscale .225
- rect 110 60 110 20
- textalign 0
- textalignx 0
- textaligny 16
- forecolor 1 1 1 1
- decoration
- visible 0
- }
-
- itemDef
- {
- name playervote
- group gameGrp
- rect 110 80 170 85
- style WINDOW_STYLE_EMPTY
- type ITEM_TYPE_LISTBOX
- elementwidth 120
- elementheight 15
- textscale .225
- elementtype LISTBOX_TEXT
- feeder FEEDER_PLAYER_LIST
- border 1
- bordercolor 0.5 0.5 0.5 0.5
- forecolor 1 1 1 1
- backcolor 0.2 0.2 0.2 1
- outlinecolor 0.1 0.1 0.1 0.5
- visible 0
- }
-
- itemDef
- {
- name playervote
- group gameGrp
- text "Kick Selected Player"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 175 90 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteKick;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name playervote
- group gameGrp
- text "Mute Selected Player"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 195 90 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteMute;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name playervote
- group gameGrp
- text "Un-Mute Selected Player"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 215 100 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteUnMute;
- uiScript closeingame
- }
- }
-
-
-///// Team Vote
- itemDef
- {
- name teamvote
- group gameGrp
- text "Selected Teammate:"
- ownerdraw UI_TEAMLIST_SELECTION
- textscale .225
- rect 110 60 110 20
- textalign 0
- textalignx 0
- textaligny 16
- forecolor 1 1 1 1
- decoration
- visible 0
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- rect 110 80 170 85
- style WINDOW_STYLE_EMPTY
- type ITEM_TYPE_LISTBOX
- elementwidth 120
- elementheight 15
- textscale .225
- elementtype LISTBOX_TEXT
- feeder FEEDER_TEAM_LIST
- border 1
- bordercolor 0.5 0.5 0.5 0.5
- forecolor 1 1 1 1
- backcolor 0.2 0.2 0.2 1
- outlinecolor 0.1 0.1 0.1 0.5
- visible 0
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- text "Kick Selected Teammate"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 175 100 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteTeamKick;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- text "Deny Building For Selected Teammate"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 195 150 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteTeamDenyBuild;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- text "Allow Building For Selected Teammate"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 215 150 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- uiScript voteTeamAllowBuild;
- uiScript closeingame
- }
- }
-
- itemDef
- {
- name teamvote
- group gameGrp
- text "Admit Defeat"
- type ITEM_TYPE_BUTTON
- textscale .25
- rect 110 235 150 20
- textalign ITEM_ALIGN_LEFT
- textalignx 5
- textaligny 15
- forecolor 1 1 1 1
- visible 0
- action
- {
- play "sound/misc/menu1.wav";
- exec "cmd callteamvote admitdefeat";
- uiScript closeingame
- }
- }
-
-//////// IGNORE
- itemDef
- {
- name ignore
- group gameGrp
- rect 45 70 40 5
- text "Player Name"
- visible 0
- type ITEM_TYPE_TEXT
- textscale .225
- }
- itemDef
- {
- name ignore
- group gameGrp
- rect 190 70 40 5
- text "Ignored"
- visible 0
- type ITEM_TYPE_TEXT
- textscale .225
- }
- itemDef
- {
- name ignore
- group gameGrp
- rect 230 70 40 5
- text "Ignoring You"
- visible 0
- type ITEM_TYPE_TEXT
- textscale .225
- }
- itemDef
- {
- name ignore
- group gameGrp
- rect 35 75 240 130
- type ITEM_TYPE_LISTBOX
- style WINDOW_STYLE_EMPTY
- elementwidth 120
- elementheight 16
- textscale .225
- border 1
- bordersize 1
- bordercolor .5 .5 .5 1
- forecolor 1 1 1 1
- backcolor 0.2 0.2 0.2 1
- outlinecolor 0.1 0.1 0.1 0.5
- elementtype LISTBOX_TEXT
- feeder FEEDER_IGNORE_LIST
- visible 0
- columns 3
- 2 40 32 ITEM_ALIGN_LEFT
- 150 15 1 ITEM_ALIGN_LEFT
- 190 15 1 ITEM_ALIGN_LEFT
+ 2 40 ITEM_ALIGN_LEFT
+ 150 15 ITEM_ALIGN_LEFT
+ 190 15 ITEM_ALIGN_LEFT
doubleClick {
play "sound/misc/menu1.wav";
uiScript ToggleIgnore
diff --git a/ui/joinserver.menu b/ui/joinserver.menu
index 35439e1c..499348dd 100644
--- a/ui/joinserver.menu
+++ b/ui/joinserver.menu
@@ -20,7 +20,6 @@
show accept;
hide back_alt;
show back;
- hide grpmessage;
uiScript UpdateFilter
}
@@ -295,10 +294,10 @@
outlinecolor 0.1 0.1 0.1 0.5
visible 1
columns 4
- 2 40 80 ITEM_ALIGN_LEFT
- 375 40 20 ITEM_ALIGN_LEFT
- 500 5 10 ITEM_ALIGN_LEFT
- 560 20 20 ITEM_ALIGN_LEFT
+ 2 355 ITEM_ALIGN_LEFT
+ 375 100 ITEM_ALIGN_LEFT
+ 500 40 ITEM_ALIGN_LEFT
+ 560 30 ITEM_ALIGN_LEFT
doubleClick { uiScript JoinServer }
}
@@ -568,7 +567,6 @@
action
{
play "sound/misc/menu1.wav";
- close joinserver;
open createserver
}
}
@@ -586,8 +584,7 @@
action
{
play "sound/misc/menu4.wav";
- close joinserver;
- open main
+ close joinserver
}
mouseEnter
@@ -623,8 +620,7 @@
action
{
play "sound/misc/menu4.wav";
- close joinserver;
- open main
+ close joinserver
}
}
diff --git a/ui/main.menu b/ui/main.menu
index 488fe694..1787dd87 100644
--- a/ui/main.menu
+++ b/ui/main.menu
@@ -74,7 +74,6 @@
action
{
play "sound/misc/menu1.wav";
- close main;
open joinserver
}
}
diff --git a/ui/mod.menu b/ui/mod.menu
index 2f7364a7..bfebebd8 100644
--- a/ui/mod.menu
+++ b/ui/mod.menu
@@ -15,8 +15,7 @@
popup
onEsc
{
- close mod;
- open main
+ close mod
}
onOpen
{
@@ -98,8 +97,7 @@
action
{
play "sound/misc/menu3.wav";
- close mod;
- open main
+ close mod
}
}
}
diff --git a/ui/options.menu b/ui/options.menu
index c6cc01c1..6ce80d57 100644
--- a/ui/options.menu
+++ b/ui/options.menu
@@ -15,8 +15,8 @@
popup
onEsc
{
- close simple_options;
- open main
+ play "sound/misc/menu1.wav";
+ close simple_options
}
itemDef
@@ -264,7 +264,7 @@
action
{
play "sound/misc/menu1.wav";
- close simple_options;
+ close simple_options
}
}
diff --git a/ui/quit.menu b/ui/quit.menu
index 0f953a06..6926b93e 100644
--- a/ui/quit.menu
+++ b/ui/quit.menu
@@ -16,8 +16,7 @@
onESC
{
play "sound/misc/menu1.wav";
- close quit_popmenu;
- open main
+ close quit_popmenu
}
@@ -70,8 +69,6 @@
action
{
play "sound/misc/menu4.wav";
- close main;
- close quit_popmenu;
open quitCredit
}
}
@@ -92,8 +89,7 @@
action
{
play "sound/misc/menu1.wav";
- close quit_popmenu;
- open main
+ close quit_popmenu
}
}
}
diff --git a/ui/serverinfo.menu b/ui/serverinfo.menu
index 32b5a04a..18daf6ae 100644
--- a/ui/serverinfo.menu
+++ b/ui/serverinfo.menu
@@ -17,8 +17,7 @@
onOpen { uiScript ServerStatus }
onESC
{
- close serverinfo_popmenu;
- open joinserver
+ close serverinfo_popmenu
}
itemDef
@@ -69,10 +68,10 @@
notselectable
visible 1
columns 4
- 2 40 20 ITEM_ALIGN_LEFT
- 40 40 10 ITEM_ALIGN_LEFT
- 90 40 10 ITEM_ALIGN_LEFT
- 135 40 20 ITEM_ALIGN_LEFT
+ 2 90 ITEM_ALIGN_LEFT
+ 34 40 ITEM_ALIGN_LEFT
+ 66 40 ITEM_ALIGN_LEFT
+ 100 150 ITEM_ALIGN_LEFT
}
itemDef
@@ -110,8 +109,7 @@
action
{
play "sound/misc/menu1.wav";
- close serverinfo_popmenu;
- open joinserver
+ close serverinfo_popmenu
}
}
diff --git a/ui/teamscore.menu b/ui/teamscore.menu
index a0dad012..98eb5bc2 100644
--- a/ui/teamscore.menu
+++ b/ui/teamscore.menu
@@ -191,13 +191,13 @@
feeder FEEDER_ALIENTEAM_LIST
notselectable
columns 7
- 5 15 1 ITEM_ALIGN_LEFT
- 21 15 1 ITEM_ALIGN_LEFT
- 7 30 5 ITEM_ALIGN_LEFT
- 45 100 24 ITEM_ALIGN_LEFT
- 172 20 4 ITEM_ALIGN_RIGHT
- 209 20 4 ITEM_ALIGN_RIGHT
- 247 20 4 ITEM_ALIGN_RIGHT
+ 5 15 ITEM_ALIGN_LEFT
+ 21 15 ITEM_ALIGN_LEFT
+ 7 30 ITEM_ALIGN_LEFT
+ 45 100 ITEM_ALIGN_LEFT
+ 172 20 ITEM_ALIGN_RIGHT
+ 209 20 ITEM_ALIGN_RIGHT
+ 247 20 ITEM_ALIGN_RIGHT
}
itemDef
@@ -214,13 +214,13 @@
feeder FEEDER_HUMANTEAM_LIST
notselectable
columns 7
- 5 15 1 ITEM_ALIGN_LEFT
- 21 15 1 ITEM_ALIGN_LEFT
- 7 30 5 ITEM_ALIGN_LEFT
- 45 100 24 ITEM_ALIGN_LEFT
- 172 20 4 ITEM_ALIGN_RIGHT
- 209 20 4 ITEM_ALIGN_RIGHT
- 247 20 4 ITEM_ALIGN_RIGHT
+ 5 15 ITEM_ALIGN_LEFT
+ 21 15 ITEM_ALIGN_LEFT
+ 7 30 ITEM_ALIGN_LEFT
+ 45 100 ITEM_ALIGN_LEFT
+ 172 20 ITEM_ALIGN_RIGHT
+ 209 20 ITEM_ALIGN_RIGHT
+ 247 20 ITEM_ALIGN_RIGHT
}