From ff650f7becf34069f9375664670b890590be2e16 Mon Sep 17 00:00:00 2001 From: RT Date: Fri, 24 Jul 2026 21:42:54 -0500 Subject: [PATCH] Load File: finalize first-click deterministic apply, add NoReturn, and align docs - Stabilize Load File first-click behavior across mission/map/options/slots. - Fix map sequencing by rebuilding game-type scenario list before mission lookup. - Resolve mission-name miss to map index 0 fallback for selected game type. - Fix decal handling: map INI decal IDs to dropdown indices, clamp invalid indices, display actual decal IDs in UI labels, and avoid redraw-time decal overwrite. - Fix option apply timing and UI visibility issues, including Weapon Jam refresh. - Add NoReturn support end-to-end: parse/store in MW4Shell auto globals, expose script variable, and apply to respawn/no-return mission params and UI checkbox. - Update autoconfig spec to reflect actual parser/default/fallback behavior and add NoReturn examples. --- BTFrstrm/autoconfig-file-spec.html | 28 +- BTFrstrm/test-ffa-coliseum.ini | 1 + BTFrstrm/test-team-koth-centralpark.ini | 1 + CLAUDE.md | 30 ++ Gameleap/code/mw4/Code/MW4/MW4Shell.cpp | 6 +- .../mw4/Content/ShellScripts/ConLobby.script | 77 ++--- .../Multiplayer/ConLobbyMission.script | 283 +++++++++++++----- 7 files changed, 299 insertions(+), 127 deletions(-) diff --git a/BTFrstrm/autoconfig-file-spec.html b/BTFrstrm/autoconfig-file-spec.html index f0aeb438..3c459615 100644 --- a/BTFrstrm/autoconfig-file-spec.html +++ b/BTFrstrm/autoconfig-file-spec.html @@ -105,14 +105,14 @@ The system operates with two separate files:
  • String values: Everything after = to end of line. Do not wrap in quotes. Example: MissionName=ScarabStronghold - Attrition
  • Integer values: Raw decimal integer only. No quotes, no sign unless negative. Example: GameType=2
  • Do not use comments (// or ;). Parser behavior is not guaranteed. Keep the file clean.
  • -
  • Missing key: If a key is absent from its section, the corresponding lobby value stays at its current setting. No error is raised.
  • -
  • Missing section: If [mission] is absent, no game options are changed. If [slot0] is absent, no slots are changed.
  • +
  • Missing key: If a key is absent, parser defaults are used. For [mission] this means built-in auto defaults (not current UI values). For [slotX] fields, omitted numeric values default to 0 and omitted strings default to empty.
  • +
  • Missing section: If [mission] is absent, Load File still applies mission defaults. If [slot0] is absent, all slots are cleared and remain empty.

  • 4. Section: [mission]

    -

    Sets all game lobby parameters. This section is optional — omit it to leave game options unchanged and only configure slots.

    +

    Sets all game lobby parameters. This section is optional, but if omitted, Load File applies built-in mission defaults (it does not preserve current UI values).

    [mission]
     MissionName=ScarabStronghold - Attrition
    @@ -127,6 +127,7 @@ The system operates with two separate files:
     FriendlyFire=0
     SplashDamage=0
     UnlimitedAmmo=1
    +NoReturn=0
     WeaponJam=0
     AdvanceMode=0
     ArmorMode=0
    @@ -138,7 +139,7 @@ Match is exact string equality, case-sensitive. Trailing/leading spaces are stri

    If the name is not found in the list for the selected GameType, - mission selection silently fails — the dropdown stays at its previous value. + map selection falls back to index 0 (first available map for that game type). No error is logged. All other parameters (Visibility, Weather, etc.) are still applied. The available mission names depend on what scenario files are installed on the machine; there is no static guaranteed list. @@ -246,28 +247,37 @@ Match is exact string equality, case-sensitive. Trailing/leading spaces are stri 1On — unlimited ammo DEFAULT (console/arcade) -

    4.12  WeaponJam — integer

    +

    4.12  NoReturn — integer

    + + + + +
    ValueDescription
    0Off — pilots can respawn DEFAULT
    1On — no respawn ("No Return")
    + +

    Implementation note: this maps to RESPAWN_LIMIT_PARAMETER (on/off), with RESPAWN_LIMIT_NUMBER_PARAMETER forced to 0, matching current lobby behavior.

    + +

    4.13  WeaponJam — integer

    ValueDescription
    0Off DEFAULT
    1On — weapons can randomly jam
    -

    4.13  AdvanceMode — integer

    +

    4.14  AdvanceMode — integer

    ValueDescription
    0Off DEFAULT
    1On
    -

    4.14  ArmorMode — integer

    +

    4.15  ArmorMode — integer

    ValueDescription
    0Off DEFAULT
    1On
    -

    4.15  TeamAllowed — integer (required for correct team/FFA slot display on first click)

    +

    4.16  TeamAllowed — integer (required for correct team/FFA slot display on first click)

    Must match the GameType selected. Controls whether Team or Skin is applied to slots, and whether team dropdowns are shown.

    @@ -275,7 +285,7 @@ Match is exact string equality, case-sensitive. Trailing/leading spaces are stri
    ValueDescription
    1Team game ? slot Team field is used
    -

    4.16  TeamCount — integer (optional, only when TeamAllowed=1)

    +

    4.17  TeamCount — integer (optional, only when TeamAllowed=1)

    Number of teams. Valid range: 2–8. Default: 2.


    diff --git a/BTFrstrm/test-ffa-coliseum.ini b/BTFrstrm/test-ffa-coliseum.ini index 2b3bf341..775ef516 100644 --- a/BTFrstrm/test-ffa-coliseum.ini +++ b/BTFrstrm/test-ffa-coliseum.ini @@ -11,6 +11,7 @@ HeatOn=0 FriendlyFire=1 SplashDamage=1 UnlimitedAmmo=0 +NoReturn=0 WeaponJam=1 AdvanceMode=1 ArmorMode=1 diff --git a/BTFrstrm/test-team-koth-centralpark.ini b/BTFrstrm/test-team-koth-centralpark.ini index 12e80983..22131795 100644 --- a/BTFrstrm/test-team-koth-centralpark.ini +++ b/BTFrstrm/test-team-koth-centralpark.ini @@ -12,6 +12,7 @@ HeatOn=0 FriendlyFire=1 SplashDamage=1 UnlimitedAmmo=0 +NoReturn=0 WeaponJam=1 AdvanceMode=1 ArmorMode=1 diff --git a/CLAUDE.md b/CLAUDE.md index daefd799..8f8e3265 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -907,6 +907,36 @@ every `.data`/`.instance`/`.subsystems` field parsed, conversions performed (m/s rad/s ↔ deg/s), and `hsh/` naming rules for MFD/Mechs/HUD/Radar images. Canonical reference for future mech data work. +### Load File autoconfig stabilization + docs update (2026-07-24) +End-to-end Load File flow for the console lobby was stabilized and verified with a +full-delta regression INI (all mission options + all 16 slots changed away from rookie +defaults), then round-tripped back via the Default button. + +Key fixes in `ConLobby.script` / `ConLobbyMission.script`: +- Eliminated first-click vs second-click drift by moving auto-load to a dedicated + deterministic mission path and preventing redraw-time decal mutation. +- Corrected decal handling: map INI decal IDs to lobby dropdown indices, clamp invalid + indices, and show actual decal IDs in labels. +- Corrected mission+map sequencing: game type now rebuilds map list first; mission name + then resolves against that list (with fallback to map index 0). +- Fixed option-state application so first click applies all options (visibility/weather/ + time/radar/heat/friendly fire/splash/unlimited/jam/advance/armor) without needing a + second click. +- Fixed Weapon Jam checkbox visibility refresh when set via Load File (UI now re-inits + correctly when heat/advanced states are applied). + +New supported autoconfig key: +- Added `NoReturn=0|1` under `[mission]`: + - parser + script variable in `MW4Shell.cpp` (`g_nAutoNoReturn`), + - application in `ConLobbyMission.script` (`RESPAWN_LIMIT_PARAMETER`), + - docs + sample INIs updated. + +Docs updates: +- `BTFrstrm/autoconfig-file-spec.html` corrected for real behavior: + - missing mission keys/section apply defaults (not current UI values), + - missing `MissionName` now falls back to first map for that game type, + - added `NoReturn` semantics and examples. + ## Next steps (proposed) - [x] ~~Windowed 3D viewport on Win11~~ — DONE via DDrawCompat (see STEP 8 viewport section). - [ ] (Optional) Curate remaining WIP content as features are exercised (editor loads dev `Content\`). diff --git a/Gameleap/code/mw4/Code/MW4/MW4Shell.cpp b/Gameleap/code/mw4/Code/MW4/MW4Shell.cpp index fe8fff76..3548841f 100644 --- a/Gameleap/code/mw4/Code/MW4/MW4Shell.cpp +++ b/Gameleap/code/mw4/Code/MW4/MW4Shell.cpp @@ -204,6 +204,7 @@ static int g_nAutoHeat = 0; static int g_nAutoFriendlyFire = 0; static int g_nAutoSplash = 0; static int g_nAutoUnlimitedAmmo = 1; +static int g_nAutoNoReturn = 0; static int g_nAutoWeaponJam = 0; static int g_nAutoAdvanceMode = 0; static int g_nAutoArmorMode = 0; @@ -821,6 +822,7 @@ void MW4Shell::StartUp() gosScript_RegisterVariable("g_nAutoFriendlyFire", &g_nAutoFriendlyFire, GOSVAR_INT, 0, NULL); gosScript_RegisterVariable("g_nAutoSplash", &g_nAutoSplash, GOSVAR_INT, 0, NULL); gosScript_RegisterVariable("g_nAutoUnlimitedAmmo",&g_nAutoUnlimitedAmmo, GOSVAR_INT, 0, NULL); + gosScript_RegisterVariable("g_nAutoNoReturn", &g_nAutoNoReturn, GOSVAR_INT, 0, NULL); gosScript_RegisterVariable("g_nAutoWeaponJam", &g_nAutoWeaponJam, GOSVAR_INT, 0, NULL); gosScript_RegisterVariable("g_nAutoAdvanceMode", &g_nAutoAdvanceMode, GOSVAR_INT, 0, NULL); gosScript_RegisterVariable("g_nAutoArmorMode", &g_nAutoArmorMode, GOSVAR_INT, 0, NULL); @@ -1234,6 +1236,7 @@ void MW4Shell::ShutDown() gosScript_UnregisterVariable("g_nAutoArmorMode"); gosScript_UnregisterVariable("g_nAutoAdvanceMode"); gosScript_UnregisterVariable("g_nAutoWeaponJam"); + gosScript_UnregisterVariable("g_nAutoNoReturn"); gosScript_UnregisterVariable("g_nAutoUnlimitedAmmo"); gosScript_UnregisterVariable("g_nAutoSplash"); gosScript_UnregisterVariable("g_nAutoFriendlyFire"); @@ -12917,7 +12920,7 @@ int __stdcall CTCL_LoadAutoFile(void* instance, int args, void* data[]) g_nAutoGameType = 2; g_nAutoVisibility = 0; g_nAutoWeather = 0; g_nAutoTimeOfDay = 0; g_nAutoTimeLimit = -1; g_nAutoRadar = 0; g_nAutoHeat = 0; g_nAutoFriendlyFire = 0; g_nAutoSplash = 0; - g_nAutoUnlimitedAmmo = 1; g_nAutoWeaponJam = 0; g_nAutoAdvanceMode = 0; + g_nAutoUnlimitedAmmo = 1; g_nAutoNoReturn = 0; g_nAutoWeaponJam = 0; g_nAutoAdvanceMode = 0; g_nAutoArmorMode = 0; g_nAutoTeamAllowed = 0; g_nAutoTeamCount = 2; Page *pMission = autofile.FindPage("mission"); @@ -12937,6 +12940,7 @@ int __stdcall CTCL_LoadAutoFile(void* instance, int args, void* data[]) pMission->GetEntry("FriendlyFire", &g_nAutoFriendlyFire); pMission->GetEntry("SplashDamage", &g_nAutoSplash); pMission->GetEntry("UnlimitedAmmo", &g_nAutoUnlimitedAmmo); + pMission->GetEntry("NoReturn", &g_nAutoNoReturn); pMission->GetEntry("WeaponJam", &g_nAutoWeaponJam); pMission->GetEntry("AdvanceMode", &g_nAutoAdvanceMode); pMission->GetEntry("ArmorMode", &g_nAutoArmorMode); diff --git a/Gameleap/mw4/Content/ShellScripts/ConLobby.script b/Gameleap/mw4/Content/ShellScripts/ConLobby.script index 934bb26c..1e386a14 100644 --- a/Gameleap/mw4/Content/ShellScripts/ConLobby.script +++ b/Gameleap/mw4/Content/ShellScripts/ConLobby.script @@ -377,6 +377,7 @@ main int decal_id ///////VERY IMPORTANT FOR NEW DECAL INTERFACE int decal_ids[20] //JPP was 18 int update_decal = false + int m_bApplyingAutoLoad = false // suppress skin_box auto decal sync during Load File apply int ROSTER_top_of_list = 0 int block_launch_or_ready = FALSE int MAX_ITEMS = 60 @@ -994,26 +995,9 @@ main // o_decal[x].list_item[15] = "SCORPION" // o_decal[x].list_item[16] = "331st" - o_decal[x].list_item[0] = "1" - o_decal[x].list_item[1] = "2" - o_decal[x].list_item[2] = "3" - o_decal[x].list_item[3] = "4" - o_decal[x].list_item[4] = "5" - o_decal[x].list_item[5] = "6" - o_decal[x].list_item[6] = "7" - o_decal[x].list_item[7] = "8" - o_decal[x].list_item[8] = "9" - o_decal[x].list_item[9] = "10" - o_decal[x].list_item[10] = "11" - o_decal[x].list_item[11] = "12" - o_decal[x].list_item[12] = "13" - o_decal[x].list_item[13] = "14" - o_decal[x].list_item[14] = "15" - o_decal[x].list_item[15] = "16" - o_decal[x].list_item[16] = "17" - - for coolbaby = 17;coolbaby < o_decal[x].list_size+1;coolbaby++ - o_decal[x].list_item[coolbaby] = conv$(coolbaby+1) + for coolbaby = 0; coolbaby < MAX_DECAL_COUNT; coolbaby++ + o_decal[x].list_item[coolbaby] = conv$(ffa_decal[coolbaby]) + o_decal[x].list_item[MAX_DECAL_COUNT] = "00" // bot/default entry o_decal[x].nselected = 3 decal_ids[x] = 1 @@ -1683,20 +1667,12 @@ main play press, 1 if callback($$CTCL_LoadAutoFile$$) { + m_bApplyingAutoLoad = true // Apply game options using dedicated Auto globals. // Rookie Mission globals are NOT touched so the Default button keeps working. int m if exists(@ConLobbyMission@) { - @ConLobbyMission@o_game_options[0].nselected = $$g_nAutoGameType$$ - for (m = 0; m < @ConLobbyMission@o_game_options[1].list_size; m++) - { - if equal$(@ConLobbyMission@o_game_options[1].list_item[m], $$g_szAutoMission$$) - { - @ConLobbyMission@o_game_options[1].nselected = m - break - } - } mail(MAIL_LOAD_AUTO_MISSION, @ConLobbyMission@) } // Update team state synchronously so slot display is correct on the first click. @@ -1774,9 +1750,21 @@ main // The game type may not have propagated to cur_team_val yet // (MAIL_SET_ROOKIE_MISSION is async); setting both is safe -- // the launch code uses whichever is correct for the active mode. + int nAutoDecal + int nAutoDecalIndex o_team[k].nselected = callback($$CTCL_GetAutoSlotInt$$, k, 1) o_skins[k].nselected = callback($$CTCL_GetAutoSlotInt$$, k, 2) - o_decal[k].nselected = callback($$CTCL_GetAutoSlotInt$$, k, 3) + nAutoDecal = callback($$CTCL_GetAutoSlotInt$$, k, 3) + nAutoDecalIndex = 20 // fallback to safe/default decal slot + for (j = 0; j <= MAX_DECAL_COUNT; j++) + { + if (ffa_decal[j] == nAutoDecal) + { + nAutoDecalIndex = j + break + } + } + o_decal[k].nselected = nAutoDecalIndex initialize(o_mech_variant[k]) if (ROSTER_top_of_list <= k) && (k < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT) { @@ -1787,6 +1775,7 @@ main deactivate(o_mech_variant[k]) } } + m_bApplyingAutoLoad = false } return } @@ -2200,6 +2189,24 @@ main #endif // USE_O_MECH_VARIANT2 break } + if (sender == o_skins[k]) + { + if !cur_team_val + { + o_decal[k].nselected = o_skins[k].nselected + initialize(o_decal[k]) + } + break + } + if (sender == o_team[k]) + { + if cur_team_val + { + o_decal[k].nselected = team_camo[o_team[k].nselected] + initialize(o_decal[k]) + } + break + } if (sender == o_BotList[k]) { if (o_BotList[k].nselected != m_naLastSelected[k]) @@ -3116,14 +3123,6 @@ skin_box { nLastState = state p_pane = "Content\\ShellScripts\\Graphics\\Multiplayer\\LobbySkins\\skin" letters[state] "4.tga" - if cur_team_val - { - o_decal[id].nselected = team_camo[o_team[id].nselected] - } - else - { - o_decal[id].nselected = o_skins[id].nselected - } } render p_pane, SKIN_BOX_X-35,location.Y @@ -3222,6 +3221,8 @@ decal_box } if (dstate != nLastdState) { + if (dstate < 0) || (dstate > 20) + dstate = 20 nLastdState = dstate d_pane = "Content\\ShellScripts\\Graphics\\Multiplayer\\LobbyDecals\\decal_" decals[dstate] ".tga" } diff --git a/Gameleap/mw4/Content/ShellScripts/Multiplayer/ConLobbyMission.script b/Gameleap/mw4/Content/ShellScripts/Multiplayer/ConLobbyMission.script index 9189f304..9d5e388c 100644 --- a/Gameleap/mw4/Content/ShellScripts/Multiplayer/ConLobbyMission.script +++ b/Gameleap/mw4/Content/ShellScripts/Multiplayer/ConLobbyMission.script @@ -570,7 +570,15 @@ main //------------------------------------------------------------------------- nTempParam = HEAT_PARAMETER if callback($$GetLocalNetworkMissionParamater$$,nTempParam) + { o_game_options[7].state = 2 + nTempParam1 = WEAPON_JAM_PARAMETER + if callback($$GetLocalNetworkMissionParamater$$,nTempParam1) + o_game_options[14].state = 2 + else + o_game_options[14].state = 0 + initialize(o_game_options[14]) + } else { o_game_options[7].state = 0 @@ -686,6 +694,170 @@ main } } } + // [automaticmode] Handle Load File in a dedicated early path for BOTH sender contexts. + // This prevents MAIL_LOAD_AUTO_MISSION self-mails from falling through to + // generic game/map handlers that re-apply Rookie defaults. + if (getmessage() == MAIL_LOAD_AUTO_MISSION) + { + // Phase 1: ensure game type is selected and rebuild map list for that type. + if (o_game_options[0].nselected != $$g_nAutoGameType$$) + { + o_game_options[0].nselected = $$g_nAutoGameType$$ + callback($$SetNetworkMissionParamater$$, game_type, selection_to_standard[o_game_options[0].nselected]) + if (callback($$InitNetworkScenarios$$)) + { + callback($$GetGameTypeString$$, selection_to_standard[o_game_options[0].nselected]) + callback($$GetNetworkScenarios$$, o_game_options[1].list_item[]) + o_game_options[1].list_size = $$networkScenarioCount$$ + initialize(o_game_options[1]) + if ($$networkScenarioCount$$ == 0) + { + deactivate(o_game_options[1]) + deactivate(@conlobby@o_launch_button) + } + else + { + activate(o_game_options[1]) + activate(@conlobby@o_launch_button) + } + } + last_selected_game = o_game_options[0].nselected + } + + // Phase 2: resolve mission by name in the current (game-type-specific) map list. + int auto_map_index + auto_map_index = 0 + int found_auto_map + found_auto_map = 0 + int mk + for (mk = 0; mk < o_game_options[1].list_size; mk++) + { + if equal$(o_game_options[1].list_item[mk], $$g_szAutoMission$$) + { + auto_map_index = mk + found_auto_map = 1 + break + } + } + if !found_auto_map + auto_map_index = 0 + if (o_game_options[1].nselected != auto_map_index) + o_game_options[1].nselected = auto_map_index + + callback($$SetNetworkMissionParamater$$, game_type, selection_to_standard[$$g_nAutoGameType$$]) + callback($$SetNetworkMissionParamater$$, map_type, o_game_options[1].nselected) + callback($$SelectNetworkScenario$$, o_game_options[1].nselected) + last_selected_map = o_game_options[1].nselected + + // visibility + o_game_options[2].nselected = $$g_nAutoVisibility$$ + callback($$SetNetworkMissionParamater$$, visibility, o_game_options[2].nselected) + // weather + o_game_options[3].nselected = $$g_nAutoWeather$$ + callback($$SetNetworkMissionParamater$$, weather, o_game_options[3].nselected) + // time of day + o_game_options[4].nselected = $$g_nAutoTimeOfDay$$ + callback($$SetNetworkMissionParamater$$, night_parameter, o_game_options[4].nselected) + callback($$Shell_CallbackHandler$$, ShellSetTime, o_game_options[4].nselected) + // time limit + int nAutoTL = $$g_nAutoTimeLimit$$ + int temp_num + if nAutoTL >= 0 + temp_num = nAutoTL + else + temp_num = TIME_VALUE_DEFAULT + int m + for (m = 0; m < o_game_options[5].list_size; m++) + { + if (makeint(o_game_options[5].list_item[m]) == temp_num) + { + o_game_options[5].nselected = m + break + } + } + callback($$SetNetworkMissionParamater$$, time_limit, temp_num) + // radar + int nTempParam = radar + int nTempValue = $$g_nAutoRadar$$ + o_game_options[6].nselected = nTempValue + callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) + // heat + nTempParam = HEAT_PARAMETER + nTempValue = $$g_nAutoHeat$$ + if nTempValue + o_game_options[7].state = 2 + else + o_game_options[7].state = 0 + callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) + // friendly fire + nTempParam = FRIENDLY_FIRE_PERCENTGE_PARAMETER + nTempValue = $$g_nAutoFriendlyFire$$ + if nTempValue + { + o_game_options[8].state = 2 + nTempValue = 100 + } + else + { + o_game_options[8].state = 0 + nTempValue = 0 + } + callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) + // splash + nTempParam = SPLASH_ON_PARAMETER + nTempValue = $$g_nAutoSplash$$ + if nTempValue + o_game_options[9].state = 2 + else + o_game_options[9].state = 0 + callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) + // unlimited ammo + nTempParam = UNLIMITED_AMMO_PARAMETER + nTempValue = $$g_nAutoUnlimitedAmmo$$ + if (nTempValue == 0) + o_game_options[10].state = 2 + else + o_game_options[10].state = 0 + callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) + // no return + nTempParam = num_of_lives + nTempValue = 0 + callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) + nTempParam = respawn_onoff + nTempValue = $$g_nAutoNoReturn$$ + if nTempValue + o_game_options[11].state = 2 + else + o_game_options[11].state = 0 + callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) + // weapon jam + nTempParam = WEAPON_JAM_PARAMETER + nTempValue = $$g_nAutoWeaponJam$$ + if nTempValue + o_game_options[14].state = 2 + else + o_game_options[14].state = 0 + callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) + // advance mode + nTempParam = ADVANCE_MODE_PARAMETER + nTempValue = $$g_nAutoAdvanceMode$$ + if nTempValue + o_game_options[15].state = 2 + else + o_game_options[15].state = 0 + callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) + // armor mode + nTempParam = ARMOR_MODE_PARAMETER + nTempValue = $$g_nAutoArmorMode$$ + if nTempValue + o_game_options[16].state = 2 + else + o_game_options[16].state = 0 + callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) + + mail(MAIL_LOAD_AUTO_MISSION_DONE, this) + return + } if (sender == @conlobby@) { if (getmessage() == -7777) @@ -832,82 +1004,6 @@ main mail(MAIL_PREVIOUS_MISSION_PARAMS, this) return } - // [automaticmode] Load File button: apply Auto globals, separate from Rookie Mission defaults - if (getmessage() == MAIL_LOAD_AUTO_MISSION) - { - callback($$SetNetworkMissionParamater$$, game_type, selection_to_standard[$$g_nAutoGameType$$]) - // visibility - o_game_options[2].nselected = $$g_nAutoVisibility$$ - callback($$SetNetworkMissionParamater$$, visibility, o_game_options[2].nselected) - // weather - o_game_options[3].nselected = $$g_nAutoWeather$$ - callback($$SetNetworkMissionParamater$$, weather, o_game_options[3].nselected) - // time of day - o_game_options[4].nselected = $$g_nAutoTimeOfDay$$ - callback($$SetNetworkMissionParamater$$, night_parameter, o_game_options[4].nselected) - callback($$Shell_CallbackHandler$$, ShellSetTime, o_game_options[4].nselected) - // time limit - int nAutoTL = $$g_nAutoTimeLimit$$ - int temp_num - if nAutoTL >= 0 - temp_num = nAutoTL - else - temp_num = TIME_VALUE_DEFAULT - int m - for (m = 0; m < o_game_options[5].list_size; m++) - { - if (makeint(o_game_options[5].list_item[m]) == temp_num) - { - o_game_options[5].nselected = m - break - } - } - callback($$SetNetworkMissionParamater$$, time_limit, temp_num) - // radar - int nTempParam = radar - int nTempValue = $$g_nAutoRadar$$ - o_game_options[6].nselected = nTempValue - callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) - // heat - nTempParam = HEAT_PARAMETER - nTempValue = $$g_nAutoHeat$$ - o_game_options[7].state = 0 - callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) - // friendly fire - nTempParam = FRIENDLY_FIRE_PERCENTGE_PARAMETER - nTempValue = $$g_nAutoFriendlyFire$$ - o_game_options[8].state = 0 - callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) - // splash - nTempParam = SPLASH_ON_PARAMETER - nTempValue = $$g_nAutoSplash$$ - o_game_options[9].state = 0 - callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) - // unlimited ammo - nTempParam = UNLIMITED_AMMO_PARAMETER - nTempValue = $$g_nAutoUnlimitedAmmo$$ - o_game_options[10].state = 0 - callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) - // weapon jam - nTempParam = WEAPON_JAM_PARAMETER - nTempValue = $$g_nAutoWeaponJam$$ - o_game_options[14].state = 0 - callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) - // advance mode - nTempParam = ADVANCE_MODE_PARAMETER - nTempValue = $$g_nAutoAdvanceMode$$ - o_game_options[15].state = 0 - callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) - // armor mode - nTempParam = ARMOR_MODE_PARAMETER - nTempValue = $$g_nAutoArmorMode$$ - o_game_options[16].state = 0 - callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) - // Finalize via self-mail: initialize(this) and mail(-9998,parent) must run - // in a sender==this context to avoid the 'gui_objects have no parent' crash. - mail(MAIL_LOAD_AUTO_MISSION_DONE, this) - return - } } if (sender == this) { @@ -1088,7 +1184,36 @@ main if (getmessage() == MAIL_LOAD_AUTO_MISSION_DONE) { initialize(this) - mail(-9998, parent) + nTempParam = UNLIMITED_AMMO_PARAMETER + if ($$g_nAutoUnlimitedAmmo$$ == 0) + { + o_game_options[10].state = 2 + nTempValue = 0 + } + else + { + o_game_options[10].state = 0 + nTempValue = 1 + } + initialize(o_game_options[10]) + callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) + nTempParam = num_of_lives + nTempValue = 0 + callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) + nTempParam = respawn_onoff + if ($$g_nAutoNoReturn$$) + { + o_game_options[11].state = 2 + nTempValue = 1 + } + else + { + o_game_options[11].state = 0 + nTempValue = 0 + } + initialize(o_game_options[11]) + callback($$SetNetworkMissionParamater$$, nTempParam, nTempValue) + mail(-9998, @conlobby@) return } if (getmessage() == MAIL_PREVIOUS_MISSION_PARAMS) @@ -1268,7 +1393,7 @@ main mail(MAIL_PREVIOUS_MISSION_PARAMS, this) } - if ((sender == o_game_options[0]) || ((sender == this) && (getmessage() == MAIL_SET_ROOKIE_MISSION))) && (o_game_options[0].nselected != last_selected_game) + if ((sender == o_game_options[0]) || ((sender == this) && ((getmessage() == MAIL_SET_ROOKIE_MISSION) || (getmessage() == MAIL_LOAD_AUTO_MISSION)))) && (o_game_options[0].nselected != last_selected_game) { callback($$SetNetworkMissionParamater$$, game_type, selection_to_standard[o_game_options[0].nselected]) @@ -1321,7 +1446,7 @@ main mail(MAIL_SET_ROOKIE_MISSION_PARAMS, this) } - if ((sender == o_game_options[1]) || ((sender == this) && (getmessage() == MAIL_SET_ROOKIE_MISSION))) && (o_game_options[1].nselected != last_selected_map) + if ((sender == o_game_options[1]) || ((sender == this) && ((getmessage() == MAIL_SET_ROOKIE_MISSION) || (getmessage() == MAIL_LOAD_AUTO_MISSION)))) && (o_game_options[1].nselected != last_selected_map) { callback($$SetNetworkMissionParamater$$, map_type, o_game_options[1].nselected) callback($$SelectNetworkScenario$$, o_game_options[1].nselected)