mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #600 from acemod/lmbmenu
disable firing if menu is opened, fix #368, close #483
This commit is contained in:
commit
d7a0503dbc
@ -50,3 +50,6 @@ addMissionEventHandler ["Draw3D", DFUNC(render)];
|
||||
GVAR(actionSelected) = false;
|
||||
[] call FUNC(keyUp);
|
||||
}] call EFUNC(common,addEventhandler);
|
||||
|
||||
// disable firing while the interact menu is is is opened
|
||||
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventHandler);
|
||||
|
@ -9,6 +9,7 @@ PREP(compileMenuSelfAction);
|
||||
PREP(collectActiveActionTree);
|
||||
PREP(createAction);
|
||||
PREP(findActionNode);
|
||||
PREP(handlePlayerChanged);
|
||||
PREP(isSubPath);
|
||||
PREP(keyDown);
|
||||
PREP(keyUp);
|
||||
|
27
addons/interact_menu/functions/fnc_handlePlayerChanged.sqf
Normal file
27
addons/interact_menu/functions/fnc_handlePlayerChanged.sqf
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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"
|
||||
|
||||
EXPLODE_2_PVT(_this,_newUnit,_oldUnit);
|
||||
|
||||
// add to new unit
|
||||
private "_ehid";
|
||||
_ehid = [_newUnit, "DefaultAction", {EGVAR(interact_menu,openedMenuType) >= 0}, {}] 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];
|
Loading…
Reference in New Issue
Block a user