mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
weaponselect: replace keybinds for cba
This commit is contained in:
parent
4d721418fa
commit
b867dc04ed
@ -5,6 +5,12 @@ class Extended_PreInit_EventHandlers {
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_FiredBIS_EventHandlers {
|
||||
class CAManBase {
|
||||
class GVAR(ThrowGrenade) {
|
||||
|
149
addons/weaponselect/XEH_postInit.sqf
Normal file
149
addons/weaponselect/XEH_postInit.sqf
Normal file
@ -0,0 +1,149 @@
|
||||
// by CAA-Picard
|
||||
#include "script_component.hpp"
|
||||
|
||||
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};
|
||||
|
||||
// Statement
|
||||
[ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode);
|
||||
true
|
||||
},
|
||||
[2, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call cba_fnc_registerKeybind;
|
||||
|
||||
["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};
|
||||
|
||||
// Statement
|
||||
[ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode);
|
||||
true
|
||||
},
|
||||
[3, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call cba_fnc_registerKeybind;
|
||||
|
||||
["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};
|
||||
|
||||
// Statement
|
||||
[ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode);
|
||||
true
|
||||
},
|
||||
[5, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call cba_fnc_registerKeybind;
|
||||
|
||||
["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};
|
||||
|
||||
// Statement
|
||||
[ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle);
|
||||
true
|
||||
},
|
||||
[4, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call cba_fnc_registerKeybind;
|
||||
|
||||
["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};
|
||||
|
||||
// Statement
|
||||
[ACE_player, binocular ACE_player] call FUNC(selectWeaponMode);
|
||||
true
|
||||
},
|
||||
[6, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call cba_fnc_registerKeybind;
|
||||
|
||||
["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};
|
||||
|
||||
// Statement
|
||||
[ACE_player] call FUNC(selectGrenadeFrag);
|
||||
true
|
||||
},
|
||||
[7, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call cba_fnc_registerKeybind;
|
||||
|
||||
["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};
|
||||
|
||||
// Statement
|
||||
[ACE_player] call FUNC(selectGrenadeOther);
|
||||
true
|
||||
},
|
||||
[8, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call cba_fnc_registerKeybind;
|
||||
|
||||
["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};
|
||||
|
||||
// Statement
|
||||
[ACE_player] call FUNC(putWeaponAway);
|
||||
true
|
||||
},
|
||||
[11, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call cba_fnc_registerKeybind;
|
@ -15,109 +15,6 @@ class CfgPatches {
|
||||
#include "CfgEventHandlers.hpp"
|
||||
|
||||
class ACE_Default_Keys {
|
||||
class selectPistol {
|
||||
displayName = "$STR_ACE_WeaponSelect_SelectPistol";
|
||||
condition = QUOTE([_player] call EFUNC(common,canUseWeapon));
|
||||
statement = QUOTE([ARR_2(_player, handgunWeapon _player)] call FUNC(selectWeaponMode););
|
||||
exceptions[] = {QEGVAR(interaction,isNotEscorting)};
|
||||
key = 2;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class selectRifle {
|
||||
displayName = "$STR_ACE_WeaponSelect_SelectRifle";
|
||||
condition = QUOTE([_player] call EFUNC(common,canUseWeapon));
|
||||
statement = QUOTE([ARR_2(_player, primaryWeapon _player)] call FUNC(selectWeaponMode););
|
||||
exceptions[] = {QEGVAR(interaction,isNotEscorting)};
|
||||
key = 3;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class selectLauncher {
|
||||
displayName = "$STR_ACE_WeaponSelect_SelectLauncher";
|
||||
condition = QUOTE(_player == _vehicle);
|
||||
statement = QUOTE([ARR_2(_player, secondaryWeapon _player)] call FUNC(selectWeaponMode););
|
||||
exceptions[] = {QEGVAR(interaction,isNotEscorting)};
|
||||
key = 5;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
/*class selectPistolMuzzle {
|
||||
displayName = "Select Pistol Muzzle";
|
||||
condition = QUOTE([_player] call EFUNC(common,canUseWeapon));
|
||||
statement = QUOTE([ARR_2(_player, handgunWeapon _player)] call FUNC(selectWeaponMuzzle););
|
||||
exceptions[] = {QEGVAR(interaction,isNotEscorting)};
|
||||
disabled = 1;
|
||||
key = 7;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};*/
|
||||
class selectRifleMuzzle {
|
||||
displayName = "$STR_ACE_WeaponSelect_SelectRifleMuzzle";
|
||||
condition = QUOTE([_player] call EFUNC(common,canUseWeapon));
|
||||
statement = QUOTE([ARR_2(_player, primaryWeapon _player)] call FUNC(selectWeaponMuzzle););
|
||||
exceptions[] = {QEGVAR(interaction,isNotEscorting)};
|
||||
key = 4;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
/*class selectLauncherMuzzle {
|
||||
displayName = "Select Launcher Muzzle";
|
||||
condition = QUOTE(_player == _vehicle);
|
||||
statement = QUOTE([ARR_2(_player, secondaryWeapon _player)] call FUNC(selectWeaponMuzzle););
|
||||
exceptions[] = {QEGVAR(interaction,isNotEscorting)};
|
||||
disabled = 1;
|
||||
key = 8;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};*/
|
||||
class selectBinocular {
|
||||
displayName = "$STR_ACE_WeaponSelect_SelectBinocular";
|
||||
condition = QUOTE([_player] call EFUNC(common,canUseWeapon));
|
||||
statement = QUOTE([ARR_2(_player, binocular _player)] call FUNC(selectWeaponMode););
|
||||
exceptions[] = {QEGVAR(interaction,isNotEscorting)};
|
||||
key = 6;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class selectGrenadeFrag {
|
||||
displayName = "$STR_ACE_WeaponSelect_SelectGrenadeFrag";
|
||||
condition = QUOTE([_player] call EFUNC(common,canUseWeapon));
|
||||
statement = QUOTE([_player] call FUNC(selectGrenadeFrag););
|
||||
exceptions[] = {QEGVAR(interaction,isNotEscorting)};
|
||||
key = 7;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class selectGrenadeOther {
|
||||
displayName = "$STR_ACE_WeaponSelect_SelectGrenadeOther";
|
||||
condition = QUOTE([_player] call EFUNC(common,canUseWeapon));
|
||||
statement = QUOTE([_player] call FUNC(selectGrenadeOther););
|
||||
exceptions[] = {QEGVAR(interaction,isNotEscorting)};
|
||||
key = 8;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class holsterWeapon {
|
||||
displayName = "$STR_ACE_WeaponSelect_HolsterWeapon";
|
||||
condition = QUOTE([_player] call EFUNC(common,canUseWeapon));
|
||||
statement = QUOTE([_player] call FUNC(putWeaponAway););
|
||||
exceptions[] = {QEGVAR(interaction,isNotEscorting)};
|
||||
key = 11;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
|
||||
class engineOn {
|
||||
displayName = "$STR_ACE_WeaponSelect_EngineOn";
|
||||
condition = QUOTE(_player != _vehicle && {_player == driver _vehicle} && {!isEngineOn _vehicle});
|
||||
|
Loading…
Reference in New Issue
Block a user