mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
a168330550
* Add and remove arsenal actions via functions * Fixed header * Update addons/arsenal/functions/fnc_addAction.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update fnc_addSort.sqf * Update addons/arsenal/functions/fnc_removeAction.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/arsenal/functions/fnc_removeAction.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
42 lines
1.0 KiB
Plaintext
42 lines
1.0 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: johnb43
|
|
* Remove a custom action button from ACE Arsenal.
|
|
*
|
|
* Arguments:
|
|
* 0: Array of IDs <ARRAY of STRINGS>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [["TAG_myActions~text~0", "TAG_myActions~statement~0", "TAG_myActions~button~0"]] call ace_arsenal_fnc_removeAction
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
params ["_IDList"];
|
|
|
|
// Compile sorts from config (in case this is called before preInit)
|
|
call FUNC(compileActions);
|
|
|
|
// Remove entries (all names are unique, there are no duplicates)
|
|
{
|
|
(_x splitString "~") params ["_rootClass", "_class", "_tab"];
|
|
|
|
_tab = parseNumber _tab;
|
|
|
|
{
|
|
if ((_x select 0) == _rootClass) exitWith {
|
|
(_x select 3) deleteAt ((_x select 3) findIf {(_x select 0) == _class});
|
|
|
|
// If no entries left in group, remove group
|
|
if ((_x select 3) isEqualTo []) then {
|
|
(GVAR(actionList) select _tab) deleteAt _forEachIndex;
|
|
};
|
|
};
|
|
} forEach (GVAR(actionList) select _tab);
|
|
} forEach _IDList;
|
|
|
|
nil // return
|