ACE3/addons/interact_menu/functions/fnc_removeAction.sqf
Nicolás Badano 310710b6e2 Major plumbing upgrades on interact_menu:
- Store only one compiled menu per class
- Actions added through apis for invidual objects stored on the object separately
- Replaced the concept of uids by paths. This allows adding/removing actions inside other actions loaded from config seamlessly.
- Temporarily removed caching of nearby actions (probe). We may go back to that if needed pretty easily. This allows the player to move freely with the interaction menu opened.
2015-02-27 01:55:16 -03:00

28 lines
678 B
Plaintext

/*
* Author: commy2, NouberNou and CAA-Picard
* Remove an action from an object
*
* Argument:
* 0: Object the action is assigned to <OBJECT>
* 1: Type of action, 0 for actions, 1 for self-actions <NUMBER>
* 2: Full path of the action to remove <ARRAY>
*
* Return value:
* None
*
* Public: No
*/
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_object,_fullPath);
private ["_varName","_actions"];
_varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum;
_actions = _object getVariable [_varName, []];
{
if ((_x select 8) isEqualTo _fullPath) exitWith {
_actions deleteAt _forEachIndex;
};
} forEach _actions;