Setting For Gestures - Fix BI* gestures

This commit is contained in:
PabstMirror 2015-12-08 23:08:09 -06:00
parent 0599b35fc6
commit 3d560108a3
6 changed files with 38 additions and 5 deletions

View File

@ -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)};
};
};

View File

@ -5,7 +5,7 @@ class CfgVehicles {
class ACE_SelfActions { class ACE_SelfActions {
class ADDON { class ADDON {
displayName = CSTRING(Gestures); displayName = CSTRING(Gestures);
condition = QUOTE(canStand _target && GVAR(ReloadMutex)); condition = QUOTE((canStand _target) && GVAR(ReloadMutex) && {GVAR(showOnInteractionMenu) == 2});
statement = ""; statement = "";
showDisabled = 1; showDisabled = 1;
priority = 3.5; priority = 3.5;

View File

@ -12,6 +12,7 @@ class CfgPatches {
}; };
}; };
#include "ACE_Settings.hpp"
#include "CfgMovesBasic.hpp" #include "CfgMovesBasic.hpp"
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"

View File

@ -18,10 +18,14 @@
TRACE_1("params",_this); TRACE_1("params",_this);
if (!GVAR(ReloadMutex)) exitWith {false}; 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] _this select [2]
} else { } else {
//Adjust gesture based on stance:
if (((animationState ACE_player) select [0, 12]) in ["amovpercmstp", "amovpercmwlk", "amovpercmtac"] && weaponLowered ACE_player) then { if (((animationState ACE_player) select [0, 12]) in ["amovpercmstp", "amovpercmwlk", "amovpercmtac"] && weaponLowered ACE_player) then {
format ["%1StandLowered", _this] format ["%1StandLowered", _this]
} else { } else {
@ -29,5 +33,6 @@ private _gesture = if (_this select [0,2] == "BI") then {
}; };
}; };
TRACE_1("playing gesture",_gesture);
ACE_player playAction _gesture; ACE_player playAction _gesture;
true true

View File

@ -3,11 +3,15 @@
{ {
_x params ["_currentName","_key"]; _x params ["_currentName","_key"];
if (_currentName select [0,1] == "BI") then { private _signalName = format [QGVAR(%1), _currentName];
_currentName = _currentName select [2]; 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", "ACE3 Gestures",

View File

@ -194,5 +194,17 @@
<Portuguese>Atacar</Portuguese> <Portuguese>Atacar</Portuguese>
<Italian>Attaccare</Italian> <Italian>Attaccare</Italian>
</Key> </Key>
<Key ID="STR_ACE_Gestures_showOnInteractionMenu_displayName">
<English>Show Gestures On Interaction Menu</English>
</Key>
<Key ID="STR_ACE_Gestures_showOnInteractionMenu_description">
<English>Show the gestures on the self interaction menu, or just keybinds, or disable completely</English>
</Key>
<Key ID="STR_ACE_Gestures_justKeybinds">
<English>Just Keybinds</English>
</Key>
<Key ID="STR_ACE_Gestures_keysAndInteractionMenu">
<English>KeyBinds + Interaction Menu</English>
</Key>
</Package> </Package>
</Project> </Project>