ACE3/addons/spectator/functions/fnc_removeLocation.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

40 lines
709 B
Plaintext

/*
* Author: Nelson Duarte, SilentSpike
* Remove a location that can be seen in spectator view. Local effect.
*
* Arguments:
* 0: Unique ID <STRING>
*
* Return Value:
* Success <BOOL>
*
* Example:
* [_id] call ace_spectator_fnc_removeLocation
*
* Public: Yes
*/
#include "script_component.hpp"
params [["_id","",[""]]];
private _index = -1;
{
if ((_x select 0) == _id) exitWith {
_index = _forEachIndex;
};
} forEach GVAR(locationsList);
GVAR(locationsList) deleteAt _index;
// Update the list if appropriate
if !(isNull SPEC_DISPLAY) then {
if (GVAR(uiListType) == LIST_LOCATIONS) then {
[] call FUNC(ui_updateListLocations);
};
};
// Return
_index != -1