Index: cg_servercmds.c =================================================================== --- cg_servercmds.c (revision 755) +++ cg_servercmds.c (working copy) @@ -591,170 +591,182 @@ case MN_H_ARMOURY: trap_SendConsoleCommand( "menu tremulous_humanarmoury\n" ); break; case MN_A_TEAMFULL: - trap_Cvar_Set( "ui_dialog", "The alien team has too many players. Please wait until " + switch( cg_disableWarningDialogs.integer ) + { + case 0: + trap_Cvar_Set( "ui_dialog", "The alien team has too many players. Please wait until " "slots become available or join the human team." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "The alien team has too many players\n" );break; + } break; case MN_H_TEAMFULL: - trap_Cvar_Set( "ui_dialog", "The human team has too many players. Please wait until " + switch( cg_disableWarningDialogs.integer ) + { + case 0: + trap_Cvar_Set( "ui_dialog", "The human team has too many players. Please wait until " "slots become available or join the alien team." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );break; + case 1: + CG_Printf( "The human team has too many players\n" );break; + } break; case MN_H_NOROOM: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "There is no room to build here. Move until the buildable turns " "translucent green indicating a valid build location." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );break; + case 1: + CG_Printf( "There is no room to build here\n" );break; } - else - CG_Printf( "There is no room to build here\n" ); - break; case MN_H_NOPOWER: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "There is no power remaining. Free up power by destroying existing " "buildable objects." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );break; + case 1: + CG_Printf( "There is no power remaining\n" );break; } - else - CG_Printf( "There is no power remaining\n" ); - break; case MN_H_NOTPOWERED: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "This buildable is not powered. Build a Reactor and/or Repeater in " "order to power it." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );break; + case 1: + CG_Printf( "This buildable is not powered\n" );break; } - else - CG_Printf( "This buildable is not powered\n" ); - break; case MN_H_NORMAL: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "Cannot build on this surface. The surface is too steep or unsuitable " "to build on. Please choose another site for this structure." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );break; + case 1: + CG_Printf( "Cannot build on this surface\n" );break; } - else - CG_Printf( "Cannot build on this surface\n" ); - break; case MN_H_REACTOR: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "There can only be one Reactor. Destroy the existing one if you " "wish to move it." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );break; + case 1: + CG_Printf( "There can only be one Reactor\n" );break; } - else - CG_Printf( "There can only be one Reactor\n" ); - break; case MN_H_REPEATER: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "There is no power here. If available, a Repeater may be used to " "transmit power to this location." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );break; + case 1: + CG_Printf( "There is no power here\n" );break; } - else - CG_Printf( "There is no power here\n" ); - break; case MN_H_NODCC: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "There is no Defense Computer. A Defense Computer is needed to build " "this." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );break; + case 1: + CG_Printf( "There is no Defense Computer\n" );break; } - else - CG_Printf( "There is no Defense Computer\n" ); - break; case MN_H_TNODEWARN: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "WARNING: This Telenode will not be powered. Build near a power " "structure to prevent seeing this message again." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );break; + case 1: + CG_Printf( "This Telenode will not be powered\n" );break; } - else - CG_Printf( "This Telenode will not be powered\n" ); - break; case MN_H_RPTWARN: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "WARNING: This Repeater will not be powered as there is no parent " "Reactor providing power. Build a Reactor." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );break; + case 1: + CG_Printf( "This Repeater will not be powered\n" );break; } - else - CG_Printf( "This Repeater will not be powered\n" ); - break; case MN_H_RPTWARN2: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "This area already has power. A Repeater is not required here." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );break; + case 1: + CG_Printf( "This area already has power\n" );break; } - else - CG_Printf( "This area already has power\n" ); - break; case MN_H_NOSLOTS: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "You have no room to carry this. Please sell any conflicting " "upgrades before purchasing this item." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );break; + case 1: + CG_Printf( "You have no room to carry this\n" );break; } - else - CG_Printf( "You have no room to carry this\n" ); - break; case MN_H_NOFUNDS: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "Insufficient funds. You do not have enough credits to perform this " "action." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );break; + case 1: + CG_Printf( "Insufficient funds\n" );break; } - else - CG_Printf( "Insufficient funds\n" ); - break; case MN_H_ITEMHELD: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "You already hold this item. It is not possible to carry multiple items " "of the same type." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" );break; + case 1: + CG_Printf( "You already hold this item\n" );break; } - else - CG_Printf( "You already hold this item\n" ); - break; @@ -762,172 +774,172 @@ case MN_A_NOROOM: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "There is no room to build here. Move until the structure turns " "translucent green indicating a valid build location." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "There is no room to build here\n" );break; } - else - CG_Printf( "There is no room to build here\n" ); - break; case MN_A_NOCREEP: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "There is no creep here. You must build near existing Eggs or " "the Overmind. Alien structures will not support themselves." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "There is no creep here\n" );break; } - else - CG_Printf( "There is no creep here\n" ); - break; case MN_A_NOOVMND: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "There is no Overmind. An Overmind must be built to control " "the structure you tried to place" ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "There is no Overmind\n" );break; } - else - CG_Printf( "There is no Overmind\n" ); - break; case MN_A_OVERMIND: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "There can only be one Overmind. Destroy the existing one if you " "wish to move it." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "There can only be one Overmind\n" );break; } - else - CG_Printf( "There can only be one Overmind\n" ); - break; case MN_A_HOVEL: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "There can only be one Hovel. Destroy the existing one if you " "wish to move it." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "There can only be one Hovel\n" );break; } - else - CG_Printf( "There can only be one Hovel\n" ); - break; case MN_A_NOASSERT: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "The Overmind cannot control any more structures. Destroy existing " "structures to build more." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "The Overmind cannot control any more structures\n" );break; } - else - CG_Printf( "The Overmind cannot control any more structures\n" ); - break; case MN_A_SPWNWARN: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "WARNING: This spawn will not be controlled by an Overmind. " "Build an Overmind to prevent seeing this message again." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "This spawn will not be controlled by an Overmind\n" );break; } - else - CG_Printf( "This spawn will not be controlled by an Overmind\n" ); - break; case MN_A_NORMAL: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "Cannot build on this surface. This surface is too steep or unsuitable " "to build on. Please choose another site for this structure." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "Cannot build on this surface\n" );break; } - else - CG_Printf( "Cannot build on this surface\n" ); - break; case MN_A_NOEROOM: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "There is no room to evolve here. Move away from walls or other " "nearby objects and try again." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "There is no room to evolve here\n" );break; } - else - CG_Printf( "There is no room to evolve here\n" ); - break; case MN_A_TOOCLOSE: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "This location is too close to the enemy to evolve. " "Move away until you are no longer aware of the enemy's " "presence and try again." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "This location is too close to the enemy to evolve\n" );break; } - else - CG_Printf( "This location is too close to the enemy to evolve\n" ); - break; case MN_A_NOOVMND_EVOLVE: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "There is no Overmind. An Overmind must be built to allow " "you to upgrade." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "There is no Overmind\n" );break; } - else - CG_Printf( "There is no Overmind\n" ); - break; case MN_A_HOVEL_OCCUPIED: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "This Hovel is occupied by another builder. Please find or build " "another." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "This Hovel is occupied by another builder\n" );break; } - else - CG_Printf( "This Hovel is occupied by another builder\n" ); - break; case MN_A_HOVEL_BLOCKED: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "The exit to this Hovel is currently blocked. Please wait until it " "becomes clear then try again." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "The exit to this Hovel is currently blocked\n" );break; } - else - CG_Printf( "The exit to this Hovel is currently blocked\n" ); - break; case MN_A_HOVEL_EXIT: - if( !cg_disableWarningDialogs.integer ) + switch( cg_disableWarningDialogs.integer ) { + case 0: trap_Cvar_Set( "ui_dialog", "The exit to this Hovel would always be blocked. Please choose " "a more suitable location." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" );break; + case 1: + CG_Printf( "The exit to this Hovel would always be blocked\n" );break; } - else - CG_Printf( "The exit to this Hovel would always be blocked\n" ); - break; case MN_A_INFEST: