ACE3/addons/interaction/XEH_clientInit.sqf

71 lines
2.0 KiB
Plaintext
Raw Normal View History

2015-03-24 04:18:00 +00:00
// by commy2 and esteldunedain
2015-01-11 19:32:51 +00:00
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-03-05 07:32:26 +00:00
["ACE3", QGVAR(openDoor), localize "STR_ACE_Interaction_OpenDoor",
{
// Conditions: canInteract
2015-03-20 22:55:39 +00:00
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
2015-03-05 07:32:26 +00:00
// Conditions: specific
if (GVAR(isOpeningDoor) || {[2] call FUNC(getDoor) select 1 == ''}) exitWith {false};
2015-03-05 07:32:26 +00:00
// Statement
call EFUNC(interaction,openDoor);
true
},
{
//Probably don't want any condidtions here, so variable never gets locked down
2015-03-05 07:32:26 +00:00
// Statement
GVAR(isOpeningDoor) = false;
true
},
[57, [false, true, false]], false] call cba_fnc_addKeybind; //Key CTRL+Space
2015-01-18 22:38:58 +00:00
["ACE3", QGVAR(tapShoulder), localize "STR_ACE_Interaction_TapShoulder",
2015-03-05 07:32:26 +00:00
{
// Conditions: canInteract
2015-03-20 22:55:39 +00:00
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
2015-03-05 07:32:26 +00:00
// Conditions: specific
if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false};
// Statement
[ACE_player, cursorTarget] call FUNC(tapShoulder);
true
},
{false},
[20, [true, false, false]], false] call cba_fnc_addKeybind;
2015-01-18 22:38:58 +00:00
["ACE3", QGVAR(modifierKey), localize "STR_ACE_Interaction_ModifierKey",
2015-03-05 07:32:26 +00:00
{
// Conditions: canInteract
2015-03-20 22:55:39 +00:00
//if !([ACE_player, objNull, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; // not needed
2015-03-05 07:32:26 +00:00
// Statement
ACE_Modifier = 1;
// Return false so it doesn't block other actions
false
},
{
//Probably don't want any condidtions here, so variable never gets locked down
2015-03-05 07:32:26 +00:00
ACE_Modifier = 0;
false;
2015-03-05 07:32:26 +00:00
},
[29, [false, false, false]], false] call cba_fnc_addKeybind;
2015-03-15 08:26:16 +00:00
2015-03-15 15:12:37 +00:00
["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition);