From be17b72cada5a20460708741ed87f9c4d96a22f3 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 7 Jul 2016 16:38:24 +0200 Subject: [PATCH] remove old 'gestures' reload mutex --- addons/gestures/CfgEventHandlers.hpp | 6 ---- addons/gestures/CfgVehicles.hpp | 2 +- addons/gestures/XEH_missionDisplayLoad.sqf | 32 -------------------- addons/gestures/XEH_postInit.sqf | 3 -- addons/gestures/functions/fnc_playSignal.sqf | 2 +- 5 files changed, 2 insertions(+), 43 deletions(-) delete mode 100644 addons/gestures/XEH_missionDisplayLoad.sqf diff --git a/addons/gestures/CfgEventHandlers.hpp b/addons/gestures/CfgEventHandlers.hpp index 83a4cf763c..becf395052 100644 --- a/addons/gestures/CfgEventHandlers.hpp +++ b/addons/gestures/CfgEventHandlers.hpp @@ -16,9 +16,3 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; - -class Extended_DisplayLoad_EventHandlers { - class RscDisplayMission { - ADDON = QUOTE(_this call COMPILE_FILE(XEH_missionDisplayLoad)); - }; -}; diff --git a/addons/gestures/CfgVehicles.hpp b/addons/gestures/CfgVehicles.hpp index 2c099bcc45..d91c6df95e 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) && {GVAR(showOnInteractionMenu) == 2}); + condition = QUOTE((canStand _target) && {GVAR(showOnInteractionMenu) == 2}); statement = ""; showDisabled = 1; priority = 3.5; diff --git a/addons/gestures/XEH_missionDisplayLoad.sqf b/addons/gestures/XEH_missionDisplayLoad.sqf deleted file mode 100644 index 856f361d3a..0000000000 --- a/addons/gestures/XEH_missionDisplayLoad.sqf +++ /dev/null @@ -1,32 +0,0 @@ -#include "script_component.hpp" - -disableSerialization; - -params ["_display"]; - -_display displayAddEventHandler ["KeyDown", { - if ((_this select 1) in actionKeys "ReloadMagazine") then { - if (isNull ACE_player || {!alive ACE_player}) exitWith {false}; - - private _weapon = currentWeapon ACE_player; - - if (_weapon != "") then { - GVAR(ReloadMutex) = false; - - private _gesture = getText (configfile >> "CfgWeapons" >> _weapon >> "reloadAction"); - private _isLauncher = _weapon isKindOf ["Launcher", configFile >> "CfgWeapons"]; - private _config = ["CfgGesturesMale", "CfgMovesMaleSdr"] select _isLauncher; - private _duration = getNumber (configfile >> _config >> "States" >> _gesture >> "speed"); - - if (_duration != 0) then { - _duration = if (_duration < 0) then { abs _duration } else { 1 / _duration }; - } else { - _duration = 3; - }; - - TRACE_2("Reloading, blocking gestures",_weapon,_duration); - [{GVAR(ReloadMutex) = true;}, [], _duration] call CBA_fnc_waitAndExecute; - }; - }; - false -}]; diff --git a/addons/gestures/XEH_postInit.sqf b/addons/gestures/XEH_postInit.sqf index 6d9e057e29..b68df0a592 100644 --- a/addons/gestures/XEH_postInit.sqf +++ b/addons/gestures/XEH_postInit.sqf @@ -2,9 +2,6 @@ if (!hasInterface) exitWith {}; -// reload mutex, you can't play signal while reloading -GVAR(ReloadMutex) = true; - // Add keybinds { _x params ["_currentName", "_key", ["_vanillaKey", false] ]; diff --git a/addons/gestures/functions/fnc_playSignal.sqf b/addons/gestures/functions/fnc_playSignal.sqf index 8f20c690ef..56c3bceb01 100644 --- a/addons/gestures/functions/fnc_playSignal.sqf +++ b/addons/gestures/functions/fnc_playSignal.sqf @@ -17,7 +17,7 @@ TRACE_1("params",_this); -if (!GVAR(ReloadMutex)) exitWith {false}; +if (EGVAR(common,isReloading)) exitWith {false}; if (GVAR(showOnInteractionMenu) == 0) exitWith {false}; if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};