mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
no holding key with fcs
This commit is contained in:
parent
45c9b65bad
commit
3f8f08cc8b
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Get the gunner of a vehicle who uses the given weapon type. Requires every turret to have a different weapons.
|
||||
* Get the gunner of a vehicle who uses the given weapon type. Requires every turret to have a different weapon.
|
||||
*
|
||||
* Argument:
|
||||
* 0: The vehicle (Object)
|
||||
|
@ -1,12 +1,12 @@
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit) );
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit) );
|
||||
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -28,7 +28,7 @@ class CfgVehicles {
|
||||
displayName = $STR_ACE_FCS_ResetFCS;
|
||||
enableInside = 1;
|
||||
condition = QUOTE(call FUNC(canResetFCS));
|
||||
statement = QUOTE([ARR_2(_vehicle,[_player] call DEFUNC(common,getTurretIndex))] call FUNC(reset););
|
||||
statement = QUOTE([ARR_2(_vehicle,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
|
||||
showDisabled = 0;
|
||||
priority = 1;
|
||||
icon = "";
|
||||
@ -42,7 +42,7 @@ class CfgVehicles {
|
||||
displayName = $STR_ACE_FCS_ResetFCS;
|
||||
enableInside = 1;
|
||||
condition = QUOTE(call FUNC(canResetFCS));
|
||||
statement = QUOTE([ARR_2(_vehicle,[_player] call DEFUNC(common,getTurretIndex))] call FUNC(reset););
|
||||
statement = QUOTE([ARR_2(_vehicle,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
|
||||
showDisabled = 0;
|
||||
priority = 1;
|
||||
icon = "";
|
||||
|
@ -1,3 +1,4 @@
|
||||
// by commy2
|
||||
|
||||
["ACE3",
|
||||
localize "STR_ACE_FCS_LaseTarget",
|
||||
@ -8,6 +9,10 @@
|
||||
// Conditions: specific
|
||||
if !(!GVAR(enabled) && {call FUNC(canUseRangefinder) || FUNC(canUseFCS)}) 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
|
||||
@ -21,6 +26,9 @@
|
||||
["ACE3",
|
||||
localize "STR_ACE_FCS_LaseTarget",
|
||||
{
|
||||
// prevent holding down
|
||||
GVAR(isDownStateKey1) = false;
|
||||
|
||||
// Conditions: canInteract
|
||||
_exceptions = [];
|
||||
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
||||
|
@ -1,78 +1,4 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
["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"} && {!(GETGVAR(isDownStateKeyAzimuth,false))}) exitWith {false};
|
||||
|
||||
GVAR(isDownStateKeyAzimuth) = true;
|
||||
|
||||
// Statement
|
||||
["azimuth"] call FUNC(onKeyDown);
|
||||
true
|
||||
},
|
||||
[15, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call CBA_fnc_registerKeybind;
|
||||
|
||||
["ACE3",
|
||||
localize "STR_ACE_Vector_AzimuthKey",
|
||||
{
|
||||
GVAR(isDownStateKeyAzimuth) = false;
|
||||
|
||||
// Conditions: canInteract
|
||||
_exceptions = [];
|
||||
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
||||
|
||||
// Statement
|
||||
["azimuth"] call FUNC(onKeyUp);
|
||||
true
|
||||
},
|
||||
[15, [false, false, false]],
|
||||
false,
|
||||
"keyup"
|
||||
] call CBA_fnc_registerKeybind;
|
||||
|
||||
["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"} && {!(GETGVAR(isDownStateKeyDistance,false))}) exitWith {false};
|
||||
|
||||
GVAR(isDownStateKeyDistance) = true;
|
||||
|
||||
// Statement
|
||||
["distance"] call FUNC(onKeyDown);
|
||||
true
|
||||
},
|
||||
[19, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call CBA_fnc_registerKeybind;
|
||||
|
||||
["ACE3",
|
||||
localize "STR_ACE_Vector_DistanceKey",
|
||||
{
|
||||
GVAR(isDownStateKeyDistance) = 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;
|
||||
#include "initKeybinds.sqf"
|
||||
|
83
addons/vector/initKeybinds.sqf
Normal file
83
addons/vector/initKeybinds.sqf
Normal file
@ -0,0 +1,83 @@
|
||||
// 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};
|
||||
|
||||
// prevent holding down
|
||||
if (GETGVAR(isDownStateKey1,false)) exitWith {false};
|
||||
GVAR(isDownStateKey1) = true;
|
||||
|
||||
// Statement
|
||||
["azimuth"] call FUNC(onKeyDown);
|
||||
true
|
||||
},
|
||||
[15, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call CBA_fnc_registerKeybind;
|
||||
|
||||
["ACE3",
|
||||
localize "STR_ACE_Vector_AzimuthKey",
|
||||
{
|
||||
// prevent holding down
|
||||
GVAR(isDownStateKey1) = false;
|
||||
|
||||
// Conditions: canInteract
|
||||
_exceptions = [];
|
||||
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
||||
|
||||
// Statement
|
||||
["azimuth"] call FUNC(onKeyUp);
|
||||
true
|
||||
},
|
||||
[15, [false, false, false]],
|
||||
false,
|
||||
"keyup"
|
||||
] call CBA_fnc_registerKeybind;
|
||||
|
||||
["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;
|
Loading…
Reference in New Issue
Block a user