Arsenal - Add init/remove local events to Arsenal creation/destruction (#9064)

* Added two local events to arsenal

* onInitArsenal fired when Arsenal got initiated
* onRemoveArsenal fired when Arsenal got removed

* added them to the arsenal event listing in the docs

* Update addons/arsenal/functions/fnc_removeBox.sqf

Co-authored-by: BrettMayson <brett@mayson.io>

* Update addons/arsenal/functions/fnc_removeBox.sqf

Co-authored-by: BrettMayson <brett@mayson.io>

* Renamed events in accordance with event naming patterns sans "on"

* Apply suggestions from code review

Co-authored-by: BrettMayson <brett@mayson.io>

* Improved Docs

Co-authored-by: BrettMayson <brett@mayson.io>
This commit is contained in:
TACHarsis 2022-10-22 02:28:10 +02:00 committed by GitHub
parent 1208f7a2ce
commit 95a5fb040a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -57,5 +57,7 @@ if (_global && {isMultiplayer} && {{_object in _x} count GVAR(EHIDArray) == 0})
[_object, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToObject);
[_object, _items, false] call FUNC(addVirtualItems);
[QGVAR(boxInitialized), [_object, _items]] call CBA_fnc_localEvent;
};
};

View File

@ -32,4 +32,5 @@ if (_global && {isMultiplayer}) then {
} else {
_object setVariable [QGVAR(virtualItems), nil, false];
[_object, 0, ["ACE_MainActions", QGVAR(interaction)]] call EFUNC(interact_menu,removeActionFromObject);
[QGVAR(boxRemoved), _object] call CBA_fnc_localEvent;
};

View File

@ -284,6 +284,8 @@ All are local.
| Name | Arguments | Added in |
| ------------- | ------------- | ------------- |
| ace_arsenal_boxInitialized | Arsenal box (OBJECT), items (BOOL or ARRAY) |
| ace_arsenal_boxRemoved | Arsenal box (OBJECT) |
| ace_arsenal_displayOpened | Arsenal display (DISPLAY) |
| ace_arsenal_displayClosed | None |
| ace_arsenal_leftPanelFilled | Arsenal display (DISPLAY), current left panel IDC (SCALAR), current right panel IDC (SCALAR) |