From 4bbce77ae53262a936c35aa726721fc5007bda7b Mon Sep 17 00:00:00 2001 From: NeonKnightOA Date: Fri, 5 Apr 2024 19:02:55 -0300 Subject: [PATCH] Renamed the menu "Advanced Options". Moved items from Skirmish/Create Server. --- code/q3_ui/ui_dmflags.c | 644 ++++++++++++++++++++++++++++++++---- code/q3_ui/ui_local.h | 3 + code/q3_ui/ui_main.c | 6 + code/q3_ui/ui_startserver.c | 624 ---------------------------------- 4 files changed, 584 insertions(+), 693 deletions(-) diff --git a/code/q3_ui/ui_dmflags.c b/code/q3_ui/ui_dmflags.c index 2b728206..40b38875 100644 --- a/code/q3_ui/ui_dmflags.c +++ b/code/q3_ui/ui_dmflags.c @@ -39,15 +39,29 @@ GAME OPTIONS MENU #define DMFLAGS_X_POS 320 -#define ID_BACK 127 +#define ID_BACK 127 #define ID_NO_FALLING 128 #define ID_FIXED_FOV 129 #define ID_NO_FOOTSTEPS 130 -#define ID_INSTANT_WEAPON_CHANGE 131 -#define ID_NO_BUNNY 132 -#define ID_INVIS 133 +#define ID_INSTANT_WEAPON_CHANGE 131 +#define ID_NO_BUNNY 132 +#define ID_INVIS 133 #define ID_LIGHT_VOTING 134 #define ID_NO_SELF_DAMAGE 135 +#define ID_PHYSICS_RULESET 136 +#define ID_GRAPPLING_HOOK 137 +#define ID_NORMAL_WEAPONS_RULESET 138 +#define ID_WEAPON_ARENA_WEAPON 139 +#define ID_AWARD_PUSHING_RULE 140 +#define ID_HARVESTER_FROM_BODIES 141 +#define ID_OVERLOAD_OBELISK_HEALTH 142 +#define ID_OVERLOAD_RESPAWN_DELAY 143 +#define ID_ELIM_WEAPONS_RULESET 144 +#define ID_ECTF_ONEWAY_MODE 145 +#define ID_LMS_SCORING_RULE 146 +#define ID_LMS_LIVES 147 +#define ID_DD_CAPTURE_TIME 148 +#define ID_DD_RESPAWN_DELAY 149 typedef struct { @@ -65,20 +79,93 @@ typedef struct { menuradiobutton_s invis; menuradiobutton_s lightVoting; menuradiobutton_s noSelfDamage; - menutext_s bitfield; + menutext_s bitfield; + + // Moved from ui_startserver.c + int gametype; + menulist_s pmove; + menuradiobutton_s grapple; + menulist_s weaponMode; + menulist_s weaponArenaWeapon; + menulist_s awardPushing; + menuradiobutton_s harvesterFromBodies; + menufield_s overloadObeliskHealth; + menufield_s overloadRespawnDelay; + menulist_s eliminationWeaponMode; + menuradiobutton_s eCTFOneWay; + menulist_s lmsMode; + menufield_s lmsLives; + menufield_s ddCaptureTime; + menufield_s ddRespawnDelay; menubitmap_s back; } dmflagsOptions_t; static dmflagsOptions_t dmflagsOptions_s; +//Elimiantion - LMS mode +static const char *lmsMode_list[] = { + "Round Win + Overtime", + "Round Win Only", + "Kill + Overtime", + "Kill Only", + NULL +}; + +static const char *weaponArenaWeapon_list[] = { + "Gauntlet", + "Machinegun", + "Shotgun", + "Grenade L.", + "Rocket L.", + "Lightning", + "Railgun", + "Plasma Gun", + "BFG", + "Nailgun", + "Chaingun", + "Prox Mine", + NULL +}; + +static const char *weaponMode_list[] = { + "All Weapons (Default)", + "Instantgib", + "Single Weapon Arena", + "Classic Arena", + "All Weapons (Elim.)", + NULL +}; + +static const char *weaponModeElimination_list[] = { + "All Weapons (Elim.)", + "Instantgib", + "Single Weapon Arena", + "Classic Arena", + NULL +}; + +static const char *pmove_list[] = { + "Framerate Dependant", + "Fixed framerate 125Hz", + "Fixed framerate 91Hz", + "Accurate", + NULL +}; + +static const char *awardPushing_list[] = { + "Disabled", + "Last Pusher", + "Last Attacker", + NULL +}; + /* ================= DMFlags_StatusBar ================= */ -static void DMFlags_StatusBar( void *ptr ) -{ +static void DMFlags_StatusBar( void *ptr ) { switch( ((menucommon_s*)ptr)->id ) { case ID_NO_FALLING: UI_DrawString(320, 400, "Players do not take damage when landing from", UI_SMALLFONT|UI_CENTER, colorWhite ); @@ -119,6 +206,156 @@ static void DMFlags_StatusBar( void *ptr ) UI_DrawString(320, 400, "Players get no damage from their own weapons.", UI_SMALLFONT|UI_CENTER, colorWhite ); UI_DrawString(320, 420, "Useful for rocket jump, plasma climb, etc.", UI_SMALLFONT|UI_CENTER, colorWhite ); break; + + case ID_PHYSICS_RULESET: + switch( ((menulist_s*)ptr)->curvalue ) { + case 0: + UI_DrawString( 320, 440, "Physics depends on players' framerates", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "Not all players are equal", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + case 1: + case 2: + UI_DrawString( 320, 440, "Physics are calculated at fixed intervals", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "All players are equal", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + case 3: + UI_DrawString( 320, 440, "Physics are calculated exactly", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "All players are equal", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + default: + UI_DrawString( 320, 440, "Framerate dependent or not", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + } + break; + + case ID_GRAPPLING_HOOK: + UI_DrawString( 320, 440, "Adds the Grappling Hook to", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "the players' spawning inventory.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + + case ID_NORMAL_WEAPONS_RULESET: + switch( ((menulist_s*)ptr)->curvalue ) { + case 1: + UI_DrawString( 320, 440, "Instantgib: All pickups removed.", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "Players spawn with a one-hit-frag Railgun.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + case 2: + UI_DrawString( 320, 440, "Single Weapon Arena: All pickups removed.", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "Players will spawn with a specific weapon.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + case 3: + UI_DrawString( 320, 440, "Classic Arena: No pickups removed. Replaces some", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "weapons and items to match the OG experience.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + case 4: + UI_DrawString( 320, 440, "All Weapons (Elimination): All pickups removed.", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "Players spawn with all weapons and full HP/AP.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + default: + UI_DrawString( 320, 440, "All Weapons (Default): No pickups removed.", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "Players spawn with Gauntlet and Machinegun.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + } + break; + + case ID_WEAPON_ARENA_WEAPON: + UI_DrawString( 320, 440, "In Single Weapon Arena mode, this will", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "be the weapon players will spawn with.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + + case ID_AWARD_PUSHING_RULE: + switch( ((menulist_s*)ptr)->curvalue ) { + case 1: + UI_DrawString( 320, 440, "Last Pusher: If a player is pushed into a level", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "hazard and dies, their pusher scores a point.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + case 2: + UI_DrawString( 320, 440, "Last Attacker: If a player suicides or dies", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "via level hazard, their last attacker scores.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + default: // case 0 + UI_DrawString( 320, 440, "Disabled: If a player dies due to self-damage", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "or level hazard, they lose a point.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + } + break; + + case ID_HARVESTER_FROM_BODIES: + UI_DrawString( 320, 440, "Makes skulls spawn from fragged players", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "rather than a central skull generator.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + + case ID_OVERLOAD_OBELISK_HEALTH: + UI_DrawString( 320, 440, "Specifies the amount of damage taken by", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "an obelisk before it goes down.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + + case ID_OVERLOAD_RESPAWN_DELAY: + UI_DrawString( 320, 440, "Specifies the amount of time between", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "scoring and the start of the next round.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + + case ID_ELIM_WEAPONS_RULESET: + switch( ((menulist_s*)ptr)->curvalue ) { + case 1: + UI_DrawString( 320, 440, "Instantgib: All pickups removed.", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "Players spawn with a one-hit-frag Railgun.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + case 2: + UI_DrawString( 320, 440, "Single Weapon Arena: All pickups removed.", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "Players will spawn with a specific weapon.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + case 3: + UI_DrawString( 320, 440, "Classic Arena: No pickups removed. Replaces some", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "weapons and items to match the OG experience.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + default: + UI_DrawString( 320, 440, "All Weapons (Elimination): All pickups removed.", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "Players spawn with all weapons and full HP/AP.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + } + break; + + case ID_ECTF_ONEWAY_MODE: + UI_DrawString( 320, 440, "Every round, teams switch between attacker and", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "defender roles. Only attackers can capture.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + + case ID_LMS_SCORING_RULE: + switch( ((menulist_s*)ptr)->curvalue ) { + case 1: + UI_DrawString( 320, 440, "Round Win Only Scoring: All surviving players", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "at the end of a round score a point.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + case 2: + UI_DrawString( 320, 440, "Frag+Overtime Scoring: Every frag earns a point.", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "In Overtime, players keep racking up frags.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + case 3: + UI_DrawString( 320, 440, "Frag-Only Scoring: Only frags earn points.", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "It doesn't matter if they survive a round.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + default: + UI_DrawString( 320, 440, "Round+Overtime: Only the last one alive at round", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "end scores. Players are slowly eliminated in OT.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + } + break; + + case ID_LMS_LIVES: + UI_DrawString( 320, 440, "Specifies the amount of lives each player must", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "spend before being eliminated from the round.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + + case ID_DD_CAPTURE_TIME: + UI_DrawString( 320, 440, "Specifies the amount of time both points need", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "to be held in order for a team to score a point.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; + + case ID_DD_RESPAWN_DELAY: + UI_DrawString( 320, 440, "Specifies the amount of time between", UI_CENTER|UI_SMALLFONT, colorWhite ); + UI_DrawString( 320, 460, "scoring and the start of the next round.", UI_CENTER|UI_SMALLFONT, colorWhite ); + break; } } @@ -152,9 +389,22 @@ DMflagsOptions_Event ================= */ static void DMflagsOptions_Event( void* ptr, int notification ) { - int bitfield; - - bitfield = trap_Cvar_VariableValue( "dmflags" ); + int dmFlagsBitfields; + + dmFlagsBitfields = trap_Cvar_VariableValue( "dmflags" ); + dmflagsOptions_s.pmove.curvalue = Com_Clamp(0, 1, trap_Cvar_VariableValue( "ui_advOptionsPmove" )); + dmflagsOptions_s.grapple.curvalue = Com_Clamp(0, 1, trap_Cvar_VariableValue( "g_grapple" )); + dmflagsOptions_s.weaponMode.curvalue = Com_Clamp(0, 1, trap_Cvar_VariableValue( "g_grapple" )); + dmflagsOptions_s.weaponArenaWeapon.curvalue = Com_Clamp(0, 1, trap_Cvar_VariableValue( "g_weaponArenaWeapon" )); + dmflagsOptions_s.awardPushing.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "g_awardPushing" ) ); + dmflagsOptions_s.harvesterFromBodies.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "g_harvesterFromBodies" ) ); + Q_strncpyz( dmflagsOptions_s.overloadObeliskHealth.field.buffer, UI_Cvar_VariableString( "g_obeliskHealth" ), sizeof( dmflagsOptions_s.overloadObeliskHealth.field.buffer ) ); + Q_strncpyz( dmflagsOptions_s.overloadRespawnDelay.field.buffer, UI_Cvar_VariableString( "g_obeliskRespawnDelay" ), sizeof( dmflagsOptions_s.overloadRespawnDelay.field.buffer ) ); + dmflagsOptions_s.oneway.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "elimination_ctf_oneway" ) ); + dmflagsOptions_s.lmsMode.curvalue = Com_Clamp( 0, 3, trap_Cvar_VariableValue("g_lms_mode") ); + Q_strncpyz( dmflagsOptions_s.lmsLives.field.buffer, UI_Cvar_VariableString( "g_lms_lives" ), sizeof( dmflagsOptions_s.lmsLives.field.buffer ) ); + Q_strncpyz( dmflagsOptions_s.ddCaptureTime.field.buffer, UI_Cvar_VariableString( "g_ddCaptureTime" ), sizeof( dmflagsOptions_s.ddCaptureTime.field.buffer ) ); + Q_strncpyz( dmflagsOptions_s.ddRespawnDelay.field.buffer, UI_Cvar_VariableString( "g_ddRespawnDelay" ), sizeof( dmflagsOptions_s.ddRespawnDelay.field.buffer ) ); if( notification != QM_ACTIVATED ) { return; @@ -163,74 +413,184 @@ static void DMflagsOptions_Event( void* ptr, int notification ) { switch( ((menucommon_s*)ptr)->id ) { case ID_NO_FALLING: if ( dmflagsOptions_s.noFalling.curvalue ) { - bitfield |= DF_NO_FALLING; + dmFlagsBitfields |= DF_NO_FALLING; } else { - bitfield &= ~DF_NO_FALLING; + dmFlagsBitfields &= ~DF_NO_FALLING; } - trap_Cvar_SetValue( "dmflags", bitfield ); + trap_Cvar_SetValue( "dmflags", dmFlagsBitfields ); break; case ID_FIXED_FOV: if ( dmflagsOptions_s.fixedFOV.curvalue ) { - bitfield |= DF_FIXED_FOV; + dmFlagsBitfields |= DF_FIXED_FOV; } else { - bitfield &= ~DF_FIXED_FOV; + dmFlagsBitfields &= ~DF_FIXED_FOV; } - trap_Cvar_SetValue( "dmflags", bitfield ); + trap_Cvar_SetValue( "dmflags", dmFlagsBitfields ); break; case ID_NO_FOOTSTEPS: if ( dmflagsOptions_s.noFootsteps.curvalue ) { - bitfield |= DF_NO_FOOTSTEPS; + dmFlagsBitfields |= DF_NO_FOOTSTEPS; } else { - bitfield &= ~DF_NO_FOOTSTEPS; + dmFlagsBitfields &= ~DF_NO_FOOTSTEPS; } - trap_Cvar_SetValue( "dmflags", bitfield ); + trap_Cvar_SetValue( "dmflags", dmFlagsBitfields ); break; case ID_INSTANT_WEAPON_CHANGE: if ( dmflagsOptions_s.instantWeaponChange.curvalue ) { - bitfield |= DF_INSTANT_WEAPON_CHANGE; + dmFlagsBitfields |= DF_INSTANT_WEAPON_CHANGE; } else { - bitfield &= ~DF_INSTANT_WEAPON_CHANGE; + dmFlagsBitfields &= ~DF_INSTANT_WEAPON_CHANGE; } - trap_Cvar_SetValue( "dmflags", bitfield ); + trap_Cvar_SetValue( "dmflags", dmFlagsBitfields ); break; case ID_NO_BUNNY: if ( dmflagsOptions_s.noBunny.curvalue ) { - bitfield |= DF_NO_BUNNY; + dmFlagsBitfields |= DF_NO_BUNNY; } else { - bitfield &= ~DF_NO_BUNNY; + dmFlagsBitfields &= ~DF_NO_BUNNY; } - trap_Cvar_SetValue( "dmflags", bitfield ); + trap_Cvar_SetValue( "dmflags", dmFlagsBitfields ); break; case ID_INVIS: if ( dmflagsOptions_s.invis.curvalue ) { - bitfield |= DF_INVIS; + dmFlagsBitfields |= DF_INVIS; } else { - bitfield &= ~DF_INVIS; + dmFlagsBitfields &= ~DF_INVIS; } - trap_Cvar_SetValue( "dmflags", bitfield ); + trap_Cvar_SetValue( "dmflags", dmFlagsBitfields ); break; case ID_LIGHT_VOTING: if ( dmflagsOptions_s.lightVoting.curvalue ) { - bitfield |= DF_LIGHT_VOTING; + dmFlagsBitfields |= DF_LIGHT_VOTING; } else { - bitfield &= ~DF_LIGHT_VOTING; + dmFlagsBitfields &= ~DF_LIGHT_VOTING; } - trap_Cvar_SetValue( "dmflags", bitfield ); + trap_Cvar_SetValue( "dmflags", dmFlagsBitfields ); break; case ID_NO_SELF_DAMAGE: if ( dmflagsOptions_s.noSelfDamage.curvalue ) { - bitfield |= DF_NO_SELF_DAMAGE; + dmFlagsBitfields |= DF_NO_SELF_DAMAGE; } else { - bitfield &= ~DF_NO_SELF_DAMAGE; + dmFlagsBitfields &= ~DF_NO_SELF_DAMAGE; + } + trap_Cvar_SetValue( "dmflags", dmFlagsBitfields ); + break; + + case ID_PHYSICS_RULESET: + if(trap_Cvar_VariableValue( "pmove_fixed" )) { + dmflagsOptions_s.pmove.curvalue = 1; + } + if(trap_Cvar_VariableValue( "pmove_fixed" ) && trap_Cvar_VariableValue( "pmove_msec" )==11) { + dmflagsOptions_s.pmove.curvalue = 2; + } + if(trap_Cvar_VariableValue( "pmove_float" )) { + dmflagsOptions_s.pmove.curvalue = 3; + } + else { + dmflagsOptions_s.pmove.curvalue = 0; } - trap_Cvar_SetValue( "dmflags", bitfield ); + trap_Cvar_SetValue( "ui_advOptionsPmove", dmflagsOptions_s.pmove.curvalue ); + break; + + case ID_GRAPPLING_HOOK: + trap_Cvar_SetValue( "g_grapple", dmflagsOptions_s.grapple.curvalue ); + break; + + case ID_NORMAL_WEAPONS_RULESET: + // Instantgib mode + if(trap_Cvar_VariableValue("g_instantgib") != 0 && trap_Cvar_VariableValue("g_weaponArena") == 0 && trap_Cvar_VariableValue("g_elimination") == 0 && trap_Cvar_VariableValue("g_classicMode") == 0) { + dmflagsOptions_s.weaponMode.curvalue = 1; + } + // Single Weapon mode + else if(trap_Cvar_VariableValue("g_instantgib") == 0 && trap_Cvar_VariableValue("g_weaponArena") != 0 && trap_Cvar_VariableValue("g_elimination") == 0 && trap_Cvar_VariableValue("g_classicMode") == 0) { + dmflagsOptions_s.weaponMode.curvalue = 2; + } + // Classic mode + else if(trap_Cvar_VariableValue("g_instantgib") == 0 && trap_Cvar_VariableValue("g_weaponArena") == 0 && trap_Cvar_VariableValue("g_elimination") == 0 && trap_Cvar_VariableValue("g_classicMode") != 0) { + dmflagsOptions_s.weaponMode.curvalue = 3; + } + // All Weapons Elimination mode + else if(trap_Cvar_VariableValue("g_instantgib") == 0 && trap_Cvar_VariableValue("g_weaponArena") == 0 && trap_Cvar_VariableValue("g_elimination") != 0 && trap_Cvar_VariableValue("g_classicMode") == 0) { + dmflagsOptions_s.weaponMode.curvalue = 4; + } + // All Weapons Standard mode + else { + dmflagsOptions_s.weaponMode.curvalue = 0; + } + trap_Cvar_SetValue( "ui_advOptionsWeaponRuleset", dmflagsOptions_s.weaponMode.curvalue ); + break; + + case ID_WEAPON_ARENA_WEAPON: + if (trap_Cvar_VariableValue("g_weaponArena") == 0) { + dmflagsOptions_s.weaponArenaWeapon.generic.flags |= QMF_GRAYED; + } + else { + dmflagsOptions_s.weaponArenaWeapon.generic.flags &= ~QMF_GRAYED; + trap_Cvar_SetValue( "g_weaponArenaWeapon", dmflagsOptions_s.weaponArenaWeapon.curvalue ); + } + break; + + case ID_AWARD_PUSHING_RULE: + trap_Cvar_SetValue( "g_grapple", dmflagsOptions_s.awardPushing.curvalue ); + break; + + case ID_HARVESTER_FROM_BODIES: + trap_Cvar_SetValue( "g_harvesterFromBodies", dmflagsOptions_s.harvesterFromBodies.curvalue ); + break; + + case ID_OVERLOAD_OBELISK_HEALTH: + trap_Cvar_SetValue( "g_obeliskHealth", dmflagsOptions_s.overloadObeliskHealth.curvalue ); + break; + + case ID_OVERLOAD_RESPAWN_DELAY: + trap_Cvar_SetValue( "g_obeliskRespawnDelay", dmflagsOptions_s.overloadRespawnDelay.curvalue ); + break; + + case ID_ELIM_WEAPONS_RULESET: + // Instantgib mode + if(trap_Cvar_VariableValue("g_instantgib") != 0 && trap_Cvar_VariableValue("g_weaponArena") == 0 && trap_Cvar_VariableValue("g_classicMode") == 0) { + dmflagsOptions_s.weaponMode.curvalue = 1; + } + // Single Weapon mode + else if(trap_Cvar_VariableValue("g_instantgib") == 0 && trap_Cvar_VariableValue("g_weaponArena") != 0 && trap_Cvar_VariableValue("g_classicMode") == 0) { + dmflagsOptions_s.weaponMode.curvalue = 2; + } + // Classic mode + else if(trap_Cvar_VariableValue("g_instantgib") == 0 && trap_Cvar_VariableValue("g_weaponArena") == 0 && trap_Cvar_VariableValue("g_classicMode") != 0) { + dmflagsOptions_s.weaponMode.curvalue = 3; + } + // All Weapons Elimination mode + else { + dmflagsOptions_s.weaponMode.curvalue = 0; + } + trap_Cvar_SetValue( "ui_advOptionsElimWeaponRuleset", dmflagsOptions_s.weaponMode.curvalue ); + break; + + case ID_ECTF_ONEWAY_MODE: + trap_Cvar_SetValue( "elimination_ctf_oneway", dmflagsOptions_s.eCTFOneWay.curvalue ); + break; + + case ID_LMS_SCORING_RULE: + trap_Cvar_SetValue( "g_lms_mode", dmflagsOptions_s.lmsMode.curvalue ); + break; + + case ID_LMS_LIVES: + trap_Cvar_SetValue( "g_lms_lives", dmflagsOptions_s.lmsLives.curvalue ); + break; + + case ID_DD_CAPTURE_TIME: + trap_Cvar_SetValue( "g_ddCaptureTime", dmflagsOptions_s.ddCaptureTime.curvalue ); + break; + + case ID_DD_RESPAWN_DELAY: + trap_Cvar_SetValue( "g_ddRespawnDelay", dmflagsOptions_s.ddRespawnDelay.curvalue ); break; case ID_BACK: @@ -250,6 +610,7 @@ static void DMflagsOptions_MenuInit( void ) { bitfield = trap_Cvar_VariableValue( "dmflags" ); memset( &dmflagsOptions_s, 0 ,sizeof(dmflagsOptions_t) ); + dmflagsOptions_s.gametype = (int)Com_Clamp( 0, GT_MAX_GAME_TYPE - 1, trap_Cvar_VariableValue( "g_gameType" ) ); UI_DMflagsOptionsMenu_Cache(); @@ -259,7 +620,7 @@ static void DMflagsOptions_MenuInit( void ) { dmflagsOptions_s.banner.generic.type = MTYPE_BTEXT; dmflagsOptions_s.banner.generic.x = 320; dmflagsOptions_s.banner.generic.y = 16; - dmflagsOptions_s.banner.string = "DMFLAGS"; + dmflagsOptions_s.banner.string = "Advanced Options"; dmflagsOptions_s.banner.color = color_white; dmflagsOptions_s.banner.style = UI_CENTER; @@ -279,13 +640,64 @@ static void DMflagsOptions_MenuInit( void ) { dmflagsOptions_s.framer.width = 256; dmflagsOptions_s.framer.height = 334; - dmflagsOptions_s.noFalling.generic.type = MTYPE_RADIOBUTTON; - dmflagsOptions_s.noFalling.generic.name = "No Falling Damage:"; + dmflagsOptions_s.pmove.generic.type = MTYPE_SPINCONTROL; + dmflagsOptions_s.pmove.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; + dmflagsOptions_s.pmove.generic.name = "Physics Ruleset:"; + dmflagsOptions_s.pmove.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.pmove.generic.y = 240 - 7 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.pmove.itemnames = pmove_list; + dmflagsOptions_s.pmove.generic.statusbar = DMFlags_StatusBar; + + dmflagsOptions_s.grapple.generic.type = MTYPE_RADIOBUTTON; + dmflagsOptions_s.grapple.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; + dmflagsOptions_s.grapple.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.grapple.generic.y = 240 - 6 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.grapple.generic.name = "Grappling Hook:"; + dmflagsOptions_s.grapple.generic.statusbar = DMFlags_StatusBar; + + if (UI_IsARoundBasedGametype(dmflagsOptions_s.gametype)) { + dmflagsOptions_s.eliminationWeaponMode.generic.type = MTYPE_SPINCONTROL; + dmflagsOptions_s.eliminationWeaponMode.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; + dmflagsOptions_s.eliminationWeaponMode.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.eliminationWeaponMode.generic.y = 240 - 5 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.eliminationWeaponMode.itemnames = weaponModeElimination_list; + dmflagsOptions_s.eliminationWeaponMode.generic.name = "Weapons Ruleset:"; + dmflagsOptions_s.eliminationWeaponMode.generic.statusbar = DMFlags_StatusBar; + } + else { + dmflagsOptions_s.weaponMode.generic.type = MTYPE_SPINCONTROL; + dmflagsOptions_s.weaponMode.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; + dmflagsOptions_s.weaponMode.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.weaponMode.generic.y = 240 - 5 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.weaponMode.itemnames = weaponMode_list; + dmflagsOptions_s.weaponMode.generic.name = "Weapons Ruleset:"; + dmflagsOptions_s.weaponMode.generic.statusbar = DMFlags_StatusBar; + } + + dmflagsOptions_s.weaponArenaWeapon.generic.type = MTYPE_SPINCONTROL; + dmflagsOptions_s.weaponArenaWeapon.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; + dmflagsOptions_s.weaponArenaWeapon.generic.name = "SWA Mode Weapon:"; + dmflagsOptions_s.weaponArenaWeapon.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.weaponArenaWeapon.generic.y = 240 - 4 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.weaponArenaWeapon.itemnames = weaponArenaWeapon_list; + dmflagsOptions_s.weaponArenaWeapon.generic.statusbar = DMFlags_StatusBar; + + y += BIGCHAR_HEIGHT+2; + dmflagsOptions_s.awardPushing.generic.type = MTYPE_SPINCONTROL; + dmflagsOptions_s.awardPushing.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; + dmflagsOptions_s.awardPushing.generic.name = "Award Pushing Rule:"; + dmflagsOptions_s.awardPushing.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.awardPushing.generic.y = 240 - 3 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.awardPushing.itemnames = awardPushing_list; + dmflagsOptions_s.awardPushing.generic.statusbar = DMFlags_StatusBar; + + dmflagsOptions_s.noFalling.generic.type = MTYPE_RADIOBUTTON; + dmflagsOptions_s.noFalling.generic.name = "No Falling Damage:"; dmflagsOptions_s.noFalling.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; - dmflagsOptions_s.noFalling.generic.callback = DMflagsOptions_Event; - dmflagsOptions_s.noFalling.generic.id = ID_NO_FALLING; - dmflagsOptions_s.noFalling.generic.x = DMFLAGS_X_POS; - dmflagsOptions_s.noFalling.generic.y = 240 - 6.5 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.noFalling.generic.callback = DMflagsOptions_Event; + dmflagsOptions_s.noFalling.generic.id = ID_NO_FALLING; + dmflagsOptions_s.noFalling.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.noFalling.generic.y = 240 - 2 * (BIGCHAR_HEIGHT+2); dmflagsOptions_s.noFalling.generic.statusbar = DMFlags_StatusBar; dmflagsOptions_s.fixedFOV.generic.type = MTYPE_RADIOBUTTON; @@ -293,53 +705,53 @@ static void DMflagsOptions_MenuInit( void ) { dmflagsOptions_s.fixedFOV.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; dmflagsOptions_s.fixedFOV.generic.callback = DMflagsOptions_Event; dmflagsOptions_s.fixedFOV.generic.id = ID_FIXED_FOV; - dmflagsOptions_s.fixedFOV.generic.x = DMFLAGS_X_POS; - dmflagsOptions_s.fixedFOV.generic.y = 240 - 5.5 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.fixedFOV.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.fixedFOV.generic.y = 240 - 1 * (BIGCHAR_HEIGHT+2); dmflagsOptions_s.fixedFOV.generic.statusbar = DMFlags_StatusBar; dmflagsOptions_s.noFootsteps.generic.type = MTYPE_RADIOBUTTON; dmflagsOptions_s.noFootsteps.generic.name = "No Footsteps:"; dmflagsOptions_s.noFootsteps.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; dmflagsOptions_s.noFootsteps.generic.callback = DMflagsOptions_Event; - dmflagsOptions_s.noFootsteps.generic.id = ID_NO_FOOTSTEPS; - dmflagsOptions_s.noFootsteps.generic.x = DMFLAGS_X_POS; - dmflagsOptions_s.noFootsteps.generic.y = 240 - 4.5 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.noFootsteps.generic.id = ID_NO_FOOTSTEPS; + dmflagsOptions_s.noFootsteps.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.noFootsteps.generic.y = 240 - 0 * (BIGCHAR_HEIGHT+2); dmflagsOptions_s.noFootsteps.generic.statusbar = DMFlags_StatusBar; dmflagsOptions_s.instantWeaponChange.generic.type = MTYPE_RADIOBUTTON; dmflagsOptions_s.instantWeaponChange.generic.name = "Instant Weapon Change:"; dmflagsOptions_s.instantWeaponChange.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; dmflagsOptions_s.instantWeaponChange.generic.callback = DMflagsOptions_Event; - dmflagsOptions_s.instantWeaponChange.generic.id = ID_INSTANT_WEAPON_CHANGE; - dmflagsOptions_s.instantWeaponChange.generic.x = DMFLAGS_X_POS; - dmflagsOptions_s.instantWeaponChange.generic.y = 240 - 3.5 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.instantWeaponChange.generic.id = ID_INSTANT_WEAPON_CHANGE; + dmflagsOptions_s.instantWeaponChange.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.instantWeaponChange.generic.y = 240 + 1 * (BIGCHAR_HEIGHT+2); dmflagsOptions_s.instantWeaponChange.generic.statusbar = DMFlags_StatusBar; dmflagsOptions_s.noBunny.generic.type = MTYPE_RADIOBUTTON; dmflagsOptions_s.noBunny.generic.name = "No Strafe Jumping:"; dmflagsOptions_s.noBunny.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; dmflagsOptions_s.noBunny.generic.callback = DMflagsOptions_Event; - dmflagsOptions_s.noBunny.generic.id = ID_NO_BUNNY; - dmflagsOptions_s.noBunny.generic.x = DMFLAGS_X_POS; - dmflagsOptions_s.noBunny.generic.y = 240 - 2.5 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.noBunny.generic.id = ID_NO_BUNNY; + dmflagsOptions_s.noBunny.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.noBunny.generic.y = 240 + 2 * (BIGCHAR_HEIGHT+2); dmflagsOptions_s.noBunny.generic.statusbar = DMFlags_StatusBar; - dmflagsOptions_s.invis.generic.type = MTYPE_RADIOBUTTON; - dmflagsOptions_s.invis.generic.name = "Total Invisibility:"; + dmflagsOptions_s.invis.generic.type = MTYPE_RADIOBUTTON; + dmflagsOptions_s.invis.generic.name = "Total Invisibility:"; dmflagsOptions_s.invis.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; - dmflagsOptions_s.invis.generic.callback = DMflagsOptions_Event; - dmflagsOptions_s.invis.generic.id = ID_INVIS; - dmflagsOptions_s.invis.generic.x = DMFLAGS_X_POS; - dmflagsOptions_s.invis.generic.y = 240 - 1.5 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.invis.generic.callback = DMflagsOptions_Event; + dmflagsOptions_s.invis.generic.id = ID_INVIS; + dmflagsOptions_s.invis.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.invis.generic.y = 240 + 3 * (BIGCHAR_HEIGHT+2); dmflagsOptions_s.invis.generic.statusbar = DMFlags_StatusBar; dmflagsOptions_s.lightVoting.generic.type = MTYPE_RADIOBUTTON; dmflagsOptions_s.lightVoting.generic.name = "Light Voting:"; dmflagsOptions_s.lightVoting.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; dmflagsOptions_s.lightVoting.generic.callback = DMflagsOptions_Event; - dmflagsOptions_s.lightVoting.generic.id = ID_LIGHT_VOTING; - dmflagsOptions_s.lightVoting.generic.x = DMFLAGS_X_POS; - dmflagsOptions_s.lightVoting.generic.y = 240 - 0.5 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.lightVoting.generic.id = ID_LIGHT_VOTING; + dmflagsOptions_s.lightVoting.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.lightVoting.generic.y = 240 + 4 * (BIGCHAR_HEIGHT+2); dmflagsOptions_s.lightVoting.generic.statusbar = DMFlags_StatusBar; dmflagsOptions_s.noSelfDamage.generic.type = MTYPE_RADIOBUTTON; @@ -347,15 +759,82 @@ static void DMflagsOptions_MenuInit( void ) { dmflagsOptions_s.noSelfDamage.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; dmflagsOptions_s.noSelfDamage.generic.callback = DMflagsOptions_Event; dmflagsOptions_s.noSelfDamage.generic.id = ID_NO_SELF_DAMAGE; - dmflagsOptions_s.noSelfDamage.generic.x = DMFLAGS_X_POS; - dmflagsOptions_s.noSelfDamage.generic.y = 240 + 0.5 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.noSelfDamage.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.noSelfDamage.generic.y = 240 + 5 * (BIGCHAR_HEIGHT+2); dmflagsOptions_s.noSelfDamage.generic.statusbar = DMFlags_StatusBar; - dmflagsOptions_s.bitfield.generic.type = MTYPE_TEXT; - dmflagsOptions_s.bitfield.generic.name = "DMFlags:"; - dmflagsOptions_s.bitfield.generic.ownerdraw = DMFlags_DrawBitfield; - dmflagsOptions_s.bitfield.generic.x = DMFLAGS_X_POS; - dmflagsOptions_s.bitfield.generic.y = 240 + 2.5 * (BIGCHAR_HEIGHT+2); + if( dmflagsOptions_s.gametype == GT_HARVESTER) { + dmflagsOptions_s.harvesterFromBodies.generic.type = MTYPE_RADIOBUTTON; + dmflagsOptions_s.harvesterFromBodies.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; + dmflagsOptions_s.harvesterFromBodies.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.harvesterFromBodies.generic.y = 240 + 6 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.harvesterFromBodies.generic.name = "Skulls From Bodies:"; + dmflagsOptions_s.harvesterFromBodies.generic.statusbar = DMFlags_StatusBar; + } + if( dmflagsOptions_s.gametype == GT_OBELISK ) { + dmflagsOptions_s.overloadObeliskHealth.generic.type = MTYPE_FIELD; + dmflagsOptions_s.overloadObeliskHealth.generic.name = "Obelisk Health:"; + dmflagsOptions_s.overloadObeliskHealth.generic.flags = QMF_SMALLFONT; + dmflagsOptions_s.overloadObeliskHealth.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.overloadObeliskHealth.generic.y = 240 + 6 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.overloadObeliskHealth.field.widthInChars = 6; + dmflagsOptions_s.overloadObeliskHealth.field.maxchars = 3; + dmflagsOptions_s.overloadObeliskHealth.generic.statusbar = DMFlags_StatusBar; + + dmflagsOptions_s.overloadRespawnDelay.generic.type = MTYPE_FIELD; + dmflagsOptions_s.overloadRespawnDelay.generic.name = "Obelisk Respawn Time:"; + dmflagsOptions_s.overloadRespawnDelay.generic.flags = QMF_SMALLFONT; + dmflagsOptions_s.overloadRespawnDelay.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.overloadRespawnDelay.generic.y = 240 + 7 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.overloadRespawnDelay.field.widthInChars = 3; + dmflagsOptions_s.overloadRespawnDelay.field.maxchars = 3; + dmflagsOptions_s.overloadRespawnDelay.generic.statusbar = DMFlags_StatusBar; + } + if( dmflagsOptions_s.gametype == GT_CTF_ELIMINATION) { + dmflagsOptions_s.oneway.generic.type = MTYPE_RADIOBUTTON; + dmflagsOptions_s.oneway.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; + dmflagsOptions_s.oneway.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.oneway.generic.y = 240 + 6 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.oneway.generic.name = "Attack vs. Defense:"; + dmflagsOptions_s.oneway.generic.statusbar = DMFlags_StatusBar; + } + if( dmflagsOptions_s.gametype == GT_LMS ) { + dmflagsOptions_s.lmsMode.generic.type = MTYPE_SPINCONTROL; + dmflagsOptions_s.lmsMode.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; + dmflagsOptions_s.lmsMode.generic.name = "Scoring Mode:"; + dmflagsOptions_s.lmsMode.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.lmsMode.generic.y = 240 + 6 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.lmsMode.itemnames = lmsMode_list; + dmflagsOptions_s.lmsMode.generic.statusbar = DMFlags_StatusBar; + + dmflagsOptions_s.lmsLives.generic.type = MTYPE_FIELD; + dmflagsOptions_s.lmsLives.generic.name = "Lives Per Player:"; + dmflagsOptions_s.lmsLives.generic.flags = QMF_SMALLFONT; + dmflagsOptions_s.lmsLives.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.lmsLives.generic.y = 240 + 7 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.lmsLives.field.widthInChars = 3; + dmflagsOptions_s.lmsLives.field.maxchars = 3; + dmflagsOptions_s.lmsLives.generic.statusbar = DMFlags_StatusBar; + } + if( dmflagsOptions_s.gametype == GT_DOUBLE_D ) { + dmflagsOptions_s.ddCaptureTime.generic.type = MTYPE_FIELD; + dmflagsOptions_s.ddCaptureTime.generic.name = "Holding Time:"; + dmflagsOptions_s.ddCaptureTime.generic.flags = QMF_SMALLFONT; + dmflagsOptions_s.ddCaptureTime.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.ddCaptureTime.generic.y = 240 + 6 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.ddCaptureTime.field.widthInChars = 3; + dmflagsOptions_s.ddCaptureTime.field.maxchars = 3; + dmflagsOptions_s.ddCaptureTime.generic.statusbar = DMFlags_StatusBar; + + dmflagsOptions_s.ddRespawnDelay.generic.type = MTYPE_FIELD; + dmflagsOptions_s.ddRespawnDelay.generic.name = "Time Between Rounds:"; + dmflagsOptions_s.ddRespawnDelay.generic.flags = QMF_SMALLFONT; + dmflagsOptions_s.ddRespawnDelay.generic.x = DMFLAGS_X_POS; + dmflagsOptions_s.ddRespawnDelay.generic.y = 240 + 7 * (BIGCHAR_HEIGHT+2); + dmflagsOptions_s.ddRespawnDelay.field.widthInChars = 3; + dmflagsOptions_s.ddRespawnDelay.field.maxchars = 3; + dmflagsOptions_s.ddRespawnDelay.generic.statusbar = DMFlags_StatusBar; + } dmflagsOptions_s.back.generic.type = MTYPE_BITMAP; dmflagsOptions_s.back.generic.name = ART_BACK0; @@ -372,6 +851,16 @@ static void DMflagsOptions_MenuInit( void ) { Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.framel ); Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.framer ); + Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.pmove ); + Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.grapple ); + if (UI_IsARoundBasedGametype(dmflagsOptions_s.gametype)) { + Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.eliminationWeaponMode ); + } + else { + Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.weaponMode ); + } + Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.weaponArenaWeapon ); + Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.awardPushing ); Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.noFalling ); Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.fixedFOV ); Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.noFootsteps ); @@ -379,8 +868,25 @@ static void DMflagsOptions_MenuInit( void ) { Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.noBunny ); Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.invis ); Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.lightVoting ); + if (dmflagsOptions_s.gametype == GT_HARVESTER) { + Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.harvesterFromBodies ); + } + if (dmflagsOptions_s.gametype == GT_OBELISK) { + Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.overloadObeliskHealth ); + Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.overloadRespawnDelay ); + } Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.noSelfDamage ); - Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.bitfield ); + if (dmflagsOptions_s.gametype == GT_CTF_ELIMINATION) { + Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.eCTFOneWay ); + } + if (dmflagsOptions_s.gametype == GT_LMS) { + Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.lmsMode ); + Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.lmsLives ); + } + if (dmflagsOptions_s.gametype == GT_DOUBLE_D) { + Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.ddCaptureTime ); + Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.ddRespawnDelay ); + } Menu_AddItem( &dmflagsOptions_s.menu, &dmflagsOptions_s.back ); diff --git a/code/q3_ui/ui_local.h b/code/q3_ui/ui_local.h index 9ab0a85d..32069c84 100644 --- a/code/q3_ui/ui_local.h +++ b/code/q3_ui/ui_local.h @@ -115,6 +115,9 @@ extern vmCvar_t ui_setupchecked; extern vmCvar_t ui_browserOnlyHumans; extern vmCvar_t ui_developer; extern vmCvar_t ui_browserHidePrivate; +extern vmCvar_t ui_advOptionsPmove; +extern vmCvar_t ui_advOptionsWeaponRuleset; +extern vmCvar_t ui_advOptionsElimWeaponRuleset; // // ui_qmenu.c diff --git a/code/q3_ui/ui_main.c b/code/q3_ui/ui_main.c index 46ebf65b..f74bba94 100644 --- a/code/q3_ui/ui_main.c +++ b/code/q3_ui/ui_main.c @@ -179,6 +179,9 @@ vmCvar_t ui_browserOnlyHumans; vmCvar_t ui_setupchecked; vmCvar_t ui_developer; vmCvar_t ui_browserHidePrivate; +vmCvar_t ui_advOptionsPmove; +vmCvar_t ui_advOptionsWeaponRuleset; +vmCvar_t ui_advOptionsElimWeaponRuleset; // bk001129 - made static to avoid aliasing. static cvarTable_t cvarTable[] = { @@ -276,6 +279,9 @@ static cvarTable_t cvarTable[] = { { &ui_setupchecked, "ui_setupchecked", "0", CVAR_ARCHIVE }, { &ui_developer, "developer", "0", CVAR_CHEAT }, { &ui_browserHidePrivate, "ui_browserHidePrivate", "1", CVAR_ARCHIVE }, + { &ui_advOptionsPmove, "ui_advOptionsPmove", "1", CVAR_ARCHIVE }, + { &ui_advOptionsWeaponRuleset, "ui_advOptionsWeaponRuleset", "1", CVAR_ARCHIVE }, + { &ui_advOptionsElimWeaponRuleset, "ui_advOptionsElimWeaponRuleset", "1", CVAR_ARCHIVE }, { NULL, "g_localTeamPref", "", 0 } }; diff --git a/code/q3_ui/ui_startserver.c b/code/q3_ui/ui_startserver.c index b64534f4..a2119a58 100644 --- a/code/q3_ui/ui_startserver.c +++ b/code/q3_ui/ui_startserver.c @@ -800,11 +800,6 @@ typedef struct { menufield_s timelimit; menufield_s fraglimit; menufield_s capturelimit; - menulist_s pmove; - menuradiobutton_s grapple; - menulist_s weaponMode; - menulist_s weaponArenaWeapon; - menulist_s awardPushing; // Team-based options menuradiobutton_s friendlyfire; @@ -813,23 +808,6 @@ typedef struct { menufield_s eliminationRoundTime; menulist_s eliminationDamage; - // Specific for Harvester - menuradiobutton_s harvesterFromBodies; - - // Specific for Overload - menufield_s overloadRespawnDelay; - - // Specific for CTF Elimination (eCTF) - menuradiobutton_s oneway; - - // Specific for Last Man Standing - menulist_s lmsMode; - menufield_s lmsLives; - - // Specific for Double Domination - menufield_s ddCaptureTime; - menufield_s ddRespawnDelay; - // Multiplayer-only options menufield_s hostname; menuradiobutton_s pure; @@ -879,15 +857,6 @@ static const char *botSkill_list[] = { NULL }; -//Elimiantion - LMS mode -static const char *lmsMode_list[] = { - "Round Win + Overtime", - "Round Win Only", - "Kill + Overtime", - "Kill Only", - NULL -}; - //Elimiantion - LMS mode static const char *eliminationDamage_list[] = { "Only Enemies", @@ -897,54 +866,6 @@ static const char *eliminationDamage_list[] = { NULL }; -static const char *weaponArenaWeapon_list[] = { - "Gauntlet", - "Machinegun", - "Shotgun", - "Grenade L.", - "Rocket L.", - "Lightning", - "Railgun", - "Plasma Gun", - "BFG", - "Nailgun", - "Chaingun", - "Prox Mine", - NULL -}; - -static const char *weaponMode_list[] = { - "All Weapons (Default)", - "Instantgib", - "Single Weapon Arena", - "Classic Arena", - "All Weapons (Elim.)", - NULL -}; - -static const char *weaponModeElimination_list[] = { - "All Weapons (Elim.)", - "Instantgib", - "Single Weapon Arena", - "Classic Arena", - NULL -}; - -static const char *pmove_list[] = { - "Framerate Dependant", - "Fixed framerate 125Hz", - "Fixed framerate 91Hz", - "Accurate", - NULL -}; - -static const char *awardPushing_list[] = { - "Disabled", - "Last Pusher", - "Last Attacker", - NULL -}; - /* ================= BotAlreadySelected @@ -982,11 +903,6 @@ static void ServerOptions_Start( void ) { int timelimit = atoi( s_serveroptions.timelimit.field.buffer ); int fraglimit = atoi( s_serveroptions.fraglimit.field.buffer ); int capturelimit = atoi( s_serveroptions.capturelimit.field.buffer ); - int pmove = s_serveroptions.pmove.curvalue; - int grapple = s_serveroptions.grapple.curvalue; - int weaponMode = s_serveroptions.weaponMode.curvalue; - int weaponArenaWeapon = s_serveroptions.weaponArenaWeapon.curvalue; - int awardPushing = s_serveroptions.awardPushing.curvalue; // Team-based options int friendlyfire = s_serveroptions.friendlyfire.curvalue; @@ -995,20 +911,6 @@ static void ServerOptions_Start( void ) { int eliminationRoundTime = atoi( s_serveroptions.eliminationRoundTime.field.buffer ); int eliminationDamage = s_serveroptions.eliminationDamage.curvalue; - // Specific for Harvester - int harvesterFromBodies = s_serveroptions.harvesterFromBodies.curvalue; - - // Specific for CTF Elimination (eCTF) - int oneway = s_serveroptions.oneway.curvalue; - - // Specific for Last Man Standing - int lmsMode = s_serveroptions.lmsMode.curvalue; - //int lmsLives = atoi( s_serveroptions.lmsLives.field.buffer ); - - // Specific for Double Domination - //int ddCaptureTime = atoi( s_serveroptions.ddCaptureTime.field.buffer ); - //int ddRespawnDelay = atoi( s_serveroptions.ddRespawnDelay.field.buffer ); - // Multiplayer-only options int maxclients; int lan = s_serveroptions.lan.curvalue; @@ -1115,113 +1017,8 @@ static void ServerOptions_Start( void ) { } trap_Cvar_SetValue ("timelimit", Com_Clamp( 0, timelimit, timelimit ) ); trap_Cvar_SetValue( "elimination_roundtime", eliminationRoundTime ); - switch(pmove) { - case 1: - //Fixed framerate 125 Hz - trap_Cvar_SetValue( "pmove_fixed", 1); - trap_Cvar_SetValue( "pmove_msec", 8); - trap_Cvar_SetValue( "pmove_float", 0); - break; - case 2: - //Fixed framerate 91 Hz - trap_Cvar_SetValue( "pmove_fixed", 1); - trap_Cvar_SetValue( "pmove_msec", 11); - trap_Cvar_SetValue( "pmove_float", 0); - break; - case 3: - //Accurate physics - trap_Cvar_SetValue( "pmove_fixed", 0); - trap_Cvar_SetValue( "pmove_float", 1); - break; - default: - //Framerate dependent - trap_Cvar_SetValue( "pmove_fixed", 0); - trap_Cvar_SetValue( "pmove_float", 0); - break; - }; - trap_Cvar_SetValue( "g_grapple", grapple ); - if (UI_IsARoundBasedGametype(s_serveroptions.gametype)) { - switch(weaponMode) { - case 1: - //Instantgib - trap_Cvar_SetValue( "g_instantgib", 1); - trap_Cvar_SetValue( "g_weaponArena", 0); - trap_Cvar_SetValue( "g_elimination", 0); - trap_Cvar_SetValue( "g_classicMode", 0); - break; - case 2: - //Weapon Arena - trap_Cvar_SetValue( "g_instantgib", 0); - trap_Cvar_SetValue( "g_weaponArena", 1); - trap_Cvar_SetValue( "g_elimination", 0); - trap_Cvar_SetValue( "g_classicMode", 0); - break; - case 3: - //"Classic" Arena - trap_Cvar_SetValue( "g_instantgib", 0); - trap_Cvar_SetValue( "g_weaponArena", 0); - trap_Cvar_SetValue( "g_elimination", 0); - trap_Cvar_SetValue( "g_classicMode", 1); - break; - default: - // Default mode for round-based gametypes. - trap_Cvar_SetValue( "g_instantgib", 0); - trap_Cvar_SetValue( "g_weaponArena", 0); - trap_Cvar_SetValue( "g_elimination", 0); - trap_Cvar_SetValue( "g_classicMode", 0); - break; - } - } - else { - switch(weaponMode) { - case 1: - //Instantgib - trap_Cvar_SetValue( "g_instantgib", 1); - trap_Cvar_SetValue( "g_weaponArena", 0); - trap_Cvar_SetValue( "g_elimination", 0); - trap_Cvar_SetValue( "g_classicMode", 0); - break; - case 2: - //Weapon Arena - trap_Cvar_SetValue( "g_instantgib", 0); - trap_Cvar_SetValue( "g_weaponArena", 1); - trap_Cvar_SetValue( "g_elimination", 0); - trap_Cvar_SetValue( "g_classicMode", 0); - break; - case 3: - //"Classic" Arena - trap_Cvar_SetValue( "g_instantgib", 0); - trap_Cvar_SetValue( "g_weaponArena", 0); - trap_Cvar_SetValue( "g_elimination", 0); - trap_Cvar_SetValue( "g_classicMode", 1); - break; - case 4: - //Elimination mode. - trap_Cvar_SetValue( "g_instantgib", 0); - trap_Cvar_SetValue( "g_weaponArena", 0); - trap_Cvar_SetValue( "g_elimination", 1); - trap_Cvar_SetValue( "g_classicMode", 0); - break; - default: - //All Weapons Classic. - trap_Cvar_SetValue( "g_instantgib", 0); - trap_Cvar_SetValue( "g_weaponArena", 0); - trap_Cvar_SetValue( "g_elimination", 0); - trap_Cvar_SetValue( "g_classicMode", 0); - break; - } - } - trap_Cvar_SetValue( "g_weaponArenaWeapon", weaponArenaWeapon ); - trap_Cvar_SetValue( "g_awardPushing", awardPushing ); trap_Cvar_SetValue( "g_friendlyfire", friendlyfire ); trap_Cvar_SetValue( "elimination_selfdamage", eliminationDamage ); - trap_Cvar_SetValue( "g_harvesterFromBodies", harvesterFromBodies ); - trap_Cvar_Set("g_obeliskRespawnDelay", s_serveroptions.overloadRespawnDelay.field.buffer ); - trap_Cvar_SetValue( "elimination_ctf_oneway", oneway ); - trap_Cvar_SetValue( "g_lms_mode", lmsMode); - trap_Cvar_Set("g_lms_lives", s_serveroptions.lmsLives.field.buffer ); - trap_Cvar_Set("g_ddCaptureTime", s_serveroptions.ddCaptureTime.field.buffer ); - trap_Cvar_Set("g_ddRespawnDelay", s_serveroptions.ddRespawnDelay.field.buffer ); trap_Cvar_Set("sv_hostname", s_serveroptions.hostname.field.buffer ); trap_Cvar_SetValue( "sv_maxclients", Com_Clamp( 0, 12, maxclients ) ); trap_Cvar_SetValue( "sv_lanForceRate", lan ); @@ -1457,7 +1254,6 @@ static void ServerOptions_StatusBar_TimeLimit( void* ptr ) { } } - /* ================= ServerOptions_StatusBar_ScoreLimit @@ -1535,136 +1331,6 @@ static void ServerOptions_StatusBar_eliminationRoundTime( void* ptr ) { } } -/* -================= -ServerOptions_StatusBar_Pmove - -Descriptions should have 48 characters or less per line, and there can't be more than two lines. -================= -*/ -static void ServerOptions_StatusBar_Pmove( void* ptr ) { - switch( ((menulist_s*)ptr)->curvalue ) { - case 0: - UI_DrawString( 320, 440, "Physics depends on players' framerates", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "Not all players are equal", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - case 1: - case 2: - UI_DrawString( 320, 440, "Physics are calculated at fixed intervals", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "All players are equal", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - case 3: - UI_DrawString( 320, 440, "Physics are calculated exactly", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "All players are equal", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - default: - UI_DrawString( 320, 440, "Framerate dependent or not", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - } -} - -/* -================= -ServerOptions_StatusBar_Grapple - -Descriptions should have 48 characters or less per line, and there can't be more than two lines. -================= -*/ -static void ServerOptions_StatusBar_Grapple( void* ptr ) { - UI_DrawString( 320, 440, "Adds the Grappling Hook to", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "the players' spawning inventory.", UI_CENTER|UI_SMALLFONT, colorWhite ); -} - -/* -================= -ServerOptions_StatusBar_WeaponMode - -Descriptions should have 48 characters or less per line, and there can't be more than two lines. -================= -*/ -static void ServerOptions_StatusBar_WeaponMode( void* ptr ) { - if (UI_IsARoundBasedGametype(s_serveroptions.gametype)) { - switch( ((menulist_s*)ptr)->curvalue ) { - case 1: - UI_DrawString( 320, 440, "Instantgib: All pickups removed.", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "Players spawn with a one-hit-frag Railgun.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - case 2: - UI_DrawString( 320, 440, "Single Weapon Arena: All pickups removed.", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "Players will spawn with a specific weapon.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - case 3: - UI_DrawString( 320, 440, "Classic Arena: No pickups removed. Replaces some", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "weapons and items to match the OG experience.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - default: - UI_DrawString( 320, 440, "All Weapons (Elimination): All pickups removed.", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "Players spawn with all weapons and full HP/AP.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - } - } - else { - switch( ((menulist_s*)ptr)->curvalue ) { - case 1: - UI_DrawString( 320, 440, "Instantgib: All pickups removed.", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "Players spawn with a one-hit-frag Railgun.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - case 2: - UI_DrawString( 320, 440, "Single Weapon Arena: All pickups removed.", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "Players will spawn with a specific weapon.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - case 3: - UI_DrawString( 320, 440, "Classic Arena: No pickups removed. Replaces some", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "weapons and items to match the OG experience.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - case 4: - UI_DrawString( 320, 440, "All Weapons (Elimination): All pickups removed.", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "Players spawn with all weapons and full HP/AP.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - default: - UI_DrawString( 320, 440, "All Weapons (Default): No pickups removed.", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "Players spawn with Gauntlet and Machinegun.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - } - } -} - -/* -================= -ServerOptions_StatusBar_WeaponArenaWeapon - -Descriptions should have 48 characters or less per line, and there can't be more than two lines. -================= -*/ -static void ServerOptions_StatusBar_WeaponArenaWeapon( void* ptr ) { - UI_DrawString( 320, 440, "In Single Weapon Arena mode, this will", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "be the weapon players will spawn with.", UI_CENTER|UI_SMALLFONT, colorWhite ); -} - -/* -================= -ServerOptions_StatusBar_AwardPushing - -Descriptions should have 48 characters or less per line, and there can't be more than two lines. -================= -*/ -static void ServerOptions_StatusBar_AwardPushing( void* ptr ) { - switch( ((menulist_s*)ptr)->curvalue ) { - case 1: - UI_DrawString( 320, 440, "Last Pusher: If a player is pushed into a level", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "hazard and dies, their pusher scores a point.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - case 2: - UI_DrawString( 320, 440, "Last Attacker: If a player suicides or dies", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "via level hazard, their last attacker scores.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - default: // case 0 - UI_DrawString( 320, 440, "Disabled: If a player dies due to self-damage", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "or level hazard, they lose a point.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - } -} - /* ================= ServerOptions_StatusBar_FriendlyFire @@ -1689,102 +1355,6 @@ static void ServerOptions_StatusBar_eliminationDamage( void* ptr ) { UI_DrawString( 320, 460, "from a team player's own weapons.", UI_CENTER|UI_SMALLFONT, colorWhite ); } -/* -================= -ServerOptions_StatusBar_harvesterFromBodies - -Descriptions should have 48 characters or less per line, and there can't be more than two lines. -================= -*/ -static void ServerOptions_StatusBar_harvesterFromBodies( void* ptr ) { - UI_DrawString( 320, 440, "Makes skulls spawn from fragged players", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "rather than a central skull generator.", UI_CENTER|UI_SMALLFONT, colorWhite ); -} - -/* -================= -ServerOptions_StatusBar_overloadRespawnDelay - -Descriptions should have 48 characters or less per line, and there can't be more than two lines. -================= -*/ -static void ServerOptions_StatusBar_overloadRespawnDelay( void* ptr ) { - UI_DrawString( 320, 440, "Specifies the amount of time between", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "scoring and the start of the next round.", UI_CENTER|UI_SMALLFONT, colorWhite ); -} - -/* -================= -ServerOptions_StatusBar_Oneway - -Descriptions should have 48 characters or less per line, and there can't be more than two lines. -================= -*/ -static void ServerOptions_StatusBar_Oneway( void* ptr ) { - UI_DrawString( 320, 440, "Every round, teams switch between attacker and", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "defender roles. Only attackers can capture.", UI_CENTER|UI_SMALLFONT, colorWhite ); -} - -/* -================= -ServerOptions_StatusBar_lmsMode - -Descriptions should have 48 characters or less per line, and there can't be more than two lines. -================= -*/ -static void ServerOptions_StatusBar_lmsMode( void* ptr ) { - switch( ((menulist_s*)ptr)->curvalue ) { - case 1: - UI_DrawString( 320, 440, "Round Win Only Scoring: All surviving players", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "at the end of a round score a point.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - case 2: - UI_DrawString( 320, 440, "Frag+Overtime Scoring: Every frag earns a point.", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "In Overtime, players keep racking up frags.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - case 3: - UI_DrawString( 320, 440, "Frag-Only Scoring: Only frags earn points.", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "It doesn't matter if they survive a round.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - default: - UI_DrawString( 320, 440, "Round+Overtime: Only the last one alive at round", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "end scores. Players are slowly eliminated in OT.", UI_CENTER|UI_SMALLFONT, colorWhite ); - break; - } -} - -/* -================= -ServerOptions_StatusBar_lmsLives - -Descriptions should have 48 characters or less per line, and there can't be more than two lines. -================= -*/ -static void ServerOptions_StatusBar_lmsLives( void* ptr ) { - UI_DrawString( 320, 440, "Specifies the amount of lives each player must", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "spend before being eliminated from the round.", UI_CENTER|UI_SMALLFONT, colorWhite ); -} - -/* -================= -ServerOptions_StatusBar_ddCaptureTime -================= -*/ -static void ServerOptions_StatusBar_ddCaptureTime( void* ptr ) { - UI_DrawString( 320, 440, "Specifies the amount of time both points need", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "to be held in order for a team to score a point.", UI_CENTER|UI_SMALLFONT, colorWhite ); -} - -/* -================= -ServerOptions_StatusBar_ddRespawnDelay -================= -*/ -static void ServerOptions_StatusBar_ddRespawnDelay( void* ptr ) { - UI_DrawString( 320, 440, "Specifies the amount of time between", UI_CENTER|UI_SMALLFONT, colorWhite ); - UI_DrawString( 320, 460, "scoring and the start of the next round.", UI_CENTER|UI_SMALLFONT, colorWhite ); -} - /* ================= ServerOptions_StatusBar_BotSkill @@ -1843,7 +1413,6 @@ static void ServerOptions_StatusBar_AllowServerDownload( void* ptr ) { UI_DrawString( 320, 460, "custom .pk3, if they activated their D/L option.", UI_CENTER|UI_SMALLFONT, colorWhite ); } - /* =============== ServerOptions_LevelshotDraw @@ -2077,58 +1646,8 @@ static void ServerOptions_SetMenuItems( void ) { break; } - s_serveroptions.pmove.curvalue = 0; - if(trap_Cvar_VariableValue( "pmove_fixed" )) - s_serveroptions.pmove.curvalue = 1; - if(trap_Cvar_VariableValue( "pmove_fixed" ) && trap_Cvar_VariableValue( "pmove_msec" )==11) - s_serveroptions.pmove.curvalue = 2; - if(trap_Cvar_VariableValue( "pmove_float" )) - s_serveroptions.pmove.curvalue = 3; - s_serveroptions.grapple.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "g_grapple" ) ); - // Weapon Rules modes. Only one option can be active at a time. - s_serveroptions.weaponMode.curvalue = 0; - if (UI_IsARoundBasedGametype(s_serveroptions.gametype)) { - // Instantgib mode - if(trap_Cvar_VariableValue("g_instantgib") != 0 && trap_Cvar_VariableValue("g_weaponArena") == 0 && trap_Cvar_VariableValue("g_classicMode") == 0) - s_serveroptions.weaponMode.curvalue = 1; - // Single Weapon mode - else if(trap_Cvar_VariableValue("g_instantgib") == 0 && trap_Cvar_VariableValue("g_weaponArena") != 0 && trap_Cvar_VariableValue("g_classicMode") == 0) - s_serveroptions.weaponMode.curvalue = 2; - // Classic mode - else if(trap_Cvar_VariableValue("g_instantgib") == 0 && trap_Cvar_VariableValue("g_weaponArena") == 0 && trap_Cvar_VariableValue("g_classicMode") != 0) - s_serveroptions.weaponMode.curvalue = 3; - // All Weapons Elimination mode - else - s_serveroptions.weaponMode.curvalue = 0; - } - else { - // Instantgib mode - if(trap_Cvar_VariableValue("g_instantgib") != 0 && trap_Cvar_VariableValue("g_weaponArena") == 0 && trap_Cvar_VariableValue("g_elimination") == 0 && trap_Cvar_VariableValue("g_classicMode") == 0) - s_serveroptions.weaponMode.curvalue = 1; - // Single Weapon mode - else if(trap_Cvar_VariableValue("g_instantgib") == 0 && trap_Cvar_VariableValue("g_weaponArena") != 0 && trap_Cvar_VariableValue("g_elimination") == 0 && trap_Cvar_VariableValue("g_classicMode") == 0) - s_serveroptions.weaponMode.curvalue = 2; - // Classic mode - else if(trap_Cvar_VariableValue("g_instantgib") == 0 && trap_Cvar_VariableValue("g_weaponArena") == 0 && trap_Cvar_VariableValue("g_elimination") == 0 && trap_Cvar_VariableValue("g_classicMode") != 0) - s_serveroptions.weaponMode.curvalue = 3; - // All Weapons Elimination mode - else if(trap_Cvar_VariableValue("g_instantgib") == 0 && trap_Cvar_VariableValue("g_weaponArena") == 0 && trap_Cvar_VariableValue("g_elimination") != 0 && trap_Cvar_VariableValue("g_classicMode") == 0) - s_serveroptions.weaponMode.curvalue = 4; - // All Weapons Standard mode - else - s_serveroptions.weaponMode.curvalue = 0; - } - s_serveroptions.weaponArenaWeapon.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "g_weaponArenaWeapon" ) ); - s_serveroptions.awardPushing.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "g_awardPushing" ) ); Q_strncpyz( s_serveroptions.eliminationRoundTime.field.buffer, UI_Cvar_VariableString( "elimination_roundtime" ), sizeof( s_serveroptions.eliminationRoundTime.field.buffer ) ); s_serveroptions.eliminationDamage.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "elimination_selfdamage" ) ); - s_serveroptions.harvesterFromBodies.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "g_harvesterFromBodies" ) ); - Q_strncpyz( s_serveroptions.overloadRespawnDelay.field.buffer, UI_Cvar_VariableString( "g_obeliskRespawnDelay" ), sizeof( s_serveroptions.overloadRespawnDelay.field.buffer ) ); - s_serveroptions.oneway.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "elimination_ctf_oneway" ) ); - s_serveroptions.lmsMode.curvalue = Com_Clamp( 0, 3, trap_Cvar_VariableValue("g_lms_mode") ); - Q_strncpyz( s_serveroptions.lmsLives.field.buffer, UI_Cvar_VariableString( "g_lms_lives" ), sizeof( s_serveroptions.lmsLives.field.buffer ) ); - Q_strncpyz( s_serveroptions.ddCaptureTime.field.buffer, UI_Cvar_VariableString( "g_ddCaptureTime" ), sizeof( s_serveroptions.ddCaptureTime.field.buffer ) ); - Q_strncpyz( s_serveroptions.ddRespawnDelay.field.buffer, UI_Cvar_VariableString( "g_ddRespawnDelay" ), sizeof( s_serveroptions.ddRespawnDelay.field.buffer ) ); Q_strncpyz( s_serveroptions.hostname.field.buffer, UI_Cvar_VariableString( "sv_hostname" ), sizeof( s_serveroptions.hostname.field.buffer ) ); s_serveroptions.lan.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "sv_lanforcerate" ) ); @@ -2317,57 +1836,6 @@ static void ServerOptions_MenuInit( qboolean multiplayer ) { s_serveroptions.eliminationRoundTime.generic.statusbar = ServerOptions_StatusBar_eliminationRoundTime; } - y += BIGCHAR_HEIGHT+2; - s_serveroptions.pmove.generic.type = MTYPE_SPINCONTROL; - s_serveroptions.pmove.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; - s_serveroptions.pmove.generic.name = "Physics Ruleset:"; - s_serveroptions.pmove.generic.x = OPTIONS_X; - s_serveroptions.pmove.generic.y = y; - s_serveroptions.pmove.itemnames = pmove_list; - s_serveroptions.pmove.generic.statusbar = ServerOptions_StatusBar_Pmove; - - y += BIGCHAR_HEIGHT+2; - s_serveroptions.grapple.generic.type = MTYPE_RADIOBUTTON; - s_serveroptions.grapple.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; - s_serveroptions.grapple.generic.x = OPTIONS_X; - s_serveroptions.grapple.generic.y = y; - s_serveroptions.grapple.generic.name = "Grappling Hook:"; - s_serveroptions.grapple.generic.statusbar = ServerOptions_StatusBar_Grapple; - - //Weapon Mode option - y += BIGCHAR_HEIGHT+2; - s_serveroptions.weaponMode.generic.type = MTYPE_SPINCONTROL; - s_serveroptions.weaponMode.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; - s_serveroptions.weaponMode.generic.x = OPTIONS_X; - s_serveroptions.weaponMode.generic.y = y; - if (UI_IsARoundBasedGametype(s_serveroptions.gametype)) { - s_serveroptions.weaponMode.itemnames = weaponModeElimination_list; - } - else { - s_serveroptions.weaponMode.itemnames = weaponMode_list; - } - s_serveroptions.weaponMode.generic.name = "Weapons Ruleset:"; - s_serveroptions.weaponMode.generic.statusbar = ServerOptions_StatusBar_WeaponMode; - - //Weapon Arena Weapon list - y += BIGCHAR_HEIGHT+2; - s_serveroptions.weaponArenaWeapon.generic.type = MTYPE_SPINCONTROL; - s_serveroptions.weaponArenaWeapon.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; - s_serveroptions.weaponArenaWeapon.generic.name = "SWA Mode Weapon:"; - s_serveroptions.weaponArenaWeapon.generic.x = OPTIONS_X; - s_serveroptions.weaponArenaWeapon.generic.y = y; - s_serveroptions.weaponArenaWeapon.itemnames = weaponArenaWeapon_list; - s_serveroptions.weaponArenaWeapon.generic.statusbar = ServerOptions_StatusBar_WeaponArenaWeapon; - - y += BIGCHAR_HEIGHT+2; - s_serveroptions.awardPushing.generic.type = MTYPE_SPINCONTROL; - s_serveroptions.awardPushing.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; - s_serveroptions.awardPushing.generic.name = "Award Pushing Rule:"; - s_serveroptions.awardPushing.generic.x = OPTIONS_X; - s_serveroptions.awardPushing.generic.y = y; - s_serveroptions.awardPushing.itemnames = awardPushing_list; - s_serveroptions.awardPushing.generic.statusbar = ServerOptions_StatusBar_AwardPushing; - if(UI_IsATeamGametype(s_serveroptions.gametype)) { if(UI_IsARoundBasedGametype(s_serveroptions.gametype)) { y += BIGCHAR_HEIGHT+2; @@ -2389,76 +1857,6 @@ static void ServerOptions_MenuInit( qboolean multiplayer ) { s_serveroptions.friendlyfire.generic.statusbar = ServerOptions_StatusBar_FriendlyFire; } } - if( s_serveroptions.gametype == GT_HARVESTER) { - y += BIGCHAR_HEIGHT+2; - s_serveroptions.harvesterFromBodies.generic.type = MTYPE_RADIOBUTTON; - s_serveroptions.harvesterFromBodies.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; - s_serveroptions.harvesterFromBodies.generic.x = OPTIONS_X; - s_serveroptions.harvesterFromBodies.generic.y = y; - s_serveroptions.harvesterFromBodies.generic.name = "Skulls From Bodies:"; - s_serveroptions.harvesterFromBodies.generic.statusbar = ServerOptions_StatusBar_harvesterFromBodies; - } - if( s_serveroptions.gametype == GT_OBELISK ) { - y += BIGCHAR_HEIGHT+2; - s_serveroptions.overloadRespawnDelay.generic.type = MTYPE_FIELD; - s_serveroptions.overloadRespawnDelay.generic.name = "Time Between Rounds:"; - s_serveroptions.overloadRespawnDelay.generic.flags = QMF_SMALLFONT; - s_serveroptions.overloadRespawnDelay.generic.x = OPTIONS_X; - s_serveroptions.overloadRespawnDelay.generic.y = y; - s_serveroptions.overloadRespawnDelay.field.widthInChars = 3; - s_serveroptions.overloadRespawnDelay.field.maxchars = 3; - s_serveroptions.overloadRespawnDelay.generic.statusbar = ServerOptions_StatusBar_overloadRespawnDelay; - } - if( s_serveroptions.gametype == GT_CTF_ELIMINATION) { - y += BIGCHAR_HEIGHT+2; - s_serveroptions.oneway.generic.type = MTYPE_RADIOBUTTON; - s_serveroptions.oneway.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; - s_serveroptions.oneway.generic.x = OPTIONS_X; - s_serveroptions.oneway.generic.y = y; - s_serveroptions.oneway.generic.name = "Attack vs. Defense:"; - s_serveroptions.oneway.generic.statusbar = ServerOptions_StatusBar_Oneway; - } - if( s_serveroptions.gametype == GT_LMS ) { - y += BIGCHAR_HEIGHT+2; - s_serveroptions.lmsMode.generic.type = MTYPE_SPINCONTROL; - s_serveroptions.lmsMode.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; - s_serveroptions.lmsMode.generic.name = "Scoring Mode:"; - s_serveroptions.lmsMode.generic.x = OPTIONS_X; - s_serveroptions.lmsMode.generic.y = y; - s_serveroptions.lmsMode.itemnames = lmsMode_list; - s_serveroptions.lmsMode.generic.statusbar = ServerOptions_StatusBar_lmsMode; - - y += BIGCHAR_HEIGHT+2; - s_serveroptions.lmsLives.generic.type = MTYPE_FIELD; - s_serveroptions.lmsLives.generic.name = "Lives Per Player:"; - s_serveroptions.lmsLives.generic.flags = QMF_SMALLFONT; - s_serveroptions.lmsLives.generic.x = OPTIONS_X; - s_serveroptions.lmsLives.generic.y = y; - s_serveroptions.lmsLives.field.widthInChars = 3; - s_serveroptions.lmsLives.field.maxchars = 3; - s_serveroptions.lmsLives.generic.statusbar = ServerOptions_StatusBar_lmsLives; - } - if( s_serveroptions.gametype == GT_DOUBLE_D ) { - y += BIGCHAR_HEIGHT+2; - s_serveroptions.ddCaptureTime.generic.type = MTYPE_FIELD; - s_serveroptions.ddCaptureTime.generic.name = "Holding Time:"; - s_serveroptions.ddCaptureTime.generic.flags = QMF_SMALLFONT; - s_serveroptions.ddCaptureTime.generic.x = OPTIONS_X; - s_serveroptions.ddCaptureTime.generic.y = y; - s_serveroptions.ddCaptureTime.field.widthInChars = 3; - s_serveroptions.ddCaptureTime.field.maxchars = 3; - s_serveroptions.ddCaptureTime.generic.statusbar = ServerOptions_StatusBar_ddCaptureTime; - - y += BIGCHAR_HEIGHT+2; - s_serveroptions.ddRespawnDelay.generic.type = MTYPE_FIELD; - s_serveroptions.ddRespawnDelay.generic.name = "Time Between Rounds:"; - s_serveroptions.ddRespawnDelay.generic.flags = QMF_SMALLFONT; - s_serveroptions.ddRespawnDelay.generic.x = OPTIONS_X; - s_serveroptions.ddRespawnDelay.generic.y = y; - s_serveroptions.ddRespawnDelay.field.widthInChars = 3; - s_serveroptions.ddRespawnDelay.field.maxchars = 3; - s_serveroptions.ddRespawnDelay.generic.statusbar = ServerOptions_StatusBar_ddRespawnDelay; - } y = 80; s_serveroptions.botSkill.generic.type = MTYPE_SPINCONTROL; @@ -2608,11 +2006,6 @@ static void ServerOptions_MenuInit( qboolean multiplayer ) { if(UI_IsARoundBasedGametype(s_serveroptions.gametype)) { Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.eliminationRoundTime ); } - Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.pmove ); - Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.grapple ); - Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.weaponMode ); - Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.weaponArenaWeapon ); - Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.awardPushing ); if(UI_IsATeamGametype(s_serveroptions.gametype)) { if (UI_IsARoundBasedGametype(s_serveroptions.gametype)) { Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.eliminationDamage ); @@ -2621,23 +2014,6 @@ static void ServerOptions_MenuInit( qboolean multiplayer ) { Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.friendlyfire ); } } - if( s_serveroptions.gametype == GT_HARVESTER) { - Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.harvesterFromBodies ); - } - if( s_serveroptions.gametype == GT_OBELISK) { - Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.overloadRespawnDelay ); - } - if( s_serveroptions.gametype == GT_CTF_ELIMINATION) { - Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.oneway ); - } - if( s_serveroptions.gametype == GT_LMS) { - Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.lmsMode ); - Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.lmsLives ); - } - if( s_serveroptions.gametype == GT_DOUBLE_D) { - Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.ddCaptureTime ); - Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.ddRespawnDelay ); - } Menu_AddItem( &s_serveroptions.menu, &s_serveroptions.pure ); if( s_serveroptions.multiplayer ) {