mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
32 lines
830 B
Plaintext
32 lines
830 B
Plaintext
/*
|
|
* Author: commy2
|
|
* Disables firing while the menu is opened. Called from playerChanged eh.
|
|
*
|
|
* Argument:
|
|
* 0: New unit to add the addAction eh <OBJECT>
|
|
* 1: Old unit to remove the addAction eh <STRING>
|
|
*
|
|
* Return value:
|
|
* None
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_newUnit", "_oldUnit"];
|
|
|
|
// add to new unit
|
|
private "_ehid";
|
|
_ehid = [_newUnit, "DefaultAction", {GVAR(openedMenuType) >= 0}, {
|
|
if (!GVAR(actionOnKeyRelease) && GVAR(actionSelected)) then {
|
|
[GVAR(openedMenuType),true] call FUNC(keyUp);
|
|
};
|
|
}] call EFUNC(common,addActionEventHandler);
|
|
|
|
_newUnit setVariable [QGVAR(AAEHID), _ehid];
|
|
|
|
// remove from old unit
|
|
_ehid = _oldUnit getVariable [QGVAR(AAEHID), -1];
|
|
|
|
[_oldUnit, "DefaultAction", _ehid] call EFUNC(common,removeActionEventHandler);
|
|
|
|
_oldUnit setVariable [QGVAR(AAEHID), -1];
|