Merge branch 'weaponSelecCbaKeyBinds'

This commit is contained in:
Nicolás Badano 2015-01-18 15:24:15 -03:00
commit d299331f80
3 changed files with 263 additions and 162 deletions

View File

@ -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) {

View File

@ -0,0 +1,257 @@
// 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;
["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};
// Statement
(vehicle ACE_player) engineOn true;
true
},
[3, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["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};
// Statement
(vehicle ACE_player) engineOn false;
true
},
[2, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["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};
// Statement
[ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle);
true
},
[4, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["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};
// Statement
[ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle);
true
},
[5, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["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};
// Statement
[ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle);
true
},
[6, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["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};
// Statement
[vehicle ACE_player] call FUNC(fireSmokeLauncher);
true
},
[10, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;

View File

@ -13,165 +13,3 @@ 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});
statement = QUOTE(_vehicle engineOn true;);
key = 3;
shift = 0;
control = 0;
alt = 0;
};
class engineOff {
displayName = "$STR_ACE_WeaponSelect_EngineOff";
condition = QUOTE(_player != _vehicle && {_player == driver _vehicle} && {isEngineOn _vehicle});
statement = QUOTE(_vehicle engineOn false;);
key = 2;
shift = 0;
control = 0;
alt = 0;
};
class selectMaingun {
displayName = "$STR_ACE_WeaponSelect_SelectMainGun";
condition = QUOTE(_player != _vehicle);
statement = QUOTE([ARR_3(_player, _vehicle, 0)] call FUNC(selectWeaponVehicle););
key = 4;
shift = 0;
control = 0;
alt = 0;
};
class selectMachineGun {
displayName = "$STR_ACE_WeaponSelect_SelectMachineGun";
condition = QUOTE(_player != _vehicle);
statement = QUOTE([ARR_3(_player, _vehicle, 1)] call FUNC(selectWeaponVehicle););
key = 5;
shift = 0;
control = 0;
alt = 0;
};
class selectMissile {
displayName = "$STR_ACE_WeaponSelect_SelectMissiles";
condition = QUOTE(_player != _vehicle);
statement = QUOTE([ARR_3(_player, _vehicle, 2)] call FUNC(selectWeaponVehicle););
key = 6;
shift = 0;
control = 0;
alt = 0;
};
class fireSmokeLauncher {
displayName = "$STR_ACE_WeaponSelect_FireSmokeLauncher";
condition = QUOTE(_player != _vehicle && {_player == commander _vehicle});
statement = QUOTE([_vehicle] call FUNC(fireSmokeLauncher););
key = 10;
shift = 0;
control = 0;
alt = 0;
};
};