From dc55ea517e4876f2b5557f817a2ada8b3c65f0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sat, 24 Jan 2015 14:02:47 -0300 Subject: [PATCH] interaction: cba keybinds --- addons/interaction/XEH_clientInit.sqf | 79 +++++++++++++++++++++++++++ addons/interaction/config.cpp | 27 --------- 2 files changed, 79 insertions(+), 27 deletions(-) diff --git a/addons/interaction/XEH_clientInit.sqf b/addons/interaction/XEH_clientInit.sqf index 85232d1fcd..58d96f188b 100644 --- a/addons/interaction/XEH_clientInit.sqf +++ b/addons/interaction/XEH_clientInit.sqf @@ -16,6 +16,85 @@ GVAR(isOpeningDoor) = false; // Add keybinds +["ACE3", + localize "STR_ACE_Interaction_InteractionMenu", + { + systemChat "A"; + // Conditions: canInteract + _exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", "ACE_Interaction_isNotEscorting", "ACE_Interaction_isNotSwimming"]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + systemChat "B"; + // Conditions: specific + if !(isNull (findDisplay 1713999)) exitWith {false}; + systemChat "C"; + + // Statement + call FUNC(onButtonDown); + true + }, + [219, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Interaction_InteractionMenu", + { + // Conditions: canInteract + _exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", "ACE_Interaction_isNotEscorting", "ACE_Interaction_isNotSwimming"]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(!isNull (findDisplay 1713999) && {profileNamespace getVariable [QGVAR(AutoCloseMenu), 0] > 0}) exitWith {false}; + + + // Statement + if (GVAR(MenuType) mod 2 == 0) then {call FUNC(onButtonUp)}; + true + }, + [219, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Interaction_InteractionMenuSelf", + { + systemChat "A"; + // Conditions: canInteract + _exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", "ACE_Interaction_isNotEscorting", "ACE_Interaction_isNotSwimming", "ACE_Common_notOnMap"]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + systemChat "B"; + // Conditions: specific + if !(isNull (findDisplay 1713999)) exitWith {false}; + systemChat "C"; + // Statement + call FUNC(onButtonDownSelf); + true + }, + [219, [false, true, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Interaction_InteractionMenuSelf", + { + // Conditions: canInteract + _exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", "ACE_Interaction_isNotEscorting", "ACE_Interaction_isNotSwimming"]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(!isNull (findDisplay 1713999) && {profileNamespace getVariable [QGVAR(AutoCloseMenu), 0] > 0}) exitWith {false}; + + + // Statement + if (GVAR(MenuType) mod 2 == 1) then {call FUNC(onButtonUp)}; + true + }, + [219, [false, true, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + ["ACE3", localize "STR_ACE_Interaction_OpenDoor", { diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index ceca76a02f..acb41d362f 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -18,33 +18,6 @@ class CfgPatches { #include -class ACE_Default_Keys { - class openInteractionMenuNew { - displayName = "$STR_ACE_Interaction_InteractionMenu"; - condition = "true"; - statement = QUOTE(call FUNC(onButtonDown)); - conditionUp = QUOTE(!isNull (findDisplay 1713999) && {profileNamespace getVariable [ARR_2(QUOTE(QGVAR(AutoCloseMenu)), false)]}); - statementUp = QUOTE(if (GVAR(MenuType) mod 2 == 0) then {call FUNC(onButtonUp)};); - exceptions[] = {"ACE_Drag_isNotDragging", "ACE_Medical_canTreat", "ACE_Interaction_isNotEscorting", "ACE_Interaction_isNotSwimming"}; - key = 219; - shift = 0; - control = 0; - alt = 0; - }; - class openInteractionMenuSelfNew { - displayName = "$STR_ACE_Interaction_InteractionMenuSelf"; - condition = "true"; - statement = QUOTE(call FUNC(onButtonDownSelf)); - conditionUp = QUOTE(!isNull (findDisplay 1713999) && {profileNamespace getVariable [ARR_2(QUOTE(QGVAR(AutoCloseMenu)), false)]}); - statementUp = QUOTE(if (EGVAR(interaction,MenuType) mod 2 == 1) then {call FUNC(onButtonUp)};); - exceptions[] = {"ACE_Drag_isNotDragging", "ACE_Medical_canTreat", "ACE_Interaction_isNotEscorting", "ACE_Interaction_isNotSwimming", "ACE_Common_notOnMap"}; - key = 219; - shift = 0; - control = 1; - alt = 0; - }; -}; - class ACE_Options { class Interaction_FlowMenu { displayName = "$STR_ACE_Interaction_FlowMenu";