2015-01-11 19:32:51 +00:00
|
|
|
// by commy2 and CAA-Picard
|
|
|
|
|
2015-01-11 23:13:47 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-01-15 20:15:39 +00:00
|
|
|
ACE_Modifier = 0;
|
|
|
|
|
2015-01-11 19:32:51 +00:00
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
2015-01-11 23:13:47 +00:00
|
|
|
GVAR(isOpeningDoor) = false;
|
2015-01-11 19:32:51 +00:00
|
|
|
|
|
|
|
// restore global fire teams for JIP
|
|
|
|
{
|
2015-01-18 22:38:58 +00:00
|
|
|
_team = _x getVariable [QGVAR(assignedFireTeam), ""];
|
|
|
|
if (_team != "") then {_x assignTeam _team};
|
2015-01-11 19:32:51 +00:00
|
|
|
} forEach allUnits;
|
2015-01-18 22:38:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Add keybinds
|
2015-01-24 17:02:47 +00:00
|
|
|
["ACE3",
|
|
|
|
localize "STR_ACE_Interaction_InteractionMenu",
|
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
2015-02-06 05:11:28 +00:00
|
|
|
_exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", QEGVAR(captives,isNotEscorting), "ACE_Interaction_isNotSwimming"];
|
2015-01-24 17:02:47 +00:00
|
|
|
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
|
|
|
// Conditions: specific
|
|
|
|
if !(isNull (findDisplay 1713999)) exitWith {false};
|
|
|
|
|
|
|
|
// Statement
|
|
|
|
call FUNC(onButtonDown);
|
|
|
|
true
|
|
|
|
},
|
|
|
|
[219, [false, false, false]],
|
|
|
|
false,
|
|
|
|
"keydown"
|
|
|
|
] call cba_fnc_registerKeybind;
|
|
|
|
|
|
|
|
["ACE3",
|
|
|
|
localize "STR_ACE_Interaction_InteractionMenu",
|
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
2015-02-06 05:11:28 +00:00
|
|
|
_exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", QEGVAR(captives,isNotEscorting), "ACE_Interaction_isNotSwimming"];
|
2015-01-24 17:02:47 +00:00
|
|
|
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
|
|
|
// Conditions: specific
|
2015-01-30 22:19:45 +00:00
|
|
|
if !(!isNull (findDisplay 1713999) && {QGVAR(AutoCloseMenu)}) exitWith {false};
|
2015-01-24 17:02:47 +00:00
|
|
|
|
|
|
|
// Statement
|
|
|
|
if (GVAR(MenuType) mod 2 == 0) then {call FUNC(onButtonUp)};
|
|
|
|
true
|
|
|
|
},
|
|
|
|
[219, [false, false, false]],
|
|
|
|
false,
|
2015-01-24 17:30:30 +00:00
|
|
|
"keyup"
|
2015-01-24 17:02:47 +00:00
|
|
|
] call cba_fnc_registerKeybind;
|
|
|
|
|
|
|
|
["ACE3",
|
|
|
|
localize "STR_ACE_Interaction_InteractionMenuSelf",
|
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
2015-02-06 21:54:26 +00:00
|
|
|
_exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", QEGVAR(captives,isNotEscorting), QEGVAR(captives,isNotSurrendering), "ACE_Interaction_isNotSwimming", "ACE_Common_notOnMap"];
|
2015-01-24 17:02:47 +00:00
|
|
|
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
|
|
|
// Conditions: specific
|
|
|
|
if !(isNull (findDisplay 1713999)) exitWith {false};
|
2015-01-24 18:40:41 +00:00
|
|
|
|
2015-01-24 17:02:47 +00:00
|
|
|
// Statement
|
|
|
|
call FUNC(onButtonDownSelf);
|
|
|
|
true
|
|
|
|
},
|
|
|
|
[219, [false, true, false]],
|
|
|
|
false,
|
|
|
|
"keydown"
|
|
|
|
] call cba_fnc_registerKeybind;
|
|
|
|
|
|
|
|
["ACE3",
|
|
|
|
localize "STR_ACE_Interaction_InteractionMenuSelf",
|
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
2015-02-06 21:54:26 +00:00
|
|
|
_exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", QEGVAR(captives,isNotEscorting), QEGVAR(captives,isNotSurrendering), "ACE_Interaction_isNotSwimming"];
|
2015-01-24 17:02:47 +00:00
|
|
|
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
|
|
|
// Conditions: specific
|
2015-01-30 22:19:45 +00:00
|
|
|
if !(!isNull (findDisplay 1713999) && {QGVAR(AutoCloseMenu)}) exitWith {false};
|
2015-01-24 17:02:47 +00:00
|
|
|
|
|
|
|
// Statement
|
|
|
|
if (GVAR(MenuType) mod 2 == 1) then {call FUNC(onButtonUp)};
|
|
|
|
true
|
|
|
|
},
|
|
|
|
[219, [false, true, false]],
|
|
|
|
false,
|
2015-01-24 17:30:30 +00:00
|
|
|
"keyup"
|
2015-01-24 17:02:47 +00:00
|
|
|
] call cba_fnc_registerKeybind;
|
|
|
|
|
2015-01-18 22:38:58 +00:00
|
|
|
["ACE3",
|
|
|
|
localize "STR_ACE_Interaction_OpenDoor",
|
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
|
|
|
_exceptions = [];
|
|
|
|
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
|
|
|
// Conditions: specific
|
|
|
|
if !(!GVAR(isOpeningDoor) &&
|
|
|
|
{[2] call FUNC(getDoor) select 1 != ''}
|
|
|
|
) exitWith {false};
|
|
|
|
|
|
|
|
// Statement
|
|
|
|
call EFUNC(interaction,openDoor);
|
|
|
|
true
|
|
|
|
},
|
|
|
|
[57, [false, true, false]],
|
|
|
|
false,
|
|
|
|
"keydown"
|
|
|
|
] call cba_fnc_registerKeybind;
|
|
|
|
|
|
|
|
["ACE3",
|
|
|
|
localize "STR_ACE_Interaction_OpenDoor",
|
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
|
|
|
_exceptions = [];
|
|
|
|
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
|
|
|
// Conditions: specific
|
|
|
|
if !(GVAR(isOpeningDoor)) exitWith {false};
|
|
|
|
|
|
|
|
// Statement
|
|
|
|
GVAR(isOpeningDoor) = false;
|
|
|
|
true
|
|
|
|
},
|
|
|
|
[57, [false, true, false]],
|
|
|
|
false,
|
|
|
|
"keyup"
|
|
|
|
] call cba_fnc_registerKeybind;
|
|
|
|
|
|
|
|
["ACE3",
|
|
|
|
localize "STR_ACE_Interaction_TapShoulder",
|
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
|
|
|
_exceptions = [];
|
|
|
|
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
|
|
|
// Conditions: specific
|
|
|
|
if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false};
|
|
|
|
|
|
|
|
// Statement
|
|
|
|
[ACE_player, cursorTarget] call FUNC(tapShoulder);
|
|
|
|
true
|
|
|
|
},
|
|
|
|
[20, [true, false, false]],
|
|
|
|
false,
|
|
|
|
"keydown"
|
|
|
|
] call cba_fnc_registerKeybind;
|
|
|
|
|
|
|
|
["ACE3",
|
|
|
|
localize "STR_ACE_Interaction_ModifierKey",
|
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
|
|
|
_exceptions = ["ACE_Drag_isNotDragging"];
|
|
|
|
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
|
|
|
|
|
|
|
// Statement
|
|
|
|
ACE_Modifier = 1;
|
2015-01-20 04:12:30 +00:00
|
|
|
// Return false so it doesn't block other actions
|
|
|
|
false
|
2015-01-18 22:38:58 +00:00
|
|
|
},
|
|
|
|
[29, [false, false, false]],
|
|
|
|
false,
|
|
|
|
"keydown"
|
|
|
|
] call cba_fnc_registerKeybind;
|
|
|
|
|
|
|
|
["ACE3",
|
|
|
|
localize "STR_ACE_Interaction_ModifierKey",
|
|
|
|
{
|
|
|
|
// Conditions: canInteract
|
|
|
|
_exceptions = ["ACE_Drag_isNotDragging"];
|
|
|
|
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
|
|
|
|
|
|
|
// Statement
|
|
|
|
ACE_Modifier = 0;
|
2015-01-20 04:12:30 +00:00
|
|
|
// Return false so it doesn't block other actions
|
|
|
|
false
|
2015-01-18 22:38:58 +00:00
|
|
|
},
|
|
|
|
[29, [false, false, false]],
|
|
|
|
false,
|
|
|
|
"keyup"
|
|
|
|
] call cba_fnc_registerKeybind;
|