From 075d1d6d9ecd40c7ffa7df28c0752168dfdce5c1 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 17 Feb 2015 10:24:03 +0100 Subject: [PATCH 01/10] Refine bullet tracing in FCS extension Gradually increase simulation step as the projectile approaches the target and improve the calculation of the final bullet drop. Untested. (#65) --- extensions/ace_fcs.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/extensions/ace_fcs.cpp b/extensions/ace_fcs.cpp index 0b6788e7d1..81c515e0aa 100644 --- a/extensions/ace_fcs.cpp +++ b/extensions/ace_fcs.cpp @@ -21,7 +21,6 @@ #include #define MAXELEVATION 20 -#define SIMULATIONSTEP 0.05 #define MAXITERATIONS 120 #define PRECISION 0.1 #define RADIANS(X) (X / (180 / M_PI)) @@ -45,7 +44,7 @@ std::vector splitString(std::string input) { } double traceBullet(double initSpeed, double airFriction, double angle, double angleTarget, double distance) { - double velX, velY, posX, posY, posTargetX, posTargetY, velMag; + double velX, velY, posX, posY, lastPosX, lastPosY, posTargetX, posTargetY, velMag; velX = cos(RADIANS(angle)) * initSpeed; velY = sin(RADIANS(angle)) * initSpeed; posX = 0; @@ -53,18 +52,24 @@ double traceBullet(double initSpeed, double airFriction, double angle, double an posTargetX = cos(RADIANS(angleTarget)) * distance; posTargetY = sin(RADIANS(angleTarget)) * distance; + double simulationStep = 0.05; + int i = 0; while (i < MAXITERATIONS) { + lastPosX = posX; + lastPosY = posY; + simulationStep = 0.1 - 0.049 * (posX / posTargetX); velMag = sqrt(pow(velX, 2) + pow(velY, 2)); - velX += SIMULATIONSTEP * (velX * velMag * airFriction); - velY += SIMULATIONSTEP * (velY * velMag * airFriction - 9.81); - posX += velX * SIMULATIONSTEP; - posY += velY * SIMULATIONSTEP; + velX += simulationStep * (velX * velMag * airFriction); + velY += simulationStep * (velY * velMag * airFriction - 9.81); + posX += velX * simulationStep; + posY += velY * simulationStep; if (posX >= posTargetX) { break; } i++; } - return posY - posTargetY; + double coef = (posTargetX - lastPosX) / (posX - lastPosX); + return (lastPosY + (posY - lastPosY) * coef) - posTargetY; } double getSolution(double initSpeed, double airFriction, double angleTarget, double distance) { From 18b083d2aa4a9790b536ac013a29013c9f3991e6 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Wed, 18 Feb 2015 17:03:44 +0100 Subject: [PATCH 02/10] Build DLL with changes from 075d1d6 --- ace_fcs.dll | Bin 32256 -> 32256 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/ace_fcs.dll b/ace_fcs.dll index 9907d9e1a0e62311cf9d792f9f5d121db9d03902..7c222dc1d7cd97b28070e7e7fa45baafd34d66b6 100644 GIT binary patch delta 3747 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 K1;1UGsrx^e*aH0k delta 3568 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 Date: Thu, 5 Mar 2015 01:32:26 -0600 Subject: [PATCH 03/10] Key Bind Redo (except vector) --- addons/fcs/initKeybinds.sqf | 122 +++---- addons/goggles/XEH_postInit.sqf | 128 +++---- addons/grenades/XEH_postInit.sqf | 27 +- addons/interact_menu/XEH_clientInit.sqf | 26 +- addons/interaction/XEH_clientInit.sqf | 147 ++++---- addons/movement/XEH_postInit.sqf | 29 +- addons/nametags/XEH_postInit.sqf | 29 +- addons/nightvision/XEH_postInitClient.sqf | 18 +- addons/overheating/XEH_postInit.sqf | 33 +- addons/parachute/XEH_postInit.sqf | 34 +- addons/reload/XEH_postInit.sqf | 31 +- addons/resting/XEH_postInit.sqf | 37 +- addons/safemode/XEH_postInit.sqf | 31 +- addons/scopes/XEH_postInit.sqf | 124 +++---- addons/vehicles/XEH_postInit.sqf | 33 +- addons/weaponselect/XEH_postInit.sqf | 406 ++++++++++------------ 16 files changed, 565 insertions(+), 690 deletions(-) diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index dd1a94b78e..31fae97601 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -1,81 +1,57 @@ // by commy2 -["ACE3", - localize "STR_ACE_FCS_LaseTarget", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; +["ACE3", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; - // prevent holding down - if (GETGVAR(isDownStateKey1,false)) exitWith {false}; - GVAR(isDownStateKey1) = true; + // Statement + [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown); + // Return false so it doesn't block the rest weapon action + false +}, +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false}; - // Statement - [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown); - // Return false so it doesn't block the rest weapon action - false - }, - [15, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp); + false +}, +[15, [false, false, false]], false] call cba_fnc_addKeybind; //Tab Key -["ACE3", - localize "STR_ACE_FCS_LaseTarget", - { - // prevent holding down - GVAR(isDownStateKey1) = false; +["ACE3", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false}; + // Statement + [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange); + true +}, +{}, +[201, [false, false, false]], false] call cba_fnc_addKeybind; //PageUp Key - // Statement - [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp); - false - }, - [15, [false, false, false]], - false, - "keyup" -] call cba_fnc_registerKeybind; +["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; -["ACE3", - localize "STR_ACE_FCS_AdjustRangeUp", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; - - // Statement - [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange); - true - }, - [201, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; - -["ACE3", - localize "STR_ACE_FCS_AdjustRangeDown", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; - - // Statement - [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange); - true - }, - [209, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange); + true +}, +{}, +[209, [false, false, false]], false] call cba_fnc_addKeybind; //PageDown Key diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 4c7160bdb3..6b90564746 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -17,17 +17,19 @@ #include "script_component.hpp" if (!hasInterface) exitWith {}; -["ACE3", localize "STR_ACE_Goggles_WipeGlasses", +["ACE3", QGVAR(wipeGlasses), localize "STR_ACE_Goggles_WipeGlasses", { - if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith { - call FUNC(clearGlasses); - true - }; - false -}, [20, true, true, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind); + if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith { + call FUNC(clearGlasses); + true + }; + false +}, +{}, +[20, true, true, false], false] call CALLSTACK(cba_fnc_addKeybind); if isNil(QGVAR(UsePP)) then { - GVAR(UsePP) = true; + GVAR(UsePP) = true; }; GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995]; @@ -47,78 +49,78 @@ GVAR(RainActive) = false; GVAR(RainLastLevel) = 0; FUNC(CheckGlasses) = { - if (GVAR(Current) != (goggles ace_player)) then { - GVAR(Current) = (goggles ace_player); - ["GlassesChanged",[GVAR(Current)]] call EFUNC(common,localEvent); - }; + if (GVAR(Current) != (goggles ace_player)) then { + GVAR(Current) = (goggles ace_player); + ["GlassesChanged",[GVAR(Current)]] call EFUNC(common,localEvent); + }; }; player addEventHandler ["Explosion", { - if (alive ace_player) then { - call FUNC(ApplyDirtEffect); - if (GETBROKEN) exitWith {}; - if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {}; - if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);}; - _effects = GETGLASSES(ace_player); - _effects set [BROKEN, true]; - SETGLASSES(ace_player,_effects); - if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then { - if (call FUNC(ExternalCamera)) exitWith {}; - if (isNull(GLASSDISPLAY)) then { - 150 cutRsc["RscACE_Goggles", "PLAIN",1, false]; - }; - (GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked"); + if (alive ace_player) then { + call FUNC(ApplyDirtEffect); + if (GETBROKEN) exitWith {}; + if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {}; + if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);}; + _effects = GETGLASSES(ace_player); + _effects set [BROKEN, true]; + SETGLASSES(ace_player,_effects); + if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then { + if (call FUNC(ExternalCamera)) exitWith {}; + if (isNull(GLASSDISPLAY)) then { + 150 cutRsc["RscACE_Goggles", "PLAIN",1, false]; + }; + (GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked"); + }; + ["GlassesCracked",[ace_player]] call EFUNC(common,localEvent); }; - ["GlassesCracked",[ace_player]] call EFUNC(common,localEvent); - }; }]; player addEventHandler ["Killed",{ - GVAR(PostProcessEyes) ppEffectEnable false; - SETGLASSES(ace_player,GLASSESDEFAULT); - call FUNC(removeGlassesEffect); - GVAR(EffectsActive)=false; - ace_player setVariable ["ACE_EyesDamaged", false]; - if (GVAR(EyesDamageScript) != -1) then { - [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler); - }; - if (GVAR(DustHandler) != -1) then { - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; - }; + GVAR(PostProcessEyes) ppEffectEnable false; + SETGLASSES(ace_player,GLASSESDEFAULT); + call FUNC(removeGlassesEffect); + GVAR(EffectsActive)=false; + ace_player setVariable ["ACE_EyesDamaged", false]; + if (GVAR(EyesDamageScript) != -1) then { + [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler); + }; + if (GVAR(DustHandler) != -1) then { + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; + }; }]; player addEventHandler ["Fired",{[_this select 0, _this select 1] call FUNC(dustHandler);}]; player AddEventHandler ["Take",{call FUNC(checkGlasses);}]; player AddEventHandler ["Put", {call FUNC(checkGlasses);}]; ["GlassesChanged",{ - SETGLASSES(ace_player,GLASSESDEFAULT); + SETGLASSES(ace_player,GLASSESDEFAULT); - if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)}; + if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)}; - if ([ace_player] call FUNC(isGogglesVisible)) then { - [_this select 0] call FUNC(applyGlassesEffect); - } else { - call FUNC(removeGlassesEffect); - }; + if ([ace_player] call FUNC(isGogglesVisible)) then { + [_this select 0] call FUNC(applyGlassesEffect); + } else { + call FUNC(removeGlassesEffect); + }; }] call EFUNC(common,addEventHandler); ["GlassesCracked",{ - if (_this select 0 != ace_player) exitWith {}; - ace_player setVariable ["ACE_EyesDamaged", true]; - if (GVAR(EyesDamageScript) != -1) then { - [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler); - }; - GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 0; - GVAR(PostProcessEyes) ppEffectEnable true; - GVAR(EyesDamageScript) = [{ - GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 5; + if (_this select 0 != ace_player) exitWith {}; + ace_player setVariable ["ACE_EyesDamaged", true]; + if (GVAR(EyesDamageScript) != -1) then { + [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler); + }; + GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 0; + GVAR(PostProcessEyes) ppEffectEnable true; GVAR(EyesDamageScript) = [{ - GVAR(PostProcessEyes) ppEffectEnable false; - ace_player setVariable ["ACE_EyesDamaged", false]; - GVAR(EyesDamageScript) = -1; - }, [], 5, 1] call EFUNC(common,waitAndExecute); - }, [], 25, 5] call EFUNC(common,waitAndExecute); + GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 5; + GVAR(EyesDamageScript) = [{ + GVAR(PostProcessEyes) ppEffectEnable false; + ace_player setVariable ["ACE_EyesDamaged", false]; + GVAR(EyesDamageScript) = -1; + }, [], 5, 1] call EFUNC(common,waitAndExecute); + }, [], 25, 5] call EFUNC(common,waitAndExecute); }] call EFUNC(common,addEventHandler); call FUNC(checkGlasses); [FUNC(CheckGoggles), 1, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index 0b6bb16ffb..f9aef6bef1 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -10,19 +10,16 @@ GVAR(flashbangPPEffectCC) = ppEffectCreate ["ColorCorrections", 4265]; GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; // Add keybinds -["ACE3", - localize "STR_ACE_Grenades_SwitchGrenadeMode", - { - // Conditions: canInteract - _exceptions = [QEGVAR(captives,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false}; +["ACE3", QGVAR(switchGrenadeMode), localize "STR_ACE_Grenades_SwitchGrenadeMode", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(captives,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false}; - // Statement - [] call FUNC(nextMode); - }, - [9, [false, false, false]], //8 key - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [] call FUNC(nextMode); +}, +{}, +[9, [false, false, false]], false] call cba_fnc_addKeybind; //8 Key diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index c068a15882..b804ea970f 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -6,30 +6,12 @@ _fnc = { }; addMissionEventHandler ["Draw3D", _fnc]; -["ACE3", -"Interact Key", +["ACE3", QGVAR(InteractKey), "Interact Key", {_this call FUNC(keyDown)}, -[219, [false, false, false]], -false, -"keydown"] call cba_fnc_registerKeybind; - -["ACE3", -"Interact Key", {_this call FUNC(keyUp)}, -[219, [false, false, false]], -false, -"keyUp"] call cba_fnc_registerKeybind; +[219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key -["ACE3", -"Self Actions Key", +["ACE3", QGVAR(SelfInteractKey), "Self Actions Key", {_this call FUNC(keyDownSelfAction)}, -[219, [false, true, false]], -false, -"keydown"] call cba_fnc_registerKeybind; - -["ACE3", -"Self Actions Key", {_this call FUNC(keyUpSelfAction)}, -[219, [false, true, false]], -false, -"keyUp"] call cba_fnc_registerKeybind; \ No newline at end of file +[219, [false, true, false]], false] call cba_fnc_addKeybind; //Left Windows Key + Ctrl/Strg diff --git a/addons/interaction/XEH_clientInit.sqf b/addons/interaction/XEH_clientInit.sqf index 85232d1fcd..89001b0039 100644 --- a/addons/interaction/XEH_clientInit.sqf +++ b/addons/interaction/XEH_clientInit.sqf @@ -16,92 +16,89 @@ GVAR(isOpeningDoor) = false; // 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}; +["ACE3", QGVAR(openDoor), 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" + // Statement + call EFUNC(interaction,openDoor); + true +}, +{}, +[57, [false, true, false]], false] call cba_fnc_addKeybind; + +["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_OpenDoor", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(GVAR(isOpeningDoor)) exitWith {false}; +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 - GVAR(isOpeningDoor) = false; - true - }, - [57, [false, true, false]], - false, - "keyup" + // Statement + [ACE_player, cursorTarget] call FUNC(tapShoulder); + true +}, +[20, [true, false, false]], +false, +"keydown" ] 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}; +localize "STR_ACE_Interaction_ModifierKey", +{ + // Conditions: canInteract + _exceptions = ["ACE_Drag_isNotDragging"]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Statement - [ACE_player, cursorTarget] call FUNC(tapShoulder); - true - }, - [20, [true, false, false]], - false, - "keydown" + // Statement + ACE_Modifier = 1; + // Return false so it doesn't block other actions + false +}, +[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}; +localize "STR_ACE_Interaction_ModifierKey", +{ + // Conditions: canInteract + _exceptions = ["ACE_Drag_isNotDragging"]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Statement - ACE_Modifier = 1; - // Return false so it doesn't block other actions - false - }, - [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; - // Return false so it doesn't block other actions - false - }, - [29, [false, false, false]], - false, - "keyup" + // Statement + ACE_Modifier = 0; + // Return false so it doesn't block other actions + false +}, +[29, [false, false, false]], +false, +"keyup" ] call cba_fnc_registerKeybind; diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index 54a94ad21f..42c5c17ad1 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -18,20 +18,17 @@ }] call EFUNC(common,addEventHandler); -["ACE3", - localize "STR_ACE_Movement_Climb", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if (ACE_player != (vehicle ACE_player)) exitWith {false}; +["ACE3", QGVAR(climb), localize "STR_ACE_Movement_Climb", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if (ACE_player != (vehicle ACE_player)) exitWith {false}; - // Statement - [ACE_player] call FUNC(climb); - true - }, - [47, [false, true, false]], //DIK_V + CTRL//STRG - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player] call FUNC(climb); + true +}, +{}, +[47, [false, true, false]], false] call cba_fnc_addKeybind; //DIK_V + CTRL//STRG diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index 1ad0e38879..406bf867e3 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -7,23 +7,20 @@ if (!hasInterface) exitWith {}; // Add keybinds -["ACE3", - localize "STR_ACE_NameTags_ShowNames", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; +["ACE3", QGVAR(showNameTags), localize "STR_ACE_NameTags_ShowNames", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Statement - GVAR(ShowNamesTime) = time; - if (call FUNC(canShow)) then{ call FUNC(doShow); }; - // Return false so it doesn't block other actions - false - }, - [29, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + GVAR(ShowNamesTime) = time; + if (call FUNC(canShow)) then{ call FUNC(doShow); }; + // Return false so it doesn't block other actions + false +}, +{}, +[29, [false, false, false]], false] call cba_fnc_addKeybind; //LeftControl Key // Draw handle diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index 7513b1df16..d9f5e90aef 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -37,8 +37,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; ["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); // Add keybinds -["ACE3", -localize "STR_ACE_NightVision_IncreaseNVGBrightness", +["ACE3", QGVAR(IncreaseNVGBrightness), localize "STR_ACE_NightVision_IncreaseNVGBrightness", { // Conditions: canInteract _exceptions = [QEGVAR(captives,isNotEscorting)]; @@ -50,13 +49,10 @@ localize "STR_ACE_NightVision_IncreaseNVGBrightness", [ACE_player, 1] call FUNC(changeNVGBrightness); true }, -[201, [false, false, true]], //PageUp + ALT -false, -"keydown" -] call cba_fnc_registerKeybind; +{}, +[201, [false, false, true]], false] call cba_fnc_addKeybind; //PageUp + ALT -["ACE3", -localize "STR_ACE_NightVision_DecreaseNVGBrightness", +["ACE3", QGVAR(DecreaseNVGBrightness), localize "STR_ACE_NightVision_DecreaseNVGBrightness", { // Conditions: canInteract _exceptions = [QEGVAR(captives,isNotEscorting)]; @@ -68,7 +64,5 @@ localize "STR_ACE_NightVision_DecreaseNVGBrightness", [ACE_player, -1] call FUNC(changeNVGBrightness); true }, -[209, [false, false, true]], //PageDown + ALT -false, -"keydown" -] call cba_fnc_registerKeybind; +{}, +[209, [false, false, true]], false] call cba_fnc_addKeybind; //PageDown + ALT diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index 6d0014c2a2..5d3a39ffd3 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -4,22 +4,19 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", - localize "STR_ACE_Overheating_UnjamWeapon", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon) && - {currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])} - ) exitWith {false}; +["ACE3", QGVAR(unjamWeapon), localize "STR_ACE_Overheating_UnjamWeapon", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon) && + {currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])} + ) exitWith {false}; - // Statement - [ACE_player, currentMuzzle ACE_player, false] call FUNC(clearJam); - true - }, - [19, [true, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, currentMuzzle ACE_player, false] call FUNC(clearJam); + true +}, +{}, +[19, [true, false, false]], false] call cba_fnc_addKeybind; //R Key diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index a15e125edd..e25d85caea 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -16,26 +16,28 @@ #include "script_component.hpp" if (!hasInterface) exitWith {}; -["ACE3", localize "STR_ACE_Parachute_showAltimeter", +["ACE3", QGVAR(showAltimeter), localize "STR_ACE_Parachute_showAltimeter", { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false}; - if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then { - [ace_player] call FUNC(showAltimeter); - } else { - call FUNC(hideAltimeter); - }; - true -}, [24, false, false, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind); + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false}; + if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then { + [ace_player] call FUNC(showAltimeter); + } else { + call FUNC(hideAltimeter); + }; + true +}, +{}, +[24, false, false, false], false] call CALLSTACK(cba_fnc_addKeybind); GVAR(PFH) = false; ["playerVehicleChanged",{ - if (!GVAR(PFH) && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then { - GVAR(PFH) = true; - [FUNC(onEachFrame), 0.1, []] call CALLSTACK(cba_fnc_addPerFrameHandler); - }; + if (!GVAR(PFH) && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then { + GVAR(PFH) = true; + [FUNC(onEachFrame), 0.1, []] call CALLSTACK(cba_fnc_addPerFrameHandler); + }; }] call EFUNC(common,addEventHandler); // don't show speed and height when in expert mode diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index d40e5e0442..6969df4c6a 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -4,21 +4,18 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", - localize "STR_ACE_Reload_checkAmmo", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon) || - {(vehicle ACE_player) isKindOf 'StaticWeapon'}) exitWith {false}; +["ACE3", QGVAR(checkAmmo), localize "STR_ACE_Reload_checkAmmo", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon) || + {(vehicle ACE_player) isKindOf 'StaticWeapon'}) exitWith {false}; - // Statement - [ACE_player, vehicle ACE_player, false] call FUNC(checkAmmo); - true - }, - [19, [false, true, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, vehicle ACE_player, false] call FUNC(checkAmmo); + true +}, +{}, +[19, [false, true, false]], false] call cba_fnc_addKeybind; diff --git a/addons/resting/XEH_postInit.sqf b/addons/resting/XEH_postInit.sqf index 0d999bab86..6af44c36c9 100644 --- a/addons/resting/XEH_postInit.sqf +++ b/addons/resting/XEH_postInit.sqf @@ -4,24 +4,21 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", - localize "STR_ACE_Resting_RestWeapon", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon) && - {inputAction 'reloadMagazine' == 0} && - {!weaponLowered ACE_player} && - {speed ACE_player < 1}) exitWith {false}; +["ACE3", QGVAR(RestWeapon), localize "STR_ACE_Resting_RestWeapon", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon) && + {inputAction 'reloadMagazine' == 0} && + {!weaponLowered ACE_player} && + {speed ACE_player < 1}) exitWith {false}; - // Statement - [ACE_player, vehicle ACE_player, currentWeapon ACE_player] call FUNC(restWeapon); - // Return false so it doesn't block other actions - false - }, - [15, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, vehicle ACE_player, currentWeapon ACE_player] call FUNC(restWeapon); + // Return false so it doesn't block other actions + false +}, +{}, +[15, [false, false, false]], false] call cba_fnc_addKeybind; diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index 8ae1155d53..60f8c6a60d 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -2,24 +2,21 @@ #include "script_component.hpp" //["Soldier", {_player = ACE_player; if (currentWeapon _player in (_player getVariable [QGVAR(safedWeapons), []])) then {[false] call FUNC(setSafeModeVisual)}] call EFUNC(common,addInfoDisplayEventHandler); - //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" +//@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" // Add keybinds -["ACE3", - localize "STR_ACE_SafeMode_SafeMode", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(safeMode), localize "STR_ACE_SafeMode_SafeMode", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety); - true - }, - [41, [false, true, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety); + true +}, +{}, +[41, [false, true, false]], false] call cba_fnc_addKeybind; diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index 8de7ff8af0..1ba21b41f0 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -33,78 +33,66 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", - localize "STR_ACE_Scopes_AdjustUp", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - [ACE_player] call FUNC(inventoryCheck); - if !([ACE_player, 0, 0.1] call FUNC(canAdjustScope)) exitWith {false}; +["ACE3", QGVAR(AdjustUp), localize "STR_ACE_Scopes_AdjustUp", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, 0, 0.1] call FUNC(canAdjustScope)) exitWith {false}; - // Statement - [ACE_player, 0, 0.1] call FUNC(adjustScope); - true - }, - [201, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, 0, 0.1] call FUNC(adjustScope); + true +}, +{}, +[201, [false, false, false]], false] call cba_fnc_addKeybind; -["ACE3", - localize "STR_ACE_Scopes_AdjustDown", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - [ACE_player] call FUNC(inventoryCheck); - if !([ACE_player, 0, -0.1] call FUNC(canAdjustScope)) exitWith {false}; +["ACE3", QGVAR(AdjustDown), localize "STR_ACE_Scopes_AdjustDown", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, 0, -0.1] call FUNC(canAdjustScope)) exitWith {false}; - // Statement - [ACE_player, 0, -0.1] call FUNC(adjustScope); - true - }, - [209, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, 0, -0.1] call FUNC(adjustScope); + true +}, +{}, +[209, [false, false, false]], false] call cba_fnc_addKeybind; -["ACE3", - localize "STR_ACE_Scopes_AdjustLeft", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - [ACE_player] call FUNC(inventoryCheck); - if !([ACE_player, -0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; +["ACE3", QGVAR(AdjustLeft), localize "STR_ACE_Scopes_AdjustLeft", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, -0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; - // Statement - [ACE_player, -0.1, 0] call FUNC(adjustScope); - true - }, - [209, [false, true, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, -0.1, 0] call FUNC(adjustScope); + true +}, +{}, +[209, [false, true, false]], false] call cba_fnc_addKeybind; -["ACE3", - localize "STR_ACE_Scopes_AdjustRight", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - [ACE_player] call FUNC(inventoryCheck); - if !([ACE_player, 0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; +["ACE3", QGVAR(AdjustRight), localize "STR_ACE_Scopes_AdjustRight", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, 0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; - // Statement - [ACE_player, 0.1, 0] call FUNC(adjustScope); - true - }, - [201, [false, true, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, 0.1, 0] call FUNC(adjustScope); + true +}, +{}, +[201, [false, true, false]], false] call cba_fnc_addKeybind; diff --git a/addons/vehicles/XEH_postInit.sqf b/addons/vehicles/XEH_postInit.sqf index efff70306f..64d2cbc1c0 100644 --- a/addons/vehicles/XEH_postInit.sqf +++ b/addons/vehicles/XEH_postInit.sqf @@ -4,22 +4,19 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", - localize "STR_ACE_SpeedLimiter", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(ACE_player == driver vehicle ACE_player && - {vehicle ACE_player isKindOf 'Car' || - {vehicle ACE_player isKindOf 'Tank'}}) exitWith {false}; +["ACE3", QGVAR(speedLimiter), localize "STR_ACE_SpeedLimiter", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player == driver vehicle ACE_player && + {vehicle ACE_player isKindOf 'Car' || + {vehicle ACE_player isKindOf 'Tank'}}) exitWith {false}; - // Statement - [ACE_player, vehicle ACE_player] call FUNC(speedLimiter); - true - }, - [211, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, vehicle ACE_player] call FUNC(speedLimiter); + true +}, +{}, +[211, [false, false, false]], false] call cba_fnc_addKeybind; //DELETE Key diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index 3414f64c52..e0f3272c62 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -4,254 +4,212 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3", - localize "STR_ACE_WeaponSelect_SelectPistol", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(SelectPistol), localize "STR_ACE_WeaponSelect_SelectPistol", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode); - true - }, - [2, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode); + true +}, +{}, +[2, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectRifle", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(SelectRifle), localize "STR_ACE_WeaponSelect_SelectRifle", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode); - true - }, - [3, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode); + true +}, +{}, +[3, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectLauncher", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(SelectRifleMuzzle), localize "STR_ACE_WeaponSelect_SelectRifleMuzzle", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode); - true - }, - [5, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle); + true +}, +{}, +[4, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectRifleMuzzle", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(SelectLauncher), localize "STR_ACE_WeaponSelect_SelectLauncher", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle); - true - }, - [4, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode); + true +}, +{}, +[5, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectBinocular", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(SelectBinocular), localize "STR_ACE_WeaponSelect_SelectBinocular", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player, binocular ACE_player] call FUNC(selectWeaponMode); - true - }, - [6, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, binocular ACE_player] call FUNC(selectWeaponMode); + true +}, +{}, +[6, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectGrenadeFrag", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(SelectGrenadeFrag), localize "STR_ACE_WeaponSelect_SelectGrenadeFrag", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player] call FUNC(selectGrenadeFrag); - true - }, - [7, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player] call FUNC(selectGrenadeFrag); + true +}, +{}, +[7, [false, false, false]], false] call cba_fnc_addKeybind; //6 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectGrenadeOther", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(SelectGrenadeOther), localize "STR_ACE_WeaponSelect_SelectGrenadeOther", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player] call FUNC(selectGrenadeOther); - true - }, - [8, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player] call FUNC(selectGrenadeOther); + true +}, +{}, +[8, [false, false, false]], false] call cba_fnc_addKeybind; //7 Key -["ACE3", - localize "STR_ACE_WeaponSelect_HolsterWeapon", - { - // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; +["ACE3", QGVAR(HolsterWeapon), localize "STR_ACE_WeaponSelect_HolsterWeapon", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - // Statement - [ACE_player] call FUNC(putWeaponAway); - true - }, - [11, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player] call FUNC(putWeaponAway); + true +}, +{}, +[11, [false, false, false]], false] call cba_fnc_addKeybind; //0 Key -["ACE3", - localize "STR_ACE_WeaponSelect_EngineOn", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false}; +["ACE3", QGVAR(EngineOn), localize "STR_ACE_WeaponSelect_EngineOn", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false}; - // Statement - (vehicle ACE_player) engineOn true; - true - }, - [3, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + (vehicle ACE_player) engineOn true; + true +}, +{}, +[3, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key -["ACE3", - localize "STR_ACE_WeaponSelect_EngineOff", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false}; +["ACE3", QGVAR(EngineOff), localize "STR_ACE_WeaponSelect_EngineOff", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false}; - // Statement - (vehicle ACE_player) engineOn false; - true - }, - [2, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + (vehicle ACE_player) engineOn false; + true +}, +{}, +[2, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectMainGun", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(ACE_player != vehicle ACE_player) exitWith {false}; +["ACE3", QGVAR(SelectMainGun), localize "STR_ACE_WeaponSelect_SelectMainGun", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player) exitWith {false}; - // Statement - [ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle); - true - }, - [4, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle); + true +}, +{}, +[4, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectMachineGun", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(ACE_player != vehicle ACE_player) exitWith {false}; +["ACE3", QGVAR(SelectMachineGun), localize "STR_ACE_WeaponSelect_SelectMachineGun", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player) exitWith {false}; - // Statement - [ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle); - true - }, - [5, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle); + true +}, +{}, +[5, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key -["ACE3", - localize "STR_ACE_WeaponSelect_SelectMissiles", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(ACE_player != vehicle ACE_player) exitWith {false}; +["ACE3", QGVAR(SelectMissiles), localize "STR_ACE_WeaponSelect_SelectMissiles", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player) exitWith {false}; - // Statement - [ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle); - true - }, - [6, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle); + true +}, +{}, +[6, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key -["ACE3", - localize "STR_ACE_WeaponSelect_FireSmokeLauncher", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(ACE_player != vehicle ACE_player && {ACE_player == commander vehicle ACE_player}) exitWith {false}; +["ACE3", QGVAR(FireSmokeLauncher), localize "STR_ACE_WeaponSelect_FireSmokeLauncher", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player && {ACE_player == commander vehicle ACE_player}) exitWith {false}; - // Statement - [vehicle ACE_player] call FUNC(fireSmokeLauncher); - true - }, - [10, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; + // Statement + [vehicle ACE_player] call FUNC(fireSmokeLauncher); + true +}, +{}, +[10, [false, false, false]], false] call cba_fnc_addKeybind; //9 Key From e18cbbfaad8c1f4f3aa8fcb155685d18d632aa36 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 5 Mar 2015 02:00:56 -0600 Subject: [PATCH 04/10] Vector Keys --- addons/vector/initKeybinds.sqf | 117 ++++++++++++--------------------- 1 file changed, 42 insertions(+), 75 deletions(-) diff --git a/addons/vector/initKeybinds.sqf b/addons/vector/initKeybinds.sqf index f81c280905..d9e9790127 100644 --- a/addons/vector/initKeybinds.sqf +++ b/addons/vector/initKeybinds.sqf @@ -1,83 +1,50 @@ // by commy2 -["ACE3", - localize "STR_ACE_Vector_AzimuthKey", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false}; +["ACE3", QGVAR(AzimuthKey), localize "STR_ACE_Vector_AzimuthKey", +{ + systemChat format ["Down %1", diag_tickTime]; + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false}; - // prevent holding down - if (GETGVAR(isDownStateKey1,false)) exitWith {false}; - GVAR(isDownStateKey1) = true; + // Statement + ["azimuth"] call FUNC(onKeyDown); + true +}, +{ + systemChat format ["Up %1", diag_tickTime]; + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Statement - ["azimuth"] call FUNC(onKeyDown); - true - }, - [15, [false, false, false]], - false, - "keydown" -] call CBA_fnc_registerKeybind; + // Statement + ["azimuth"] call FUNC(onKeyUp); + true +}, +[15, [false, false, false]], false, 0] call CBA_fnc_addKeybind; //Tab Key -["ACE3", - localize "STR_ACE_Vector_AzimuthKey", - { - // prevent holding down - GVAR(isDownStateKey1) = false; - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; +["ACE3", QGVAR(DistanceKey), localize "STR_ACE_Vector_DistanceKey", +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false}; - // Statement - ["azimuth"] call FUNC(onKeyUp); - true - }, - [15, [false, false, false]], - false, - "keyup" -] call CBA_fnc_registerKeybind; + // Statement + ["distance"] call FUNC(onKeyDown); + true +}, +{ + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; -["ACE3", - localize "STR_ACE_Vector_DistanceKey", - { - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false}; - - // prevent holding down - if (GETGVAR(isDownStateKey2,false)) exitWith {false}; - GVAR(isDownStateKey2) = true; - - // Statement - ["distance"] call FUNC(onKeyDown); - true - }, - [19, [false, false, false]], - false, - "keydown" -] call CBA_fnc_registerKeybind; - -["ACE3", - localize "STR_ACE_Vector_DistanceKey", - { - // prevent holding down - GVAR(isDownStateKey2) = false; - - // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - - // Statement - ["distance"] call FUNC(onKeyUp); - true - }, - [19, [false, false, false]], - false, - "keyup" -] call CBA_fnc_registerKeybind; + // Statement + ["distance"] call FUNC(onKeyUp); + true +}, +[19, [false, false, false]], false] call CBA_fnc_registerKeybind; //R Key From 5d21cd6cc78cf089946b25199efd51332253f511 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 5 Mar 2015 02:46:24 -0600 Subject: [PATCH 05/10] Fix Vector/FCS debounce --- addons/fcs/initKeybinds.sqf | 6 ++++++ addons/vector/initKeybinds.sqf | 18 +++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index 31fae97601..4ff92bdd14 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -8,12 +8,18 @@ // Conditions: specific if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; + if (GETGVAR(isDownStateKey1,false)) exitWith {false}; + GVAR(isDownStateKey1) = true; + // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown); // Return false so it doesn't block the rest weapon action false }, { + // prevent holding down + GVAR(isDownStateKey1) = false; + // Conditions: canInteract _exceptions = []; if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; diff --git a/addons/vector/initKeybinds.sqf b/addons/vector/initKeybinds.sqf index d9e9790127..a41c13c757 100644 --- a/addons/vector/initKeybinds.sqf +++ b/addons/vector/initKeybinds.sqf @@ -2,19 +2,24 @@ ["ACE3", QGVAR(AzimuthKey), localize "STR_ACE_Vector_AzimuthKey", { - systemChat format ["Down %1", diag_tickTime]; // Conditions: canInteract _exceptions = []; if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; // Conditions: specific if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false}; + // prevent holding down + if (GETGVAR(isDownStateKey1,false)) exitWith {false}; + GVAR(isDownStateKey1) = true; + // Statement ["azimuth"] call FUNC(onKeyDown); true }, { - systemChat format ["Up %1", diag_tickTime]; + // prevent holding down + GVAR(isDownStateKey1) = false; + // Conditions: canInteract _exceptions = []; if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; @@ -34,11 +39,18 @@ // Conditions: specific if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false}; + // prevent holding down + if (GETGVAR(isDownStateKey2,false)) exitWith {false}; + GVAR(isDownStateKey2) = true; + // Statement ["distance"] call FUNC(onKeyDown); true }, { + // prevent holding down + GVAR(isDownStateKey2) = false; + // Conditions: canInteract _exceptions = []; if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; @@ -47,4 +59,4 @@ ["distance"] call FUNC(onKeyUp); true }, -[19, [false, false, false]], false] call CBA_fnc_registerKeybind; //R Key +[19, [false, false, false]], false] call CBA_fnc_addKeybind; //R Key From 4018742f261f5a389f8c899a800e491672e36a38 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 5 Mar 2015 02:51:24 -0600 Subject: [PATCH 06/10] Return False on keyUp Code --- addons/fcs/initKeybinds.sqf | 8 +++---- addons/goggles/XEH_postInit.sqf | 2 +- addons/grenades/XEH_postInit.sqf | 2 +- addons/movement/XEH_postInit.sqf | 2 +- addons/nametags/XEH_postInit.sqf | 2 +- addons/nightvision/XEH_postInitClient.sqf | 4 ++-- addons/overheating/XEH_postInit.sqf | 2 +- addons/parachute/XEH_postInit.sqf | 2 +- addons/reload/XEH_postInit.sqf | 2 +- addons/resting/XEH_postInit.sqf | 2 +- addons/safemode/XEH_postInit.sqf | 2 +- addons/scopes/XEH_postInit.sqf | 8 +++---- addons/vehicles/XEH_postInit.sqf | 2 +- addons/weaponselect/XEH_postInit.sqf | 28 +++++++++++------------ 14 files changed, 34 insertions(+), 34 deletions(-) diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index 4ff92bdd14..f573a7e9d9 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -10,12 +10,12 @@ if (GETGVAR(isDownStateKey1,false)) exitWith {false}; GVAR(isDownStateKey1) = true; - + // Statement [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyDown); // Return false so it doesn't block the rest weapon action false -}, +}, { // prevent holding down GVAR(isDownStateKey1) = false; @@ -44,7 +44,7 @@ [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), 50] call FUNC(adjustRange); true }, -{}, +{false}, [201, [false, false, false]], false] call cba_fnc_addKeybind; //PageUp Key ["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown", @@ -59,5 +59,5 @@ [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -50] call FUNC(adjustRange); true }, -{}, +{false}, [209, [false, false, false]], false] call cba_fnc_addKeybind; //PageDown Key diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 6b90564746..d73ac0a850 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -25,7 +25,7 @@ if (!hasInterface) exitWith {}; }; false }, -{}, +{false}, [20, true, true, false], false] call CALLSTACK(cba_fnc_addKeybind); if isNil(QGVAR(UsePP)) then { diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index f9aef6bef1..89f4e05bb4 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -21,5 +21,5 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; // Statement [] call FUNC(nextMode); }, -{}, +{false}, [9, [false, false, false]], false] call cba_fnc_addKeybind; //8 Key diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index 42c5c17ad1..037e0105e9 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -30,5 +30,5 @@ [ACE_player] call FUNC(climb); true }, -{}, +{false}, [47, [false, true, false]], false] call cba_fnc_addKeybind; //DIK_V + CTRL//STRG diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index 406bf867e3..2de39f5807 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -19,7 +19,7 @@ if (!hasInterface) exitWith {}; // Return false so it doesn't block other actions false }, -{}, +{false}, [29, [false, false, false]], false] call cba_fnc_addKeybind; //LeftControl Key diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index d9f5e90aef..0707104fad 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -49,7 +49,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; [ACE_player, 1] call FUNC(changeNVGBrightness); true }, -{}, +{false}, [201, [false, false, true]], false] call cba_fnc_addKeybind; //PageUp + ALT ["ACE3", QGVAR(DecreaseNVGBrightness), localize "STR_ACE_NightVision_DecreaseNVGBrightness", @@ -64,5 +64,5 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; [ACE_player, -1] call FUNC(changeNVGBrightness); true }, -{}, +{false}, [209, [false, false, true]], false] call cba_fnc_addKeybind; //PageDown + ALT diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index 5d3a39ffd3..a1b3dec206 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -18,5 +18,5 @@ if !(hasInterface) exitWith {}; [ACE_player, currentMuzzle ACE_player, false] call FUNC(clearJam); true }, -{}, +{false}, [19, [true, false, false]], false] call cba_fnc_addKeybind; //R Key diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index e25d85caea..71e35910b9 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -29,7 +29,7 @@ if (!hasInterface) exitWith {}; }; true }, -{}, +{false}, [24, false, false, false], false] call CALLSTACK(cba_fnc_addKeybind); GVAR(PFH) = false; diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index 6969df4c6a..eb5f5f2ccd 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -17,5 +17,5 @@ if !(hasInterface) exitWith {}; [ACE_player, vehicle ACE_player, false] call FUNC(checkAmmo); true }, -{}, +{false}, [19, [false, true, false]], false] call cba_fnc_addKeybind; diff --git a/addons/resting/XEH_postInit.sqf b/addons/resting/XEH_postInit.sqf index 6af44c36c9..18c3409e38 100644 --- a/addons/resting/XEH_postInit.sqf +++ b/addons/resting/XEH_postInit.sqf @@ -20,5 +20,5 @@ if !(hasInterface) exitWith {}; // Return false so it doesn't block other actions false }, -{}, +{false}, [15, [false, false, false]], false] call cba_fnc_addKeybind; diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index 60f8c6a60d..549195b188 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -18,5 +18,5 @@ [ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety); true }, -{}, +{false}, [41, [false, true, false]], false] call cba_fnc_addKeybind; diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index 1ba21b41f0..a884292416 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -46,7 +46,7 @@ if !(hasInterface) exitWith {}; [ACE_player, 0, 0.1] call FUNC(adjustScope); true }, -{}, +{false}, [201, [false, false, false]], false] call cba_fnc_addKeybind; ["ACE3", QGVAR(AdjustDown), localize "STR_ACE_Scopes_AdjustDown", @@ -62,7 +62,7 @@ if !(hasInterface) exitWith {}; [ACE_player, 0, -0.1] call FUNC(adjustScope); true }, -{}, +{false}, [209, [false, false, false]], false] call cba_fnc_addKeybind; ["ACE3", QGVAR(AdjustLeft), localize "STR_ACE_Scopes_AdjustLeft", @@ -78,7 +78,7 @@ if !(hasInterface) exitWith {}; [ACE_player, -0.1, 0] call FUNC(adjustScope); true }, -{}, +{false}, [209, [false, true, false]], false] call cba_fnc_addKeybind; ["ACE3", QGVAR(AdjustRight), localize "STR_ACE_Scopes_AdjustRight", @@ -94,5 +94,5 @@ if !(hasInterface) exitWith {}; [ACE_player, 0.1, 0] call FUNC(adjustScope); true }, -{}, +{false}, [201, [false, true, false]], false] call cba_fnc_addKeybind; diff --git a/addons/vehicles/XEH_postInit.sqf b/addons/vehicles/XEH_postInit.sqf index 64d2cbc1c0..18d9e2f580 100644 --- a/addons/vehicles/XEH_postInit.sqf +++ b/addons/vehicles/XEH_postInit.sqf @@ -18,5 +18,5 @@ if !(hasInterface) exitWith {}; [ACE_player, vehicle ACE_player] call FUNC(speedLimiter); true }, -{}, +{false}, [211, [false, false, false]], false] call cba_fnc_addKeybind; //DELETE Key diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index e0f3272c62..c268f49b3c 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -16,7 +16,7 @@ if !(hasInterface) exitWith {}; [ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode); true }, -{}, +{false}, [2, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key ["ACE3", QGVAR(SelectRifle), localize "STR_ACE_WeaponSelect_SelectRifle", @@ -31,7 +31,7 @@ if !(hasInterface) exitWith {}; [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode); true }, -{}, +{false}, [3, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key ["ACE3", QGVAR(SelectRifleMuzzle), localize "STR_ACE_WeaponSelect_SelectRifleMuzzle", @@ -46,7 +46,7 @@ if !(hasInterface) exitWith {}; [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle); true }, -{}, +{false}, [4, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key ["ACE3", QGVAR(SelectLauncher), localize "STR_ACE_WeaponSelect_SelectLauncher", @@ -61,7 +61,7 @@ if !(hasInterface) exitWith {}; [ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode); true }, -{}, +{false}, [5, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key ["ACE3", QGVAR(SelectBinocular), localize "STR_ACE_WeaponSelect_SelectBinocular", @@ -76,7 +76,7 @@ if !(hasInterface) exitWith {}; [ACE_player, binocular ACE_player] call FUNC(selectWeaponMode); true }, -{}, +{false}, [6, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key ["ACE3", QGVAR(SelectGrenadeFrag), localize "STR_ACE_WeaponSelect_SelectGrenadeFrag", @@ -91,7 +91,7 @@ if !(hasInterface) exitWith {}; [ACE_player] call FUNC(selectGrenadeFrag); true }, -{}, +{false}, [7, [false, false, false]], false] call cba_fnc_addKeybind; //6 Key ["ACE3", QGVAR(SelectGrenadeOther), localize "STR_ACE_WeaponSelect_SelectGrenadeOther", @@ -106,7 +106,7 @@ if !(hasInterface) exitWith {}; [ACE_player] call FUNC(selectGrenadeOther); true }, -{}, +{false}, [8, [false, false, false]], false] call cba_fnc_addKeybind; //7 Key ["ACE3", QGVAR(HolsterWeapon), localize "STR_ACE_WeaponSelect_HolsterWeapon", @@ -121,7 +121,7 @@ if !(hasInterface) exitWith {}; [ACE_player] call FUNC(putWeaponAway); true }, -{}, +{false}, [11, [false, false, false]], false] call cba_fnc_addKeybind; //0 Key ["ACE3", QGVAR(EngineOn), localize "STR_ACE_WeaponSelect_EngineOn", @@ -136,7 +136,7 @@ if !(hasInterface) exitWith {}; (vehicle ACE_player) engineOn true; true }, -{}, +{false}, [3, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key ["ACE3", QGVAR(EngineOff), localize "STR_ACE_WeaponSelect_EngineOff", @@ -151,7 +151,7 @@ if !(hasInterface) exitWith {}; (vehicle ACE_player) engineOn false; true }, -{}, +{false}, [2, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key ["ACE3", QGVAR(SelectMainGun), localize "STR_ACE_WeaponSelect_SelectMainGun", @@ -166,7 +166,7 @@ if !(hasInterface) exitWith {}; [ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle); true }, -{}, +{false}, [4, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key ["ACE3", QGVAR(SelectMachineGun), localize "STR_ACE_WeaponSelect_SelectMachineGun", @@ -181,7 +181,7 @@ if !(hasInterface) exitWith {}; [ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle); true }, -{}, +{false}, [5, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key ["ACE3", QGVAR(SelectMissiles), localize "STR_ACE_WeaponSelect_SelectMissiles", @@ -196,7 +196,7 @@ if !(hasInterface) exitWith {}; [ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle); true }, -{}, +{false}, [6, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key ["ACE3", QGVAR(FireSmokeLauncher), localize "STR_ACE_WeaponSelect_FireSmokeLauncher", @@ -211,5 +211,5 @@ if !(hasInterface) exitWith {}; [vehicle ACE_player] call FUNC(fireSmokeLauncher); true }, -{}, +{false}, [10, [false, false, false]], false] call cba_fnc_addKeybind; //9 Key From 3690f1a7336374a8df774357b18d0e3abbe6232d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 7 Mar 2015 10:32:31 -0600 Subject: [PATCH 07/10] Pull reload changes from master --- addons/reload/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index eb5f5f2ccd..0aa31f80ac 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -14,7 +14,7 @@ if !(hasInterface) exitWith {}; {(vehicle ACE_player) isKindOf 'StaticWeapon'}) exitWith {false}; // Statement - [ACE_player, vehicle ACE_player, false] call FUNC(checkAmmo); + [ACE_player] call FUNC(checkAmmo); true }, {false}, From 3940ba9a62ce90fe9395552a5984ecbecb54e945 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 7 Mar 2015 10:58:34 -0600 Subject: [PATCH 08/10] opps --- addons/reload/XEH_postInit.sqf | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index 2d93edb1ca..6ea3e01326 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -64,4 +64,3 @@ if !(hasInterface) exitWith {}; _receiver addMagazine _magazine; }] call EFUNC(common,addEventhandler); ->>>>>>> master From bcf533292ab336e0b6b6e7ba46c05fb1735f02f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sat, 7 Mar 2015 14:12:00 -0300 Subject: [PATCH 09/10] Remove weapon initVelocities for guns with FCS --- addons/fcs/functions/fnc_firedEH.sqf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/fcs/functions/fnc_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf index 4c553883e2..67c7e1d301 100644 --- a/addons/fcs/functions/fnc_firedEH.sqf +++ b/addons/fcs/functions/fnc_firedEH.sqf @@ -12,7 +12,7 @@ #include "script_component.hpp" -private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile"]; +private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile","_velocityCorrection"]; _vehicle = _this select 0; _weapon = _this select 1; @@ -43,8 +43,12 @@ _offset = 0; }; } forEach _FCSMagazines; -[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection); +// Correct velocity for weapons that have initVelocity +// @todo: Take into account negative initVelocities +_velocityCorrection = (vectorMagnitude velocity _projectile) - + getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); +[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, _velocityCorrection] call EFUNC(common,changeProjectileDirection); // Air burst missile // handle locally only From 7ed682a849db14bb98401d4b9fce1bec1ddb24f4 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 7 Mar 2015 13:48:32 -0600 Subject: [PATCH 10/10] Fix Parachutes --- addons/parachute/config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/parachute/config.cpp b/addons/parachute/config.cpp index 924c8ccb2c..78ca51fb97 100644 --- a/addons/parachute/config.cpp +++ b/addons/parachute/config.cpp @@ -49,7 +49,7 @@ class CfgVehicles { displayName = "$STR_ACE_Parachute_NonSteerableParachute"; //picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo //model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo - backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable + // backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable //Bis broke this in 1.40 ParachuteClass = "NonSteerable_Parachute_F"; maximumLoad = 0; mass = 100;