2015-04-15 03:19:03 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Disables firing while the menu is opened. Called from playerChanged eh.
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Arguments:
|
2015-04-15 04:20:20 +00:00
|
|
|
* 0: New unit to add the addAction eh <OBJECT>
|
|
|
|
* 1: Old unit to remove the addAction eh <STRING>
|
2015-04-15 03:19:03 +00:00
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Return Value:
|
2015-04-15 04:20:20 +00:00
|
|
|
* None
|
2015-04-15 03:19:03 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-04 22:46:57 +00:00
|
|
|
params ["_newUnit", "_oldUnit"];
|
2015-04-15 03:19:03 +00:00
|
|
|
|
|
|
|
// add to new unit
|
2016-01-08 04:43:37 +00:00
|
|
|
private _ehid = [_newUnit, "DefaultAction", {GVAR(openedMenuType) >= 0}, {
|
2015-05-02 20:53:23 +00:00
|
|
|
if (!GVAR(actionOnKeyRelease) && GVAR(actionSelected)) then {
|
2015-04-30 19:00:30 +00:00
|
|
|
[GVAR(openedMenuType),true] call FUNC(keyUp);
|
|
|
|
};
|
2015-04-25 06:23:54 +00:00
|
|
|
}] call EFUNC(common,addActionEventHandler);
|
2015-04-15 03:19:03 +00:00
|
|
|
|
|
|
|
_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];
|