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.
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user