What needs to be tested:
The gear selector was rewritten a few weeks ago. I tested a bunch myself, but I want some more testing before pushing it into a release.
The selector init (https://github.com/Mjolnir64/FNF/blob/dev/FNF_MissionTemplate.VR/client/loadout/selector/fn_selector_init.sqf) is called from the client init after the player's loadout gets assigned: https://github.com/Mjolnir64/FNF/blob/f5d894bd405dc3627b7bdf40bbae66933856d708/FNF_MissionTemplate.VR/client/init/fn_clientInit.sqf#L19
This is how each component of the selector works:
- Selectable primary weapons are set via the array 'phx_selector_weapons', which is a part of the weapon sets. This array is a 2d array, with each element containing an array with at least a weapon class, but can also contain up to 2 magazine classes, which are the magazines used for the weapon. If no magazines are specified, the system will use whatever magazines the player spawned with, so weapons with compatible magazines don't need to have magazines listed in the selector array. By default, the following roles are not allowed to switch weapons: AR, MG, Marksman, Pilot. Main thing to test here is to make sure the player isn't able to duplicate ammo or weapons.
Selector weapons function:
https://github.com/Mjolnir64/FNF/blob/f5d894bd405dc3627b7bdf40bbae66933856d708/FNF_MissionTemplate.VR/client/loadout/selector/fn_selector_weapons.sqf
- Selectable optics are set via the array 'phx_selector_optics' and 'phx_selector_magOptics' when magnified optics are allowed (phx_selector_magOptics gets appended to phx_selector_optics) here: https://github.com/Mjolnir64/FNF/blob/f5d894bd405dc3627b7bdf40bbae66933856d708/FNF_MissionTemplate.VR/client/loadout/fn_initLoadout.sqf#L60-L61
If an optic within 'phx_selector_optics' is compatible with the player's primary weapon, they will be able to select it.
Selector optics function:
https://github.com/Mjolnir64/FNF/blob/f5d894bd405dc3627b7bdf40bbae66933856d708/FNF_MissionTemplate.VR/client/loadout/selector/fn_selector_optics.sqf
- Combat Engineer selectable charges are set via the array 'phx_selector_explosives' here: https://github.com/Mjolnir64/FNF/blob/f5d894bd405dc3627b7bdf40bbae66933856d708/FNF_MissionTemplate.VR/client/loadout/fn_initLoadout.sqf#L62-L67
'phx_selector_explosives ' is a 2d array with each element containing a selectable charge loadout. The first element of each of those arrays is a text description of the loadout, with any further elements being the charge class and number to add.
The selector first checks if the player has all of the items contained within their old charge loadout (tracked with the variable 'phx_selector_currentExplosives') before switching charge loadouts. This is to prevent duping. Like with the weapon selector, main thing to test here is item duping.
Selector charge function:
https://github.com/Mjolnir64/FNF/blob/f5d894bd405dc3627b7bdf40bbae66933856d708/FNF_MissionTemplate.VR/client/loadout/selector/fn_selector_charges.sqf
Expected behavior of the test:
Players should be able to switch their weapon, optic and charge loadout (if CE) without being able to duplicate any items. Local testing is sufficient for this.