From 3d560108a31a2cdfe6107def5d68a45300c78526 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 8 Dec 2015 23:08:09 -0600 Subject: [PATCH] Setting For Gestures - Fix BI* gestures --- addons/gestures/ACE_Settings.hpp | 11 +++++++++++ addons/gestures/CfgVehicles.hpp | 2 +- addons/gestures/config.cpp | 1 + addons/gestures/functions/fnc_playSignal.sqf | 7 ++++++- addons/gestures/key.sqf | 10 +++++++--- addons/gestures/stringtable.xml | 12 ++++++++++++ 6 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 addons/gestures/ACE_Settings.hpp diff --git a/addons/gestures/ACE_Settings.hpp b/addons/gestures/ACE_Settings.hpp new file mode 100644 index 0000000000..a9e77807c0 --- /dev/null +++ b/addons/gestures/ACE_Settings.hpp @@ -0,0 +1,11 @@ +class ACE_Settings { + class GVAR(showOnInteractionMenu) { + value = 2; + typeName = "SCALAR"; + isClientSettable = 1; + category = ECSTRING(interact_menu,Category_InteractionMenu); + displayName = CSTRING(showOnInteractionMenu_displayName); + description = CSTRING(showOnInteractionMenu_description); + values[] = {"$STR_A3_OPTIONS_DISABLED", CSTRING(justKeybinds), CSTRING(keysAndInteractionMenu)}; + }; +}; diff --git a/addons/gestures/CfgVehicles.hpp b/addons/gestures/CfgVehicles.hpp index 019cffdb45..ffc20c0588 100644 --- a/addons/gestures/CfgVehicles.hpp +++ b/addons/gestures/CfgVehicles.hpp @@ -5,7 +5,7 @@ class CfgVehicles { class ACE_SelfActions { class ADDON { displayName = CSTRING(Gestures); - condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + condition = QUOTE((canStand _target) && GVAR(ReloadMutex) && {GVAR(showOnInteractionMenu) == 2}); statement = ""; showDisabled = 1; priority = 3.5; diff --git a/addons/gestures/config.cpp b/addons/gestures/config.cpp index 6a3fa402d0..39cb8f0951 100644 --- a/addons/gestures/config.cpp +++ b/addons/gestures/config.cpp @@ -12,6 +12,7 @@ class CfgPatches { }; }; +#include "ACE_Settings.hpp" #include "CfgMovesBasic.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" diff --git a/addons/gestures/functions/fnc_playSignal.sqf b/addons/gestures/functions/fnc_playSignal.sqf index b8a218f565..feb79f5370 100644 --- a/addons/gestures/functions/fnc_playSignal.sqf +++ b/addons/gestures/functions/fnc_playSignal.sqf @@ -18,10 +18,14 @@ TRACE_1("params",_this); if (!GVAR(ReloadMutex)) exitWith {false}; +if (GVAR(showOnInteractionMenu) == 0) exitWith {false}; +if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; -private _gesture = if (_this select [0,2] == "BI") then { +private _gesture = if ((_this select [0,2]) == "BI") then { + //If it starts with BI, just strip off the leading BI and use it directly _this select [2] } else { + //Adjust gesture based on stance: if (((animationState ACE_player) select [0, 12]) in ["amovpercmstp", "amovpercmwlk", "amovpercmtac"] && weaponLowered ACE_player) then { format ["%1StandLowered", _this] } else { @@ -29,5 +33,6 @@ private _gesture = if (_this select [0,2] == "BI") then { }; }; +TRACE_1("playing gesture",_gesture); ACE_player playAction _gesture; true diff --git a/addons/gestures/key.sqf b/addons/gestures/key.sqf index 125463d4d1..54d6d50c0c 100644 --- a/addons/gestures/key.sqf +++ b/addons/gestures/key.sqf @@ -3,11 +3,15 @@ { _x params ["_currentName","_key"]; - if (_currentName select [0,1] == "BI") then { - _currentName = _currentName select [2]; + private _signalName = format [QGVAR(%1), _currentName]; + if (_currentName select [0,2] == "BI") then { + //Don't add "ace_gestures_" prefix to BI gestures + _signalName = _currentName; }; - private _code = (compile format [QUOTE(QUOTE(QGVAR(%1)) call FUNC(playSignal);), _currentName]); + private _code = (compile format [QUOTE('%1' call FUNC(playSignal);), _signalName]); + + TRACE_4("Adding KeyBind",_currentName,_signalName,_code,_key); [ "ACE3 Gestures", diff --git a/addons/gestures/stringtable.xml b/addons/gestures/stringtable.xml index cc9b776cd1..e9d3cd060d 100644 --- a/addons/gestures/stringtable.xml +++ b/addons/gestures/stringtable.xml @@ -194,5 +194,17 @@ Atacar Attaccare + + Show Gestures On Interaction Menu + + + Show the gestures on the self interaction menu, or just keybinds, or disable completely + + + Just Keybinds + + + KeyBinds + Interaction Menu + \ No newline at end of file