ACE3/addons/arsenal/functions/fnc_attributeInit.sqf
mharis001 0b19a8d527 Arsenal - 3DEN Attribute (#6257)
* Initial commit

* Add/remove items and switching between categories

* Add ability to change mode

* Save attribute and clear button

* Search bar and double click to toggle

* Add export button

* Add attribute init function

* Fix multiple selection with different items

* Correct bad code and remove unneeded include

* Update stringtable.xml

From common pbo whitelist (modified) and a3 stringtables

* Disable attribute on humans

* Move includes to top

ref #6407
2018-07-20 12:35:44 -05:00

34 lines
814 B
Plaintext

#include "script_component.hpp"
/*
* Author: mharis001
* Initializes the objects 3DEN attribute at scenario start.
*
* Arguments:
* 0: Attribute target <OBJECT>
* 1: Attribute value <ARRAY>
*
* Return Value:
* None
*
* Example:
* [box, [[], 1]] call ace_arsenal_fnc_attributeInit
*
* Public: No
*/
params ["_object", "_value"];
_value params ["_items", "_mode"];
TRACE_2("Initializing object with attribute",_object,_value);
if (_mode > 0) then {
// Blacklist: all full arsenal and take items away
[_object, true, true] call FUNC(initBox);
[_object, _items, true] call FUNC(removeVirtualItems);
} else {
// Exit on whitelist mode with no items
if (_items isEqualTo []) exitWith {};
// Whitelist: add only selected items
[_object, _items, true] call FUNC(initBox);
};