port weapon select

This commit is contained in:
commy2 2015-01-17 18:26:51 +01:00
parent e216a33574
commit 7a6d0eefe3
46 changed files with 923 additions and 1008 deletions

View File

@ -1,49 +0,0 @@
// by CAA-Picard, commy2
AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = true;
AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = "";
AGM_WeaponSelect_CurrentGrenadeMuzzleOther = "";
// Collect frag and other muzzles separately
with uiNamespace do {
if (isNil "AGM_WeaponSelect_FragMuzzles") then {
AGM_WeaponSelect_FragMuzzles = [];
AGM_WeaponSelect_NonFragMuzzles = [];
AGM_WeaponSelect_AllMuzzles = [];
AGM_WeaponSelect_FragMagazines = [];
AGM_WeaponSelect_NonFragMagazines = [];
AGM_WeaponSelect_AllMagazines = [];
{
_magazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines");
_magazine = _magazines select 0;
_ammo = getText (configfile >> "CfgMagazines" >> _magazine >> "ammo");
_explosive = getNumber (configfile >> "CfgAmmo" >> _ammo >> "explosive");
if (_explosive == 0) then {
AGM_WeaponSelect_NonFragMuzzles pushBack _x;
AGM_WeaponSelect_NonFragMagazines pushBack _magazines;
} else {
AGM_WeaponSelect_FragMuzzles pushBack _x;
AGM_WeaponSelect_FragMagazines pushBack _magazines;
};
AGM_WeaponSelect_AllMuzzles pushBack _x;
AGM_WeaponSelect_AllMagazines pushBack _magazines;
} forEach getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles");
};
};
AGM_WeaponSelect_FragMuzzles = uiNamespace getVariable "AGM_WeaponSelect_FragMuzzles";
AGM_WeaponSelect_NonFragMuzzles = uiNamespace getVariable "AGM_WeaponSelect_NonFragMuzzles";
AGM_WeaponSelect_AllMuzzles = uiNamespace getVariable "AGM_WeaponSelect_AllMuzzles";
AGM_WeaponSelect_FragMagazines = uiNamespace getVariable "AGM_WeaponSelect_FragMagazines";
AGM_WeaponSelect_NonFragMagazines = uiNamespace getVariable "AGM_WeaponSelect_NonFragMagazines";
AGM_WeaponSelect_AllMagazines = uiNamespace getVariable "AGM_WeaponSelect_AllMagazines";
//AGM_WeaponSelect_AllMuzzlesCount = count AGM_WeaponSelect_AllMuzzles;
// hide grenade count if none is selected
[uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
["Soldier", {[_this select 0, call AGM_WeaponSelect_fnc_getSelectedGrenade != ""] call AGM_WeaponSelect_fnc_toggleGrenadeCount}] call AGM_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"

View File

@ -1,234 +0,0 @@
class CfgPatches {
class AGM_WeaponSelect {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"commy2", "KoffeinFlummi", "CAA-Picard"};
authorUrl = "https://github.com/commy2/";
};
};
class CfgFunctions {
class AGM_WeaponSelect {
class AGM_WeaponSelect {
file = "\AGM_WeaponSelect\functions";
class actionThrow;
class actionThrowCondition;
class countMagazinesForGrenadeMuzzle;
class displayGrenadeTypeAndNumber;
class findNextGrenadeMagazine;
class findNextGrenadeMuzzle;
class fireSmokeLauncher;
class getSelectedGrenade;
class getWeaponModes;
class getWeaponMuzzles;
class playChangeFiremodeSound;
class putWeaponAway;
class selectGrenadeAll;
class selectGrenadeFrag;
class selectGrenadeOther;
class selectWeaponMode;
class selectWeaponMuzzle;
class selectWeaponVehicle;
class selectMagazineVehicle;
class setNextGrenadeMuzzle;
class throwGrenade;
class toggleGrenadeCount;
};
};
};
class Extended_PostInit_EventHandlers {
class AGM_WeaponSelect {
clientInit = "call compile preprocessFileLineNumbers '\AGM_WeaponSelect\clientInit.sqf';";
};
};
class Extended_Init_EventHandlers {
class CAManBase {
class AGM_WeaponSelect_ThrowGrenade {
clientInit = "_this call compile preprocessFileLineNumbers '\AGM_WeaponSelect\initActions.sqf';";
};
};
};
class Extended_Respawn_EventHandlers {
class CAManBase {
class AGM_WeaponSelect_ThrowGrenade {
respawn = "[_this, ""{_this call compile preprocessFileLineNumbers '\AGM_WeaponSelect\initActions.sqf';}""] call AGM_Core_fnc_execRemoteFnc;";
};
};
};
class Extended_FiredBIS_EventHandlers {
class CAManBase {
class AGM_WeaponSelect_ThrowGrenade {
clientFiredBIS = "if (_this select 0 == AGM_player) then {_this call AGM_WeaponSelect_fnc_throwGrenade;};";
};
};
};
class AGM_Core_Default_Keys {
class selectPistol {
displayName = "$STR_AGM_WeaponSelect_SelectPistol";
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
statement = "[_player, handgunWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMode";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
key = 2;
shift = 0;
control = 0;
alt = 0;
};
class selectRifle {
displayName = "$STR_AGM_WeaponSelect_SelectRifle";
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
statement = "[_player, primaryWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMode";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
key = 3;
shift = 0;
control = 0;
alt = 0;
};
class selectLauncher {
displayName = "$STR_AGM_WeaponSelect_SelectLauncher";
condition = "_player == _vehicle";
statement = "[_player, secondaryWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMode";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
key = 5;
shift = 0;
control = 0;
alt = 0;
};
/*class selectPistolMuzzle {
displayName = "Select Pistol Muzzle";
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
statement = "[_player, handgunWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMuzzle";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
disabled = 1;
key = 7;
shift = 0;
control = 0;
alt = 0;
};*/
class selectRifleMuzzle {
displayName = "$STR_AGM_WeaponSelect_SelectRifleMuzzle";
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
statement = "[_player, primaryWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMuzzle";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
key = 4;
shift = 0;
control = 0;
alt = 0;
};
/*class selectLauncherMuzzle {
displayName = "Select Launcher Muzzle";
condition = "_player == _vehicle";
statement = "[_player, secondaryWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMuzzle";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
disabled = 1;
key = 8;
shift = 0;
control = 0;
alt = 0;
};*/
class selectBinocular {
displayName = "$STR_AGM_WeaponSelect_SelectBinocular";
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
statement = "[_player, binocular _player] call AGM_WeaponSelect_fnc_selectWeaponMode";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
key = 6;
shift = 0;
control = 0;
alt = 0;
};
class selectGrenadeFrag {
displayName = "$STR_AGM_WeaponSelect_SelectGrenadeFrag";
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
statement = "[_player] call AGM_WeaponSelect_fnc_selectGrenadeFrag";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
key = 7;
shift = 0;
control = 0;
alt = 0;
};
class selectGrenadeOther {
displayName = "$STR_AGM_WeaponSelect_SelectGrenadeOther";
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
statement = "[_player] call AGM_WeaponSelect_fnc_selectGrenadeOther";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
key = 8;
shift = 0;
control = 0;
alt = 0;
};
class holsterWeapon {
displayName = "$STR_AGM_WeaponSelect_HolsterWeapon";
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
statement = "[_player] call AGM_WeaponSelect_fnc_putWeaponAway";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
key = 11;
shift = 0;
control = 0;
alt = 0;
};
class engineOn {
displayName = "$STR_AGM_WeaponSelect_EngineOn";
condition = "_player != _vehicle && {_player == driver _vehicle} && {!isEngineOn _vehicle}";
statement = "_vehicle engineOn true";
key = 3;
shift = 0;
control = 0;
alt = 0;
};
class engineOff {
displayName = "$STR_AGM_WeaponSelect_EngineOff";
condition = "_player != _vehicle && {_player == driver _vehicle} && {isEngineOn _vehicle}";
statement = "_vehicle engineOn false";
key = 2;
shift = 0;
control = 0;
alt = 0;
};
class selectMaingun {
displayName = "$STR_AGM_WeaponSelect_SelectMainGun";
condition = "_player != _vehicle";
statement = "[_player, _vehicle, 0] call AGM_WeaponSelect_fnc_selectWeaponVehicle";
key = 4;
shift = 0;
control = 0;
alt = 0;
};
class selectMachineGun {
displayName = "$STR_AGM_WeaponSelect_SelectMachineGun";
condition = "_player != _vehicle";
statement = "[_player, _vehicle, 1] call AGM_WeaponSelect_fnc_selectWeaponVehicle";
key = 5;
shift = 0;
control = 0;
alt = 0;
};
class selectMissile {
displayName = "$STR_AGM_WeaponSelect_SelectMissiles";
condition = "_player != _vehicle";
statement = "[_player, _vehicle, 2] call AGM_WeaponSelect_fnc_selectWeaponVehicle";
key = 6;
shift = 0;
control = 0;
alt = 0;
};
class fireSmokeLauncher {
displayName = "$STR_AGM_WeaponSelect_FireSmokeLauncher";
condition = "_player != _vehicle && {_player == commander _vehicle}";
statement = "[_vehicle] call AGM_WeaponSelect_fnc_fireSmokeLauncher";
key = 10;
shift = 0;
control = 0;
alt = 0;
};
};

View File

@ -1,4 +0,0 @@
// by commy2
_text = [localize "STR_AGM_WeaponSelect_NoGrenadeSelected", [1,0,0]] call AGM_Core_fnc_stringToColoredText;
[composeText [lineBreak, _text]] call AGM_Core_fnc_displayTextStructured;

View File

@ -1,32 +0,0 @@
// by commy2
_muzzle = call AGM_WeaponSelect_fnc_getSelectedGrenade;
_isInput = inputAction "CycleThrownItems" > 0;
if !(_isInput isEqualTo (missionNamespace getVariable ["AGM_WeaponSelect_CycleThrownItemsState", false])) then {
if (_isInput) then {
if (_muzzle == "") then {
[_this select 1] spawn AGM_WeaponSelect_fnc_selectGrenadeAll;
} else {
[_this select 1] spawn AGM_WeaponSelect_fnc_selectGrenadeAll;//
};
};
AGM_WeaponSelect_CycleThrownItemsState = _isInput;
};
if !([_this select 1] call AGM_Core_fnc_canUseWeapon) exitWith {false};
if (_muzzle == "") exitWith {["All"] call AGM_WeaponSelect_fnc_findNextGrenadeMagazine != ""};
// fix auto muzzle swap after entering or leaving a vehicle
if (_this select 0 != missionNamespace getVariable ["AGM_WeaponSelect_CurrentGrenadeMuzzleVehicle", objNull]) then {
[_this select 1, _muzzle] call AGM_WeaponSelect_fnc_setNextGrenadeMuzzle;
AGM_WeaponSelect_CurrentGrenadeMuzzleVehicle = _this select 0;
};
if ((_this select 1) ammo _muzzle == 0) exitWith {
if (AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag) then {AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = ""} else {AGM_WeaponSelect_CurrentGrenadeMuzzleOther = ""};
[uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
true
};
false

View File

@ -1,44 +0,0 @@
/*
* Author: CAA-Picard
*
* Count how many grenade magazines the unit has on the uniform and vest.
*
* Argument:
* 0: Muzzle name
*
* Return value:
* 0: Number of magazines
* 1: First magazine name
*/
private ["_player", "_muzzle"];
_player = _this select 0;
_muzzle = _this select 1;
_uniformMags = getMagazineCargo uniformContainer _player;
_vestMags = getMagazineCargo vestContainer _player;
_backPackMags = getMagazineCargo backpackContainer _player;
_numberOfMagazines = 0;
_magazineClasses = getArray (configFile >> "CfgWeapons" >> "Throw" >> _muzzle >> "magazines" );
_firstMagazine = _magazineClasses select 0;
{
_indexInUniform = (_uniformMags select 0) find _x;
if (_indexInUniform > -1) then {
_numberOfMagazines = _numberOfMagazines + ((_uniformMags select 1) select _indexInUniform);
_firstMagazine = _x;
};
_indexInVest = (_vestMags select 0) find _x;
if (_indexInVest > -1) then {
_numberOfMagazines = _numberOfMagazines + ((_vestMags select 1) select _indexInVest);
_firstMagazine = _x;
};
_indexInBackpack = (_backpackMags select 0) find _x;
if (_indexInBackpack > -1) then {
_numberOfMagazines = _numberOfMagazines + ((_backpackMags select 1) select _indexInBackpack);
_firstMagazine = _x;
};
} forEach _magazineClasses;
[_numberOfMagazines, _firstMagazine]

View File

@ -1,32 +0,0 @@
// by commy2
private ["_scope", "_allMags", "_allMuzzles", "_magazines", "_start", "_index", "_nextMagazine"];
_scope = _this select 0; //"All", "Frag" or "NonFrag"
_allMags = missionNamespace getVariable [format ["AGM_WeaponSelect_%1Magazines", _scope], []];
_allMuzzles = missionNamespace getVariable [format ["AGM_WeaponSelect_%1Muzzles", _scope], []];
_magazines = magazines AGM_player;
_start = [AGM_WeaponSelect_CurrentGrenadeMuzzleOther, AGM_WeaponSelect_CurrentGrenadeMuzzleFrag] select AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag;
_index = _allMuzzles find _start;
scopeName "SearchMain";
_nextMagazine = "";
for "_index" from (_index + 1) to (count _allMuzzles - 1) do {
{
if (_x in (_allMags select _index)) exitWith {_nextMagazine = _x; breakTo "SearchMain"};
} count _magazines;
};
if (_nextMagazine != "") exitWith {_nextMagazine};
for "_index" from 0 to _index do {
{
if (_x in (_allMags select _index)) exitWith {_nextMagazine = _x; breakTo "SearchMain"};
} count _magazines;
};
_nextMagazine

View File

@ -1,32 +0,0 @@
// by commy2
private ["_scope", "_allMags", "_allMuzzles", "_magazines", "_start", "_index", "_nextMuzzle"];
_scope = _this select 0; //"All", "Frag" or "NonFrag"
_allMags = missionNamespace getVariable [format ["AGM_WeaponSelect_%1Magazines", _scope], []];
_allMuzzles = missionNamespace getVariable [format ["AGM_WeaponSelect_%1Muzzles", _scope], []];
_magazines = magazines AGM_player;
_start = [AGM_WeaponSelect_CurrentGrenadeMuzzleOther, AGM_WeaponSelect_CurrentGrenadeMuzzleFrag] select AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag;
_index = _allMuzzles find _start;
scopeName "SearchMain";
_nextMuzzle = "";
for "_index" from (_index + 1) to (count _allMuzzles - 1) do {
{
if (_x in (_allMags select _index)) exitWith {_nextMuzzle = _allMuzzles select _index; breakTo "SearchMain"};
} count _magazines;
};
if (_nextMuzzle != "") exitWith {_nextMuzzle};
for "_index" from 0 to _index do {
{
if (_x in (_allMags select _index)) exitWith {_nextMuzzle = _allMuzzles select _index; breakTo "SearchMain"};
} count _magazines;
};
_nextMuzzle

View File

@ -1,37 +0,0 @@
// by commy2
private ["_vehicle", "_turret", "_weapons"];
_vehicle = _this select 0;
_turret = [typeOf _vehicle] call AGM_Core_fnc_getTurretCommander;
_weapons = _vehicle weaponsTurret _turret;
if (
count _weapons > 1
|| {count _weapons > 0 && {!(_weapons select 0 in ["SmokeLauncher", "BWA3_SmokeLauncher"])}} // @todo somebody might use custom smoke launcher weapons aswell, maybe ...
) then {
//This doesn't work reliably for vehilces with additional weapons for the commander. Select smoke launcher instead.
private "_index";
// avoid infinite loop
if !("SmokeLauncher" in _weapons) exitWith {};
_index = 0;
while {
_vehicle currentWeaponTurret _turret != "SmokeLauncher"
} do {
[commander _vehicle, _vehicle, _index] call AGM_WeaponSelect_fnc_selectWeaponVehicle;
_index = _index + 1;
};
} else {
// fire away!
private "_logic";
_logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"];
_logic action ["useWeapon", _vehicle, commander _vehicle, 0];
deleteVehicle _logic;
};

View File

@ -1,3 +0,0 @@
// by commy2
[AGM_WeaponSelect_CurrentGrenadeMuzzleOther, AGM_WeaponSelect_CurrentGrenadeMuzzleFrag] select AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag

View File

@ -1,51 +0,0 @@
/*
* Author: CAA-Picard, commy2
*
* Cycle through all grenades.
*
* Argument:
* None
*
* Return value:
* None
*/
private ["_player", "_nextMuzzle"];
_player = _this select 0;
_nextMuzzle = ["All"] call AGM_WeaponSelect_fnc_findNextGrenadeMuzzle;
if (_nextMuzzle != "") then {
private ["_magazines", "_magazine", "_count", "_return"];
_magazines = AGM_WeaponSelect_AllMagazines select (AGM_WeaponSelect_AllMuzzles find _nextMuzzle);
reverse _magazines;
_magazine = "";
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _player;
// There is a muzzle with magazines --> cycle to it
[_player, _nextMuzzle] call AGM_WeaponSelect_fnc_setNextGrenadeMuzzle;
[_magazine, _count] call AGM_WeaponSelect_fnc_displayGrenadeTypeAndNumber;
[uiNamespace getVariable "AGM_dlgSoldier", true] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
} else {
// There is a no muzzle with magazines --> select nothing
AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = ""; AGM_WeaponSelect_CurrentGrenadeMuzzleOther = "";
_text = [localize "STR_AGM_WeaponSelect_NoGrenadesLeft", [1,0,0]] call AGM_Core_fnc_stringToColoredText;
[composeText [lineBreak, _text]] call AGM_Core_fnc_displayTextStructured;
[uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
};
if (_nextMuzzle in AGM_WeaponSelect_FragMuzzles) then {
AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = _nextMuzzle;
AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = true;
} else {
AGM_WeaponSelect_CurrentGrenadeMuzzleOther = _nextMuzzle;
AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = false;
};

View File

@ -1,45 +0,0 @@
/*
* Author: CAA-Picard, commy2
*
* Cycle through frags.
*
* Argument:
* None
*
* Return value:
* None
*/
private ["_player", "_nextMuzzle"];
_player = _this select 0;
_nextMuzzle = ["Frag"] call AGM_WeaponSelect_fnc_findNextGrenadeMuzzle;
if (_nextMuzzle != "") then {
AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = _nextMuzzle;
private ["_magazines", "_magazine", "_count", "_return"];
_magazines = AGM_WeaponSelect_FragMagazines select (AGM_WeaponSelect_FragMuzzles find _nextMuzzle);
reverse _magazines;
_magazine = "";
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _player;
// There is a muzzle with magazines --> cycle to it
[_player, _nextMuzzle] call AGM_WeaponSelect_fnc_setNextGrenadeMuzzle;
[_magazine, _count] call AGM_WeaponSelect_fnc_displayGrenadeTypeAndNumber;
[uiNamespace getVariable "AGM_dlgSoldier", true] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
} else {
// There is a no muzzle with magazines --> select nothing
AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = "";
_text = [localize "STR_AGM_WeaponSelect_NoFragsLeft", [1,0,0]] call AGM_Core_fnc_stringToColoredText;
[composeText [lineBreak, _text]] call AGM_Core_fnc_displayTextStructured;
[uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
};
AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = true;

View File

@ -1,45 +0,0 @@
/*
* Author: CAA-Picard, commy2
*
* Cycle through non explosive grenades.
*
* Argument:
* None
*
* Return value:
* None
*/
private ["_player", "_nextMuzzle"];
_player = _this select 0;
_nextMuzzle = ["NonFrag"] call AGM_WeaponSelect_fnc_findNextGrenadeMuzzle;
if (_nextMuzzle != "") then {
AGM_WeaponSelect_CurrentGrenadeMuzzleOther = _nextMuzzle;
private ["_magazines", "_magazine", "_count", "_return"];
_magazines = AGM_WeaponSelect_NonFragMagazines select (AGM_WeaponSelect_NonFragMuzzles find _nextMuzzle);
reverse _magazines;
_magazine = "";
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _player;
// There is a muzzle with magazines --> cycle to it
[_player, _nextMuzzle] call AGM_WeaponSelect_fnc_setNextGrenadeMuzzle;
[_magazine, _count] call AGM_WeaponSelect_fnc_displayGrenadeTypeAndNumber;
[uiNamespace getVariable "AGM_dlgSoldier", true] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
} else {
// There is a no muzzle with magazines --> select nothing
AGM_WeaponSelect_CurrentGrenadeMuzzleOther = "";
_text = [localize "STR_AGM_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call AGM_Core_fnc_stringToColoredText;
[composeText [lineBreak, _text]] call AGM_Core_fnc_displayTextStructured;
[uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
};
AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = false;

View File

@ -1,52 +0,0 @@
// by commy2
private ["_vehicle", "_index", "_turret", "_weapon", "_magazine"];
_vehicle = _this select 0;
_index = _this select 1;
_turret = [player] call AGM_Core_fnc_getTurretIndex;
/* WIP
_weapon = currentWeapon _vehicle;
_weapons = _vehicle weaponsTurret _turret;
_magazines = _vehicle magazinesTurret _turret;
vehicle player loadMagazine [[0], "cannon_120mm", "32Rnd_120mm_APFSDS_shells_Tracer_Red"]
["cannon_105mm","LMG_M200"]
vehicle player loadMagazine [[0,0], "SmokeLauncher", "SmokeLauncherMag"]
player action ["SwitchMagazine", vehicle player, player, 1];
*/

View File

@ -1,48 +0,0 @@
/*
* Author: commy2
*
* The player will select the specified weapon or will change to the next firing mode if the weapon was already selected.
*
* Argument:
* 0: A weapon (String)
*
* Return value:
* None.
*/
private ["_player", "_weapon", "_muzzles", "_modes", "_count", "_index", "_muzzle", "_mode"];
_player = _this select 0;
_weapon = _this select 1;
if (_weapon == "") exitWith {};
if (currentWeapon _player != _weapon) exitWith {
_player selectWeapon _weapon;
};
// unlock safety
if (_weapon in (_player getVariable ["AGM_SafeMode_safedWeapons", []])) exitWith {
[_player, _weapon, _weapon] call AGM_SafeMode_fnc_unlockSafety;
};
_muzzles = [_weapon] call AGM_WeaponSelect_fnc_getWeaponMuzzles;
_modes = [_weapon] call AGM_WeaponSelect_fnc_getWeaponModes;
_count = count _modes;
_index = (_modes find currentWeaponMode _player) + 1;
if (_index > _count - 1) then {_index = 0};
_muzzle = _muzzles select 0;
_mode = _modes select _index;
_index = 0;
while {
_index < 100 && {currentMuzzle _player != _muzzle || {currentWeaponMode _player != _mode}}
} do {
_player action ["SwitchWeapon", _player, _player, _index];
_index = _index + 1;
};
// play fire mode selector sound
[_player, _weapon] call AGM_WeaponSelect_fnc_playChangeFiremodeSound;

View File

@ -1,46 +0,0 @@
/*
* Author: commy2
*
* The player will select the specified weapon and change to the first additional muzzle. E.g. the grenade launcher of a assault rifle.
*
* Argument:
* 0: A weapon (String)
*
* Return value:
* None.
*/
private ["_player", "_weapon", "_muzzles", "_count", "_index", "_muzzle"];
_player = _this select 0;
_weapon = _this select 1;
if (_weapon == "") exitWith {};
_muzzles = [_weapon] call AGM_WeaponSelect_fnc_getWeaponMuzzles;
if (currentWeapon _player != _weapon) exitWith {
if (count _muzzles > 1) then {
// unlock safety
/*if (_weapon in (_player getVariable ["AGM_SafeMode_safedWeapons", []])) exitWith {
[_player, _weapon, _muzzles select 1] call AGM_SafeMode_fnc_unlockSafety;
};*/
_player selectWeapon (_muzzles select 1);
};
};
_count = count _muzzles;
_index = (_muzzles find currentMuzzle _player) + 1;
if (_index > _count - 1) then {_index = 1};
_muzzle = _muzzles select _index;
_index = 0;
while {
_index < 100 && {currentMuzzle _player != _muzzle}
} do {
_player action ["SwitchWeapon", _player, _player, _index];
_index = _index + 1;
};

View File

@ -1,37 +0,0 @@
// by commy2
private ["_player", "_vehicle", "_index", "_turret", "_weapons", "_weapon"];
_player = _this select 0;
_vehicle = _this select 1;
_index = _this select 2;
_turret = [_player] call AGM_Core_fnc_getTurretIndex;
if (_turret isEqualTo [] && {_player == driver _vehicle}) then {
_weapons = weapons _vehicle;
if (_index > count _weapons - 1) exitWith {};
_weapon = _weapons select _index;
_index = 0;
while {
_index < 100 && {currentWeapon _vehicle != _weapon}
} do {
_player action ["SwitchWeapon", _vehicle, _player, _index];
_index = _index + 1;
};
} else {
_weapons = _vehicle weaponsTurret _turret;
if (_index > count _weapons - 1) exitWith {};
_weapon = _weapons select _index;
_index = 0;
while {
_index < 100 && {_vehicle currentWeaponTurret _turret != _weapon}
} do {
_player action ["SwitchWeapon", _vehicle, _player, _index];
_index = _index + 1;
};
};

View File

@ -1,100 +0,0 @@
/*
* Author: CAA-Picard
*
* Select the next grenade muzzle to throw.
*
* Argument:
* muzzle name
*
* Return value:
* None
*
*/
private ["_player", "_muzzle"];
_player = _this select 0;
_muzzle = _this select 1;
_uniformMags = getMagazineCargo uniformContainer _player;
_vestMags = getMagazineCargo vestContainer _player;
_backPackMags = getMagazineCargo backpackContainer _player;
_uniformMagsToRemove = [];
_vestMagsToRemove = [];
_backPackMagsToRemove = [];
_firstMagazine = "";
// Collect which magazines to remove
_throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles");
{
_muzzleName = _x;
_muzzleMagazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _muzzleName >> "magazines" );
if (_muzzle != _muzzleName) then {
{
_index = (_uniformMags select 0) find _x;
if (_index > -1) then {
_uniformMagsToRemove = _uniformMagsToRemove + [[_x, (_uniformMags select 1) select _index]];
};
_index = (_vestMags select 0) find _x;
if (_index > -1) then {
_vestMagsToRemove = _vestMagsToRemove + [[_x, (_vestMags select 1) select _index]];
};
_index = (_backpackMags select 0) find _x;
if (_index > -1) then {
_backpackMagsToRemove = _backpackMagsToRemove + [[_x, (_backpackMags select 1) select _index]];
};
} forEach _muzzleMagazines;
} else {
{
_index = (_uniformMags select 0) find _x;
if (_index > -1) then {
_firstMagazine = _x;
};
_index = (_vestMags select 0) find _x;
if (_index > -1) then {
_firstMagazine = _x;
};
_index = (_backpackMags select 0) find _x;
if (_index > -1) then {
_firstMagazine = _x;
};
} forEach _muzzleMagazines;
};
} forEach _throwMuzzleNames;
// Remove all magazines except those we are switching to --> this breaks the selector
{
for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do {
_player removeItem (_x select 0);
};
} forEach _uniformMagsToRemove;
{
for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do {
_player removeItem (_x select 0);
};
} forEach _vestMagsToRemove;
{
for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do {
_player removeItem (_x select 0);
};
} forEach _backPackMagsToRemove;
// Readd magazines
{
for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do {
_player addItemToUniform (_x select 0);
};
} forEach _uniformMagsToRemove;
{
for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do {
_player addItemToVest (_x select 0);
};
} forEach _vestMagsToRemove;
{
for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do {
_player addItemToBackpack (_x select 0);
};
} forEach _backPackMagsToRemove;

View File

@ -1,19 +0,0 @@
// by commy2
private ["_unit", "_weapon", "_magazine"];
_unit = _this select 0;
_weapon = _this select 1;
_magazine = _this select 5;
if (_weapon != "Throw") exitWith {};
private "_count";
_count = {_x == _magazine} count magazines _unit;
[_magazine, _count] call AGM_WeaponSelect_fnc_displayGrenadeTypeAndNumber;
if (_count == 0) then {
if (AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag) then {AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = ""} else {AGM_WeaponSelect_CurrentGrenadeMuzzleOther = ""};
[uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
};

View File

@ -1,23 +0,0 @@
// by commy2
private ["_dlg", "_show"];
_dlg = _this select 0;
_show = _this select 1;
if (_show) then {
private "_config";
_config = configFile >> "RscInGameUI" >> "RscUnitInfo" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_GrenadeCount";
(_dlg displayCtrl 151) ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")];
_config = configFile >> "RscInGameUI" >> "RscUnitInfo" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_GrenadeType";
(_dlg displayCtrl 152) ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")];
} else {
(_dlg displayCtrl 151) ctrlSetPosition [0,0,0,0];
(_dlg displayCtrl 152) ctrlSetPosition [0,0,0,0];
};
(_dlg displayCtrl 151) ctrlCommit 0;
(_dlg displayCtrl 152) ctrlCommit 0;

View File

@ -1,25 +0,0 @@
// by commy2
private ["_unit", "_id"];
_unit = _this select 0;
/*_id = [
_unit,
format ["<t color=""#FFFFFF"" >%1</t>", localize "STR_AGM_WeaponSelect_ReadyGrenade"],
"Throw",
AGM_WeaponSelect_fnc_actionThrowCondition,
AGM_WeaponSelect_fnc_actionThrow,
{true},
{[_this select 1] call AGM_WeaponSelect_fnc_selectGrenadeAll},
2
] call AGM_Core_fnc_addActionMenuEventHandler;*/
_id = [
_unit,
"Throw",
AGM_WeaponSelect_fnc_actionThrowCondition,
AGM_WeaponSelect_fnc_actionThrow
] call AGM_Core_fnc_addActionEventHandler;
_unit setVariable ["AGM_WeaponSelect_ThrowActionID", _id];

View File

@ -99,16 +99,16 @@ class ACE_Parameters_Boolean {
};
class ACE_canInteractConditions {
class ACE_Interaction_isNotEscorting {
class GVAR(isNotEscorting) {
condition = QUOTE( !(_player getVariable ['ACE_isEscorting', false]) );
};
class ACE_Interaction_isNotCaptive {
class GVAR(isNotCaptive) {
condition = QUOTE( !(_player getVariable ['ACE_isCaptive', false]) );
};
class ACE_Interaction_isNotSurrendering {
class GVAR(isNotSurrendering) {
condition = QUOTE( !(_player getVariable ['ACE_isSurrender', false]) );
};
class ACE_Interaction_isNotSwimming {
class GVAR(isNotSwimming) {
condition = QUOTE( !underwater _player );
};
};

View File

@ -0,0 +1 @@
z\ace\addons\weaponselect

View File

@ -0,0 +1,14 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_FiredBIS_EventHandlers {
class CAManBase {
class GVAR(ThrowGrenade) {
clientFiredBIS = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(throwGrenade)};);
};
};
};

View File

@ -0,0 +1,65 @@
#include "script_component.hpp"
PREP(countMagazinesForGrenadeMuzzle);
PREP(displayGrenadeTypeAndNumber);
PREP(findNextGrenadeMagazine);
PREP(findNextGrenadeMuzzle);
PREP(fireSmokeLauncher);
PREP(getSelectedGrenade);
PREP(getWeaponModes);
PREP(getWeaponMuzzles);
PREP(playChangeFiremodeSound);
PREP(putWeaponAway);
PREP(selectGrenadeAll);
PREP(selectGrenadeFrag);
PREP(selectGrenadeOther);
PREP(selectWeaponMode);
PREP(selectWeaponMuzzle);
PREP(selectWeaponVehicle);
PREP(setNextGrenadeMuzzle);
PREP(throwGrenade);
// prepare grenades from config
GVAR(CurrentGrenadeMuzzleIsFrag) = true;
GVAR(CurrentGrenadeMuzzleFrag) = "";
GVAR(CurrentGrenadeMuzzleOther) = "";
// Collect frag and other muzzles separately
with uiNamespace do {
if (isNil QGVAR(FragMuzzles)) then {
GVAR(FragMuzzles) = [];
GVAR(NonFragMuzzles) = [];
GVAR(AllMuzzles) = [];
GVAR(FragMagazines) = [];
GVAR(NonFragMagazines) = [];
GVAR(AllMagazines) = [];
{
_magazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines");
_magazine = _magazines select 0;
_ammo = getText (configfile >> "CfgMagazines" >> _magazine >> "ammo");
_explosive = getNumber (configfile >> "CfgAmmo" >> _ammo >> "explosive");
if (_explosive == 0) then {
GVAR(NonFragMuzzles) pushBack _x;
GVAR(NonFragMagazines) pushBack _magazines;
} else {
GVAR(FragMuzzles) pushBack _x;
GVAR(FragMagazines) pushBack _magazines;
};
GVAR(AllMuzzles) pushBack _x;
GVAR(AllMagazines) pushBack _magazines;
} forEach getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles");
};
};
GVAR(FragMuzzles) = uiNamespace getVariable QGVAR(FragMuzzles);
GVAR(NonFragMuzzles) = uiNamespace getVariable QGVAR(NonFragMuzzles);
GVAR(AllMuzzles) = uiNamespace getVariable QGVAR(AllMuzzles);
GVAR(FragMagazines) = uiNamespace getVariable QGVAR(FragMagazines);
GVAR(NonFragMagazines) = uiNamespace getVariable QGVAR(NonFragMagazines);
GVAR(AllMagazines) = uiNamespace getVariable QGVAR(AllMagazines);

View File

@ -0,0 +1,177 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"commy2","KoffeinFlummi","CAA-Picard"};
authorUrl = "https://github.com/commy2/";
VERSION_CONFIG;
};
};
#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;
};
};

View File

@ -0,0 +1,55 @@
/*
* Author: CAA-Picard
*
* Count how many grenade magazines the unit has on the uniform and vest.
*
* Argument:
* 0: Muzzle name
*
* Return value:
* 0: Number of magazines
* 1: First magazine name
*/
#include "script_component.hpp"
private ["_unit", "_muzzle"];
_unit = _this select 0;
_muzzle = _this select 1;
private ["_uniformMags", "_vestMags", "_backPackMags"];
_uniformMags = getMagazineCargo uniformContainer _unit;
_vestMags = getMagazineCargo vestContainer _unit;
_backPackMags = getMagazineCargo backpackContainer _unit;
private ["_numberOfMagazines", "_magazineClasses", "_firstMagazine"];
_numberOfMagazines = 0;
_magazineClasses = getArray (configFile >> "CfgWeapons" >> "Throw" >> _muzzle >> "magazines");
_firstMagazine = _magazineClasses select 0;
{
private ["_indexInUniform", "_indexInVest", "_indexInBackpack"];
_indexInUniform = (_uniformMags select 0) find _x;
if (_indexInUniform > -1) then {
_numberOfMagazines = _numberOfMagazines + ((_uniformMags select 1) select _indexInUniform);
_firstMagazine = _x;
};
_indexInVest = (_vestMags select 0) find _x;
if (_indexInVest > -1) then {
_numberOfMagazines = _numberOfMagazines + ((_vestMags select 1) select _indexInVest);
_firstMagazine = _x;
};
_indexInBackpack = (_backpackMags select 0) find _x;
if (_indexInBackpack > -1) then {
_numberOfMagazines = _numberOfMagazines + ((_backpackMags select 1) select _indexInBackpack);
_firstMagazine = _x;
};
} forEach _magazineClasses;
[_numberOfMagazines, _firstMagazine]

View File

@ -10,18 +10,19 @@
* Return value:
* None
*/
#include "script_component.hpp"
private ["_magazine", "_numberofMagazines"];
_magazine = _this select 0;
_numberofMagazines = _this select 1;
_color = [];
if (_numberOfMagazines > 0) then {
_color = [1,1,1];
} else {
_color = [1,0,0];
};
private ["_color", "_name", "_text", "_picture"];
_color = [[1,0,0], [1,1,1]] select (_numberOfMagazines > 0);
_name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNameShort");
_text = [format["%1 x%2", _name, _numberOfMagazines], _color] call EFUNC(common,stringToColoredText);
_picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture");
_text = [format["%1 x%2", _name, _numberOfMagazines], _color] call AGM_Core_fnc_stringToColoredText;
[_text, _picture] call AGM_Core_fnc_displayTextPicture;
[_text, _picture] call EFUNC(common,displayTextPicture);

View File

@ -0,0 +1,35 @@
// by commy2
#include "script_component.hpp"
private ["_type", "_allMags", "_allMuzzles", "_magazines"];
_type = _this select 0; //"All", "Frag" or "NonFrag"
_allMags = missionNamespace getVariable [format [QGVAR(%1Magazines), _type], []];
_allMuzzles = missionNamespace getVariable [format [QGVAR(%1Muzzles), _type], []];
_magazines = magazines ACE_player;
private ["_start", "_index", "_nextMagazine"];
_start = [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag);
_index = _allMuzzles find _start;
scopeName "SearchMain";
_nextMagazine = "";
for "_index" from (_index + 1) to (count _allMuzzles - 1) do {
{
if (_x in (_allMags select _index)) exitWith {_nextMagazine = _x; breakTo "SearchMain"};
} count _magazines;
};
if (_nextMagazine != "") exitWith {_nextMagazine};
for "_index" from 0 to _index do {
{
if (_x in (_allMags select _index)) exitWith {_nextMagazine = _x; breakTo "SearchMain"};
} count _magazines;
};
_nextMagazine

View File

@ -0,0 +1,35 @@
// by commy2
#include "script_component.hpp"
private ["_type", "_allMags", "_allMuzzles", "_magazines"];
_type = _this select 0; //"All", "Frag" or "NonFrag"
_allMags = missionNamespace getVariable [format [QGVAR(%1Magazines), _type], []];
_allMuzzles = missionNamespace getVariable [format [QGVAR(%1Muzzles), _type], []];
_magazines = magazines ACE_player;
private ["_start", "_index", "_nextMuzzle"];
_start = [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag);
_index = _allMuzzles find _start;
scopeName "SearchMain";
_nextMuzzle = "";
for "_index" from (_index + 1) to (count _allMuzzles - 1) do {
{
if (_x in (_allMags select _index)) exitWith {_nextMuzzle = _allMuzzles select _index; breakTo "SearchMain"};
} count _magazines;
};
if (_nextMuzzle != "") exitWith {_nextMuzzle};
for "_index" from 0 to _index do {
{
if (_x in (_allMags select _index)) exitWith {_nextMuzzle = _allMuzzles select _index; breakTo "SearchMain"};
} count _magazines;
};
_nextMuzzle

View File

@ -0,0 +1,39 @@
// by commy2
#include "script_component.hpp"
private ["_vehicle", "_turret", "_weapons"];
_vehicle = _this select 0;
_turret = [typeOf _vehicle] call EFUNC(common,getTurretCommander);
_weapons = _vehicle weaponsTurret _turret;
if (
count _weapons > 1
|| {count _weapons > 0 && {!(_weapons select 0 in ["SmokeLauncher", "BWA3_SmokeLauncher"])}} // @todo somebody might use custom smoke launcher weapons aswell, maybe ...
) then {
//This doesn't work reliably for vehilces with additional weapons for the commander. Select smoke launcher instead.
private "_index";
// avoid infinite loop
if !("SmokeLauncher" in _weapons) exitWith {};
_index = 0;
while {
_vehicle currentWeaponTurret _turret != "SmokeLauncher"
} do {
[commander _vehicle, _vehicle, _index] call FUNC(selectWeaponVehicle);
_index = _index + 1;
};
} else {
// fire away!
private "_logic";
_logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"];
_logic action ["useWeapon", _vehicle, commander _vehicle, 0];
deleteVehicle _logic;
};

View File

@ -0,0 +1,4 @@
// by commy2
#include "script_component.hpp"
[GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag)

View File

@ -9,6 +9,7 @@
* Return value:
* All firing modes (Array)
*/
#include "script_component.hpp"
private ["_weapon", "_modes"];
@ -16,11 +17,14 @@ _weapon = _this select 0;
_modes = [];
{
if (getNumber (configFile >> "CfgWeapons" >> _weapon >> _x >> "showToPlayer") == 1) then {
_modes pushBack _x;
};
if (_x == "this") then {
_modes pushBack _weapon;
};
if (getNumber (configFile >> "CfgWeapons" >> _weapon >> _x >> "showToPlayer") == 1) then {
_modes pushBack _x;
};
if (_x == "this") then {
_modes pushBack _weapon;
};
} forEach getArray (configfile >> "CfgWeapons" >> _weapon >> "modes");
_modes

View File

@ -9,6 +9,7 @@
* Return value:
* All weapon muzzles (Array)
*/
#include "script_component.hpp"
private ["_weapon", "_muzzles"];
@ -17,6 +18,7 @@ _weapon = _this select 0;
_muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles");
if ("this" in _muzzles) then {
_muzzles set [_muzzles find "this", _weapon];
_muzzles set [_muzzles find "this", _weapon];
};
_muzzles

View File

@ -1,4 +1,5 @@
// by commy2
#include "script_component.hpp"
private ["_unit", "_weapon", "_sound"];
@ -11,12 +12,12 @@ if (count _sound == 0) exitWith {};
// add file extension
if call {
{
if (toLower (_sound select 0) find _x == count toArray (_sound select 0) - count toArray _x - 1) exitWith {false};
true
} forEach [".wav", ".ogg", ".wss"];
{
if (toLower (_sound select 0) find _x == count toArray (_sound select 0) - count toArray _x - 1) exitWith {false};
true
} forEach [".wav", ".ogg", ".wss"];
} then {
_sound set [0, (_sound select 0) + ".wss"];
_sound set [0, (_sound select 0) + ".wss"];
};
// add default volume, pitch and distance

View File

@ -9,11 +9,12 @@
* Return value:
* None.
*/
#include "script_component.hpp"
private "_player";
private "_unit";
_player = _this select 0;
_unit = _this select 0;
[_player] call AGM_Core_fnc_fixLoweredRifleAnimation;
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
_player action ["SwitchWeapon", _player, _player, 99];
_unit action ["SwitchWeapon", _unit, _unit, 99];

View File

@ -0,0 +1,50 @@
/*
* Author: CAA-Picard, commy2
*
* Cycle through all grenades.
*
* Argument:
* None
*
* Return value:
* None
*/
#include "script_component.hpp"
private ["_unit", "_nextMuzzle"];
_unit = _this select 0;
_nextMuzzle = ["All"] call FUNC(findNextGrenadeMuzzle);
if (_nextMuzzle != "") then {
private ["_magazines", "_magazine", "_count", "_return"];
_magazines = GVAR(AllMagazines) select (GVAR(AllMuzzles) find _nextMuzzle);
reverse _magazines;
_magazine = "";
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit;
// There is a muzzle with magazines --> cycle to it
[_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle);
[_magazine, _count] call FUNC(displayGrenadeTypeAndNumber);
} else {
// There is a no muzzle with magazines --> select nothing
GVAR(CurrentGrenadeMuzzleFrag) = ""; GVAR(CurrentGrenadeMuzzleOther) = "";
_text = [localize "STR_ACE_WeaponSelect_NoGrenadesLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
[composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
};
if (_nextMuzzle in GVAR(FragMuzzles)) then {
GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle;
GVAR(CurrentGrenadeMuzzleIsFrag) = true;
} else {
GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle;
GVAR(CurrentGrenadeMuzzleIsFrag) = false;
};

View File

@ -0,0 +1,44 @@
/*
* Author: CAA-Picard, commy2
*
* Cycle through frags.
*
* Argument:
* None
*
* Return value:
* None
*/
#include "script_component.hpp"
private ["_unit", "_nextMuzzle"];
_unit = _this select 0;
_nextMuzzle = ["Frag"] call FUNC(findNextGrenadeMuzzle);
if (_nextMuzzle != "") then {
GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle;
private ["_magazines", "_magazine", "_count", "_return"];
_magazines = GVAR(FragMagazines) select (GVAR(FragMuzzles) find _nextMuzzle);
reverse _magazines;
_magazine = "";
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit;
// There is a muzzle with magazines --> cycle to it
[_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle);
[_magazine, _count] call FUNC(displayGrenadeTypeAndNumber);
} else {
// There is a no muzzle with magazines --> select nothing
GVAR(CurrentGrenadeMuzzleFrag) = "";
_text = [localize "STR_ACE_WeaponSelect_NoFragsLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
[composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
};
GVAR(CurrentGrenadeMuzzleIsFrag) = true;

View File

@ -0,0 +1,44 @@
/*
* Author: CAA-Picard, commy2
*
* Cycle through non explosive grenades.
*
* Argument:
* None
*
* Return value:
* None
*/
#include "script_component.hpp"
private ["_unit", "_nextMuzzle"];
_unit = _this select 0;
_nextMuzzle = ["NonFrag"] call FUNC(findNextGrenadeMuzzle);
if (_nextMuzzle != "") then {
GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle;
private ["_magazines", "_magazine", "_count", "_return"];
_magazines = GVAR(NonFragMagazines) select (GVAR(NonFragMuzzles) find _nextMuzzle);
reverse _magazines;
_magazine = "";
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit;
// There is a muzzle with magazines --> cycle to it
[_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle);
[_magazine, _count] call FUNC(displayGrenadeTypeAndNumber);
} else {
// There is a no muzzle with magazines --> select nothing
GVAR(CurrentGrenadeMuzzleOther) = "";
_text = [localize "STR_ACE_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
[composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
};
GVAR(CurrentGrenadeMuzzleIsFrag) = false;

View File

@ -0,0 +1,53 @@
/*
* Author: commy2
*
* The player will select the specified weapon or will change to the next firing mode if the weapon was already selected.
*
* Argument:
* 0: A weapon (String)
*
* Return value:
* None.
*/
#include "script_component.hpp"
private ["_unit", "_weapon"];
_unit = _this select 0;
_weapon = _this select 1;
if (_weapon == "") exitWith {};
if (currentWeapon _unit != _weapon) exitWith {
_unit selectWeapon _weapon;
};
// unlock safety
if (_weapon in (_unit getVariable [QEGVAR(safemode,safedWeapons), []])) exitWith {
[_unit, _weapon, _weapon] call EFUNC(safemode,unlockSafety);
};
private ["_muzzles", "_modes"];
_muzzles = [_weapon] call FUNC(getWeaponMuzzles);
_modes = [_weapon] call FUNC(getWeaponModes);
private ["_index", "_muzzle", "_mode"];
_index = (_modes find currentWeaponMode _unit) + 1;
if (_index > count _modes - 1) then {_index = 0};
_muzzle = _muzzles select 0;
_mode = _modes select _index;
_index = 0;
while {
_index < 100 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}}
} do {
_unit action ["SwitchWeapon", _unit, _unit, _index];
_index = _index + 1;
};
// play fire mode selector sound
[_unit, _weapon] call FUNC(playChangeFiremodeSound);

View File

@ -0,0 +1,50 @@
/*
* Author: commy2
*
* The player will select the specified weapon and change to the first additional muzzle. E.g. the grenade launcher of a assault rifle.
*
* Argument:
* 0: A weapon (String)
*
* Return value:
* None.
*/
#include "script_component.hpp"
private ["_unit", "_weapon"];
_unit = _this select 0;
_weapon = _this select 1;
if (_weapon == "") exitWith {};
private "_muzzles";
_muzzles = [_weapon] call FUNC(getWeaponMuzzles);
if (currentWeapon _unit != _weapon) exitWith {
if (count _muzzles > 1) then {
// unlock safety
/*if (_weapon in (_unit getVariable [QEGVAR(safemode,safedWeapons), []])) exitWith {
[_unit, _weapon, _muzzles select 1] call EFUNC(safemode,unlockSafety);
};*/
_unit selectWeapon (_muzzles select 1);
};
};
private ["_index", "_muzzle"];
_index = (_muzzles find currentMuzzle _unit) + 1;
if (_index > count _muzzles - 1) then {_index = 1};
_muzzle = _muzzles select _index;
_index = 0;
while {
_index < 100 && {currentMuzzle _unit != _muzzle}
} do {
_unit action ["SwitchWeapon", _unit, _unit, _index];
_index = _index + 1;
};

View File

@ -0,0 +1,45 @@
// by commy2
#include "script_component.hpp"
private ["_unit", "_vehicle", "_index"];
_unit = _this select 0;
_vehicle = _this select 1;
_index = _this select 2;
private "_turret";
_turret = [_unit] call EFUNC(common,getTurretIndex);
if (_turret isEqualTo [] && {_unit == driver _vehicle}) then {
private ["_weapons", "_weapon"];
_weapons = weapons _vehicle;
if (_index > count _weapons - 1) exitWith {};
_weapon = _weapons select _index;
_index = 0;
while {
_index < 100 && {currentWeapon _vehicle != _weapon}
} do {
_unit action ["SwitchWeapon", _vehicle, _unit, _index];
_index = _index + 1;
};
} else {
private ["_weapons", "_weapon"];
_weapons = _vehicle weaponsTurret _turret;
if (_index > count _weapons - 1) exitWith {};
_weapon = _weapons select _index;
_index = 0;
while {
_index < 100 && {_vehicle currentWeaponTurret _turret != _weapon}
} do {
_unit action ["SwitchWeapon", _vehicle, _unit, _index];
_index = _index + 1;
};
};

View File

@ -0,0 +1,121 @@
/*
* Author: CAA-Picard
*
* Select the next grenade muzzle to throw.
*
* Argument:
* muzzle name
*
* Return value:
* None
*
*/
#include "script_component.hpp"
private ["_unit", "_muzzle"];
_unit = _this select 0;
_muzzle = _this select 1;
private ["_uniformMags", "_vestMags", "_backPackMags"];
_uniformMags = getMagazineCargo uniformContainer _unit;
_vestMags = getMagazineCargo vestContainer _unit;
_backPackMags = getMagazineCargo backpackContainer _unit;
private ["_uniformMagsToRemove", "_vestMagsToRemove", "_backPackMagsToRemove"];
_uniformMagsToRemove = [];
_vestMagsToRemove = [];
_backPackMagsToRemove = [];
private ["_firstMagazine", "_throwMuzzleNames"];
_firstMagazine = "";
_throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles");
// Collect which magazines to remove
{
private "_muzzleMagazines";
_muzzleMagazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines" );
if (_x != _muzzle) then {
{
private "_index";
_index = (_uniformMags select 0) find _x;
if (_index > -1) then {
_uniformMagsToRemove = _uniformMagsToRemove + [[_x, (_uniformMags select 1) select _index]];
};
_index = (_vestMags select 0) find _x;
if (_index > -1) then {
_vestMagsToRemove = _vestMagsToRemove + [[_x, (_vestMags select 1) select _index]];
};
_index = (_backpackMags select 0) find _x;
if (_index > -1) then {
_backpackMagsToRemove = _backpackMagsToRemove + [[_x, (_backpackMags select 1) select _index]];
};
} forEach _muzzleMagazines;
} else {
{
private "_index";
_index = (_uniformMags select 0) find _x;
if (_index > -1) then {
_firstMagazine = _x;
};
_index = (_vestMags select 0) find _x;
if (_index > -1) then {
_firstMagazine = _x;
};
_index = (_backpackMags select 0) find _x;
if (_index > -1) then {
_firstMagazine = _x;
};
} forEach _muzzleMagazines;
};
} forEach _throwMuzzleNames;
// Remove all magazines except those we are switching to --> this breaks the selector
{
for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do {
_unit removeItem (_x select 0);
};
} forEach _uniformMagsToRemove;
{
for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do {
_unit removeItem (_x select 0);
};
} forEach _vestMagsToRemove;
{
for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do {
_unit removeItem (_x select 0);
};
} forEach _backPackMagsToRemove;
// Readd magazines
{
for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do {
_unit addItemToUniform (_x select 0);
};
} forEach _uniformMagsToRemove;
{
for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do {
_unit addItemToVest (_x select 0);
};
} forEach _vestMagsToRemove;
{
for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do {
_unit addItemToBackpack (_x select 0);
};
} forEach _backPackMagsToRemove;

View File

@ -0,0 +1,19 @@
// by commy2
#include "script_component.hpp"
private ["_unit", "_weapon", "_magazine"];
_unit = _this select 0;
_weapon = _this select 1;
_magazine = _this select 5;
if (_weapon != "Throw") exitWith {};
private "_count";
_count = {_x == _magazine} count magazines _unit;
[_magazine, _count] call FUNC(displayGrenadeTypeAndNumber);
if (_count == 0) then {
if (GVAR(CurrentGrenadeMuzzleIsFrag)) then {GVAR(CurrentGrenadeMuzzleFrag) = ""} else {GVAR(CurrentGrenadeMuzzleOther) = ""};
};

View File

@ -0,0 +1 @@
#include "\z\ace\addons\weaponselect\script_component.hpp"

View File

@ -0,0 +1,12 @@
#define COMPONENT weaponselect
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_WEAPONSELECT
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_ENABLED_WEAPONSELECT
#define DEBUG_SETTINGS DEBUG_ENABLED_WEAPONSELECT
#endif
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-20 -->
<Project name="AGM">
<Project name="ACE">
<Package name="WeaponSelect">
<Key ID="STR_AGM_WeaponSelect_SelectPistol">
<Key ID="STR_ACE_WeaponSelect_SelectPistol">
<English>Select Pistol</English>
<German>Pistole auswählen</German>
<Spanish>Seleccionar pistola</Spanish>
@ -14,7 +14,7 @@
<Portuguese>Selecionar Pistola</Portuguese>
<Italian>Seleziona la Pistola</Italian>
</Key>
<Key ID="STR_AGM_WeaponSelect_SelectRifle">
<Key ID="STR_ACE_WeaponSelect_SelectRifle">
<English>Select Rifle</English>
<German>Gewehr auswählen</German>
<Spanish>Seleccionar fusil</Spanish>
@ -26,7 +26,7 @@
<Portuguese>Selecionar Rifle</Portuguese>
<Italian>Seleziona il Fucile</Italian>
</Key>
<Key ID="STR_AGM_WeaponSelect_SelectLauncher">
<Key ID="STR_ACE_WeaponSelect_SelectLauncher">
<English>Select Launcher</English>
<German>Raketenwerfer auswählen</German>
<Spanish>Seleccionar lanzador</Spanish>
@ -38,7 +38,7 @@
<Portuguese>Selecionar Lançador</Portuguese>
<Italian>Seleziona il Lanciatore</Italian>
</Key>
<Key ID="STR_AGM_WeaponSelect_SelectRifleMuzzle">
<Key ID="STR_ACE_WeaponSelect_SelectRifleMuzzle">
<English>Select Grenade Launcher</English>
<German>Granatwerfer auswählen</German>
<Spanish>Seleccionar lanzador de granadas</Spanish>
@ -50,7 +50,7 @@
<Portuguese>Selecionar Lança-Granadas</Portuguese>
<Italian>Seleziona il Lanciagranate</Italian>
</Key>
<Key ID="STR_AGM_WeaponSelect_SelectBinocular">
<Key ID="STR_ACE_WeaponSelect_SelectBinocular">
<English>Select Binoculars</English>
<German>Fernglas auswählen</German>
<Spanish>Seleccionar prismáticos</Spanish>
@ -62,7 +62,7 @@
<Portuguese>Selecionar Binóculos</Portuguese>
<Italian>Seleziona il Binocolo</Italian>
</Key>
<Key ID="STR_AGM_WeaponSelect_HolsterWeapon">
<Key ID="STR_ACE_WeaponSelect_HolsterWeapon">
<English>Holster Weapon</English>
<German>Waffe holstern</German>
<Spanish>Enfundar el arma</Spanish>
@ -74,7 +74,7 @@
<Portuguese>Guardar Arma</Portuguese>
<Italian>Nascondi l'arma</Italian>
</Key>
<Key ID="STR_AGM_WeaponSelect_EngineOn">
<Key ID="STR_ACE_WeaponSelect_EngineOn">
<English>Engine on</English>
<German>Motor an</German>
<Spanish>Encender motor</Spanish>
@ -86,7 +86,7 @@
<Italian>Motore acceso</Italian>
<Russian>Включить двигатель</Russian>
</Key>
<Key ID="STR_AGM_WeaponSelect_EngineOff">
<Key ID="STR_ACE_WeaponSelect_EngineOff">
<English>Engine off</English>
<German>Motor aus</German>
<Spanish>Apagar motor</Spanish>
@ -98,7 +98,7 @@
<Italian>Motore spento</Italian>
<Russian>Выключить двигатель</Russian>
</Key>
<Key ID="STR_AGM_WeaponSelect_SelectMainGun">
<Key ID="STR_ACE_WeaponSelect_SelectMainGun">
<English>Select Main Gun</English>
<German>Hauptgeschütz auswählen</German>
<Spanish>Seleccionar arma principal</Spanish>
@ -110,7 +110,7 @@
<Italian>Seleziona Arma Primaria</Italian>
<Russian>Выбрать основное оружие</Russian>
</Key>
<Key ID="STR_AGM_WeaponSelect_SelectMachineGun">
<Key ID="STR_ACE_WeaponSelect_SelectMachineGun">
<English>Select Machine Gun</English>
<German>Maschinengewehr auswählen</German>
<Spanish>Seleccionar ametralladora</Spanish>
@ -122,7 +122,7 @@
<Italian>Seleziona Mitragliatrice</Italian>
<Russian>Выбрать пулемёт</Russian>
</Key>
<Key ID="STR_AGM_WeaponSelect_SelectMissiles">
<Key ID="STR_ACE_WeaponSelect_SelectMissiles">
<English>Select Missiles</English>
<German>Raketen auswählen</German>
<Spanish>Seleccionar misiles</Spanish>
@ -134,7 +134,7 @@
<Italian>Seleziona Missili</Italian>
<Russian>Выбрать ракеты</Russian>
</Key>
<Key ID="STR_AGM_WeaponSelect_LoadGrenade">
<Key ID="STR_ACE_WeaponSelect_LoadGrenade">
<English>Grenade %1</English>
<German>Granate %1</German>
<Spanish>Granada %1</Spanish>
@ -143,7 +143,7 @@
<Hungarian>Gránát Kiválasztása</Hungarian>
<Russian>Граната %1</Russian>
</Key>
<Key ID="STR_AGM_WeaponSelect_ReadyGrenade">
<Key ID="STR_ACE_WeaponSelect_ReadyGrenade">
<English>Ready Grenade</English>
<German>Granate nehmen</German>
<Spanish>Granada lista</Spanish>
@ -152,7 +152,7 @@
<Hungarian>Kész Gránát</Hungarian>
<Russian>Подготовить гранату</Russian>
</Key>
<Key ID="STR_AGM_WeaponSelect_SelectGrenadeFrag">
<Key ID="STR_ACE_WeaponSelect_SelectGrenadeFrag">
<English>Select Frag Grenade</English>
<German>Explosive Granate auswählen</German>
<Spanish>Seleccionar granada de fragmenación</Spanish>
@ -164,7 +164,7 @@
<Italian>Seleziona Granata a Frammentazione</Italian>
<Russian>Выбрать осколочную гранату</Russian>
</Key>
<Key ID="STR_AGM_WeaponSelect_SelectGrenadeOther">
<Key ID="STR_ACE_WeaponSelect_SelectGrenadeOther">
<English>Select Non-Frag Grenade</English>
<German>Nichtexplosive Granate auswählen</German>
<Spanish>Seleccionar granada de no fragmentación</Spanish>
@ -176,7 +176,7 @@
<Italian>Seleziona Altre Granate</Italian>
<Russian>Выбрать гранату</Russian>
</Key>
<Key ID="STR_AGM_WeaponSelect_ThrowGrenade">
<Key ID="STR_ACE_WeaponSelect_ThrowGrenade">
<English>Throw Selected Grenade</English>
<German>Gewählte Granate werfen</German>
<Spanish>Arrojar granada seleccionada</Spanish>
@ -188,7 +188,7 @@
<Italian>Lancia la Granata Selezionata</Italian>
<Russian>Бросить выбранную гранату</Russian>
</Key>
<Key ID="STR_AGM_WeaponSelect_NoGrenadesLeft">
<Key ID="STR_ACE_WeaponSelect_NoGrenadesLeft">
<English>No grenades left</English>
<German>Keine Granaten übrig</German>
<Spanish>No quedan granadas</Spanish>
@ -198,7 +198,7 @@
<Hungarian>Nincs több gránát</Hungarian>
<Russian>Гранат не осталось</Russian>
</Key>
<Key ID="STR_AGM_WeaponSelect_NoFragsLeft">
<Key ID="STR_ACE_WeaponSelect_NoFragsLeft">
<English>No frags left</English>
<German>Keine explosiven Granaten übrig</German>
<Spanish>Sin granadas de fragmentación</Spanish>
@ -210,7 +210,7 @@
<Italian>Nessuna granata a frammentazione rimanente</Italian>
<Russian>Осколочныких гранат нет</Russian>
</Key>
<Key ID="STR_AGM_WeaponSelect_NoMiscGrenadeLeft">
<Key ID="STR_ACE_WeaponSelect_NoMiscGrenadeLeft">
<English>No misc. grenades left</English>
<German>Keine nichtexplosiven Granaten übrig</German>
<Spanish>Sin granadas de varias</Spanish>
@ -222,7 +222,7 @@
<Italian>Nessun'altra granata rimanente.</Italian>
<Russian>Невзрывоопасные гранаты закончились</Russian>
</Key>
<Key ID="STR_AGM_WeaponSelect_NoGrenadeSelected">
<Key ID="STR_ACE_WeaponSelect_NoGrenadeSelected">
<English>No grenade selected</English>
<German>Keine Granate ausgewählt</German>
<Spanish>Granada no seleccionada</Spanish>
@ -234,7 +234,7 @@
<Italian>Nessuna granata selezionata</Italian>
<Russian>Нет выбранной гранаты</Russian>
</Key>
<Key ID="STR_AGM_WeaponSelect_FireSmokeLauncher">
<Key ID="STR_ACE_WeaponSelect_FireSmokeLauncher">
<English>Fire Smoke Launcher</English>
<German>Rauchwand abfeuern</German>
<Spanish>Disparar lanzador de humo</Spanish>