ACE3/addons/interaction/XEH_postInit.sqf

67 lines
2.2 KiB
Plaintext
Raw Normal View History

2015-04-13 05:23:00 +00:00
// by commy2 and esteldunedain
#include "script_component.hpp"
ACE_Modifier = 0;
if (!hasInterface) exitWith {};
GVAR(isOpeningDoor) = false;
// restore global fire teams for JIP
2015-09-28 12:35:05 +00:00
private "_team";
2015-04-13 05:23:00 +00:00
{
_team = _x getVariable [QGVAR(assignedFireTeam), ""];
if (_team != "") then {_x assignTeam _team};
2015-09-28 12:35:05 +00:00
false
} count allUnits;
2015-04-13 05:23:00 +00:00
2015-09-28 12:35:05 +00:00
// add keybinds
["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor), {
2015-04-13 05:23:00 +00:00
// Conditions: canInteract
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if (GVAR(isOpeningDoor) || {[MACRO_DOOR_REACH_DISTANCE] call FUNC(getDoor) select 1 == ''}) exitWith {false};
2015-04-13 05:23:00 +00:00
// Statement
call EFUNC(interaction,openDoor);
true
2015-09-28 12:35:05 +00:00
}, {
2015-04-13 05:23:00 +00:00
//Probably don't want any condidtions here, so variable never gets locked down
// Statement
GVAR(isOpeningDoor) = false;
true
},
2015-09-28 12:35:05 +00:00
[57, [false, true, false]], false] call CBA_fnc_addKeybind; //Key CTRL+Space
2015-04-13 05:23:00 +00:00
2015-09-28 12:35:05 +00:00
["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder), {
2015-04-13 05:23:00 +00:00
// Conditions: canInteract
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false};
// Statement
2015-05-15 18:52:09 +00:00
[ACE_player, cursorTarget, 0] call FUNC(tapShoulder);
2015-04-13 05:23:00 +00:00
true
},
{false},
2015-09-28 12:35:05 +00:00
[20, [true, false, false]], false] call CBA_fnc_addKeybind;
2015-04-13 05:23:00 +00:00
2015-09-28 12:35:05 +00:00
["ACE3 Common", QGVAR(modifierKey), localize LSTRING(ModifierKey), {
2015-04-13 05:23:00 +00:00
// Conditions: canInteract
//if !([ACE_player, objNull, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; // not needed
// Statement
ACE_Modifier = 1;
// Return false so it doesn't block other actions
false
2015-09-28 12:35:05 +00:00
}, {
2015-04-13 05:23:00 +00:00
//Probably don't want any condidtions here, so variable never gets locked down
ACE_Modifier = 0;
false;
},
2015-09-28 12:35:05 +00:00
[29, [false, false, false]], false] call CBA_fnc_addKeybind;
2015-04-13 05:23:00 +00:00
["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition);
["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition);