Load File: hide button when automaticmode!=1; fix team/skin double-click
1. Expose g_bAutomaticMode as gosScript variable so ConLobby can check it at init time. o_load_file.state is set to 3 (disabled/hidden) if automaticmode != 1 in options.ini. Button is fully visible and active only when the feature is intentionally enabled. Rebuild required: MW4.exe (Release + Profile). 2. Remove cur_team_val conditional for team/skin slot assignment. Previously, only one of o_team[k] or o_skins[k] was set depending on cur_team_val at click time, but MAIL_SET_ROOKIE_MISSION propagates the new game type asynchronously -- cur_team_val would not reflect the file's GameType until the next frame, requiring a second click. Fix: always set both o_team[k] and o_skins[k] unconditionally. The mission launch code uses whichever is relevant for the active mode; the other is harmlessly ignored. No rebuild (script-only).
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user