diff --git a/Gameleap/code/mw4/Code/MW4/MW4Shell.cpp b/Gameleap/code/mw4/Code/MW4/MW4Shell.cpp index e369322b..945c6665 100644 --- a/Gameleap/code/mw4/Code/MW4/MW4Shell.cpp +++ b/Gameleap/code/mw4/Code/MW4/MW4Shell.cpp @@ -775,7 +775,8 @@ void MW4Shell::StartUp() gosScript_RegisterVariable("g_nRookieWeaponJam", &g_nRookieWeaponJam, GOSVAR_INT, 0, NULL); gosScript_RegisterVariable("g_nRookieAdvanceMode", &g_nRookieAdvanceMode, GOSVAR_INT, 0, NULL); gosScript_RegisterVariable("g_nRookieArmorMode", &g_nRookieArmorMode, GOSVAR_INT, 0, NULL); - // [automaticmode] callbacks + // [automaticmode] callbacks + g_bAutomaticMode variable for script visibility + gosScript_RegisterVariable("g_bAutomaticMode", &g_bAutomaticMode, GOSVAR_INT, 0, NULL); gosScript_RegisterCallback("CTCL_LoadAutoFile", &CTCL_LoadAutoFile, GOSVAR_INT, 0, NULL); gosScript_RegisterCallback("CTCL_GetAutoSlotName", &CTCL_GetAutoSlotName, GOSVAR_INT, 0, NULL); gosScript_RegisterCallback("CTCL_GetAutoSlotMech", &CTCL_GetAutoSlotMech, GOSVAR_INT, 0, NULL); @@ -1186,11 +1187,12 @@ void MW4Shell::ShutDown() gosScript_UnregisterVariable("g_nRookieWeaponJam"); gosScript_UnregisterVariable("g_nRookieAdvanceMode"); gosScript_UnregisterVariable("g_nRookieArmorMode"); - // [automaticmode] callbacks + // [automaticmode] callbacks + variable gosScript_UnregisterCallback("CTCL_GetAutoSlotInt"); gosScript_UnregisterCallback("CTCL_GetAutoSlotMech"); gosScript_UnregisterCallback("CTCL_GetAutoSlotName"); gosScript_UnregisterCallback("CTCL_LoadAutoFile"); + gosScript_UnregisterVariable("g_bAutomaticMode"); // MSL 5.06 gosScript_UnregisterVariable("g_nBlackMech"); gosScript_UnregisterVariable("g_nMechVariant"); diff --git a/Gameleap/mw4/Content/ShellScripts/ConLobby.script b/Gameleap/mw4/Content/ShellScripts/ConLobby.script index efb30edf..079e1e39 100644 --- a/Gameleap/mw4/Content/ShellScripts/ConLobby.script +++ b/Gameleap/mw4/Content/ShellScripts/ConLobby.script @@ -1238,6 +1238,8 @@ main o_load_file.location = 467, 510, o_frame.location.z + 1 o_load_file.state = 0 // initially enabled initialize(o_load_file) + if ($$g_bAutomaticMode$$ != 1) + o_load_file.state = 3 // hide when automaticmode is not active // MSL Added default settings button object o_default = s_multistatepane @@ -1747,10 +1749,12 @@ main } #endif } - if cur_team_val > 0 - o_team[k].nselected = callback($$CTCL_GetAutoSlotInt$$, k, 1) - else - o_skins[k].nselected = callback($$CTCL_GetAutoSlotInt$$, k, 2) + // Always set both team and skin unconditionally. + // 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. + 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) initialize(o_mech_variant[k]) if (ROSTER_top_of_list <= k) && (k < ROSTER_top_of_list + ROSTER_DISPLAY_COUNT)