interaction: cba keybinds

This commit is contained in:
Nicolás Badano 2015-01-18 19:38:58 -03:00
parent 112c9f319f
commit 058aa8d920
2 changed files with 92 additions and 34 deletions

View File

@ -10,6 +10,96 @@ GVAR(isOpeningDoor) = false;
// restore global fire teams for JIP
{
_team = _x getVariable [QGVAR(assignedFireTeam), ""];
if (_team != "") then {_x assignTeam _team};
_team = _x getVariable [QGVAR(assignedFireTeam), ""];
if (_team != "") then {_x assignTeam _team};
} forEach allUnits;
// Add keybinds
["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;
true
},
[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;
true
},
[29, [false, false, false]],
false,
"keyup"
] call cba_fnc_registerKeybind;

View File

@ -43,38 +43,6 @@ class ACE_Default_Keys {
control = 1;
alt = 0;
};
class openDoor {
displayName = "$STR_ACE_Interaction_OpenDoor";
condition = QUOTE(!GVAR(isOpeningDoor) && {[2] call FUNC(getDoor) select 1 != ''});
statement = QUOTE(call ACE_Interaction_fnc_openDoor);
conditionUp = QUOTE( GVAR(isOpeningDoor) );
statementUp = QUOTE( GVAR(isOpeningDoor) = false;);
key = 57;
shift = 0;
control = 1;
alt = 0;
};
class tapShoulder {
displayName = "$STR_ACE_Interaction_TapShoulder";
condition = QUOTE([_player, cursorTarget] call FUNC(canTapShoulder));
statement = QUOTE([_player, cursorTarget] call FUNC(tapShoulder););
key = 20;
shift = 1;
control = 0;
alt = 0;
};
class modifierKey {
displayName = "$STR_ACE_Interaction_ModifierKey";
condition = "";
statement = QUOTE(ACE_Modifier = 1;);
conditionUp = "";
statementUp = QUOTE(ACE_Modifier = 0;);
exceptions[] = {"ACE_Drag_isNotDragging"};
key = 29;
shift = 0;
control = 0;
alt = 0;
};
};
class ACE_Options {