diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index bcb2d5aa8e..ea4a971563 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -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); diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index c15f8d388d..b4a3504cdd 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -9,6 +9,7 @@ PREP(compileMenuSelfAction); PREP(collectActiveActionTree); PREP(createAction); PREP(findActionNode); +PREP(handlePlayerChanged); PREP(isSubPath); PREP(keyDown); PREP(keyUp); diff --git a/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf new file mode 100644 index 0000000000..fe25853733 --- /dev/null +++ b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf @@ -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 + * 1: Old unit to remove the addAction eh + * + * 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]; diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index fdd9a2e6b4..dddf90a4de 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -11,7 +11,8 @@ Toujours afficher le curseur pour les interactions sur soi-même - Display interact menu as a list + Display interaction menus as lists + Mostrar los menus de interacción como listas Interact Key