2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-12-10 14:32:31 +00:00
|
|
|
/*
|
2023-09-13 03:05:42 +00:00
|
|
|
* Author: commy2, Timi007, LinkIsGrim
|
2015-12-10 14:32:31 +00:00
|
|
|
* Return enabled channels.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: false - use channel id, true - use localized channel names <BOOl> (default: false)
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Enabled Channels <ARRAY>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [false] call ACE_markers_fnc_getEnabledChannels
|
|
|
|
*
|
2015-12-10 14:32:31 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params [["_localize", false, [false]]];
|
|
|
|
|
|
|
|
private _enabledChannels = [];
|
2023-09-13 03:05:42 +00:00
|
|
|
private _currentChannel = currentChannel;
|
2015-12-10 14:32:31 +00:00
|
|
|
|
2023-09-13 03:05:42 +00:00
|
|
|
// Micro-optimization so we don't rebuild the array and localize in each iteration
|
|
|
|
private _engineChannels = CHANNEL_NAMES;
|
2015-12-10 14:32:31 +00:00
|
|
|
|
2023-09-13 03:05:42 +00:00
|
|
|
for "_channelId" from 0 to 15 do {
|
|
|
|
if (_channelId == 5) then {continue}; // Direct channel, ignore
|
|
|
|
if (setCurrentChannel _channelId) then {
|
|
|
|
if (_localize) then {
|
|
|
|
_enabledChannels pushBack (_engineChannels param [_channelId, (radioChannelInfo (_channelId - 5)) select 1]); // radioChannelInfo works off custom IDs only, offset engine channels
|
|
|
|
} else {
|
|
|
|
_enabledChannels pushBack _channelId;
|
2015-12-10 14:32:31 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
setCurrentChannel _currentChannel;
|
|
|
|
|
|
|
|
_enabledChannels
|