Scaleform is used for many complex UI elements, including the selector UI (known as player_switch
in scaleform). You can find a link to ALL scaleforms here.
Here are a few important definitions from these scripts.
function SET_SWITCH_SLOT(index, stateEnum, charEnum, selected, pedheadshot_txt_string)
stateEnum:
["", "AVAILABLE", "UNAVAILABLE", "NOTMET"]
This is the global object for most of the switching data. Most of the data is offset from this object.
This is set to 1 the instant you press alt, when the scaleform is loaded and ready to be used. This will stay 1 until the scaleform is marked as no longer needed.
The global 0x4378 + 0x45 (0x43BD)
contains the currently selected swap player, as by the selector UI. If the UI isn't open, this will be -1.
Values:
-1: not open
0: franklin
1: trevor
2: mp char
3: michael
The global 0x4378 + 0xE (0x4386)
is set to 1 if any change to the selected swap target is made. Done after changing the selected swap player, see above.
The global 0x4378 + 0x13 (0x438B)
is an array indexed by a character index. It is used to define if we have met this player yet.
The global 0x4378 + 0x1D (0x4395)
is an array indexed by a character index. It is used to define if this player is available. Example: when Michael gets abducted by the Chinese.
The global 0x4378 + 0x5 (0x437D)
can be used to disable character swapping. When holding alt, the UI will no longer show, and the timescale will no longer slow. Character swap buttons will also stop working.