2015-08-02 14:56:27 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-11-30 16:14:05 +00:00
|
|
|
if (!hasInterface) exitWith {};
|
2015-08-06 21:51:17 +00:00
|
|
|
|
2015-10-13 07:01:59 +00:00
|
|
|
GVAR(MenuPFHID) = -1;
|
|
|
|
GVAR(lastOpenedOn) = -1;
|
|
|
|
GVAR(pendingReopen) = false;
|
|
|
|
|
2016-06-24 13:45:13 +00:00
|
|
|
["ace_treatmentSucceded", {
|
2015-08-06 21:51:17 +00:00
|
|
|
if (GVAR(openAfterTreatment) && {GVAR(pendingReopen)}) then {
|
|
|
|
GVAR(pendingReopen) = false;
|
|
|
|
[{
|
|
|
|
[GVAR(INTERACTION_TARGET)] call FUNC(openMenu);
|
2016-05-22 13:27:24 +00:00
|
|
|
}, []] call CBA_fnc_execNextFrame;
|
2015-08-06 21:51:17 +00:00
|
|
|
};
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2015-08-06 21:51:17 +00:00
|
|
|
|
2015-08-08 16:16:25 +00:00
|
|
|
["ACE3 Common", QGVAR(displayMenuKeyPressed), localize LSTRING(DisplayMenuKey),
|
2015-08-06 21:51:17 +00:00
|
|
|
{
|
2015-11-17 16:43:07 +00:00
|
|
|
private _target = cursorTarget;
|
2015-10-13 07:01:59 +00:00
|
|
|
if (!((_target isKindOf "CAManBase") && {[ACE_player, _target] call FUNC(canOpenMenu)})) then {_target = ACE_player};
|
|
|
|
|
2015-08-06 21:51:17 +00:00
|
|
|
// Conditions: canInteract
|
2017-08-22 18:30:56 +00:00
|
|
|
if !([ACE_player, _target, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
2015-11-30 16:14:05 +00:00
|
|
|
if !([ACE_player, _target] call FUNC(canOpenMenu)) exitWith {false};
|
2015-08-06 21:51:17 +00:00
|
|
|
|
|
|
|
// Statement
|
|
|
|
[_target] call FUNC(openMenu);
|
|
|
|
false
|
|
|
|
},
|
|
|
|
{
|
2016-03-02 10:01:39 +00:00
|
|
|
if (CBA_missionTime - GVAR(lastOpenedOn) > 0.5) exitWith {
|
2015-10-13 07:01:59 +00:00
|
|
|
[objNull] call FUNC(openMenu);
|
2015-08-06 21:51:17 +00:00
|
|
|
};
|
2015-08-19 18:32:46 +00:00
|
|
|
false
|
2015-08-06 21:51:17 +00:00
|
|
|
},
|
2015-08-08 16:16:25 +00:00
|
|
|
[35, [false, false, false]], false, 0] call CBA_fnc_addKeybind;
|