ACE3/addons/spectator/functions/fnc_updateSides.sqf
SilentSpike d3ce75daef Spectator overhaul (#5171)
- Overhauls the spectator module entirely to share a similar UX to BI's "End Game Spectator" while maintaining some of the extended flexibility of ACE Spectator.
- Simplifies spectator setup by reducing the number of settings. More advanced setup is still possible via the API functions provided.
2017-08-12 14:25:48 +01:00

33 lines
691 B
Plaintext

/*
* Author: SilentSpike
* Adds or removes sides from the selection available to spectate. Local effect.
*
* Default selection is [west,east,resistance,civilian]
*
* Arguments:
* 0: Sides to add <ARRAY>
* 1: Sides to remove <ARRAY>
*
* Return Value:
* Sides available <ARRAY>
*
* Example:
* [[west], [east,civilian]] call ace_spectator_fnc_updateSides
*
* Public: Yes
*/
#include "script_component.hpp"
params [["_addSides",[],[[]]], ["_removeSides",[],[[]]]];
// Add and remove sides
_addSides append (GVAR(availableSides) - _removeSides);
// Only need array of unique sides
_addSides = _addSides arrayIntersect _addSides;
GVAR(availableSides) = _addSides;
_addSides