2023-09-17 07:32:39 +00:00
|
|
|
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
|
|
* Author: BaerMitUmlaut
|
|
|
|
* Initializes the item context menu for the DBAL.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2024-08-11 15:08:50 +00:00
|
|
|
* call ace_irlight_fnc_initItemContextMenu
|
2023-09-17 07:32:39 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
{
|
|
|
|
_x params ["_variant", "_displayName"];
|
|
|
|
|
|
|
|
[
|
2024-08-11 15:08:50 +00:00
|
|
|
"ACE_DBAL_A3_Red",
|
|
|
|
"POINTER",
|
|
|
|
_displayName,
|
|
|
|
[],
|
|
|
|
"",
|
|
|
|
{
|
2023-09-17 07:32:39 +00:00
|
|
|
params ["", "", "_item", "", "_variant"];
|
|
|
|
|
|
|
|
private _baseClass = getText (configFile >> "CfgWeapons" >> _item >> "baseWeapon");
|
|
|
|
_item != _baseClass + _variant
|
|
|
|
}, {
|
2024-08-11 15:08:50 +00:00
|
|
|
params ["_unit", "", "_item", "_slot", "_variant"];
|
2023-09-17 07:32:39 +00:00
|
|
|
|
2024-08-11 15:08:50 +00:00
|
|
|
private _weapon = switch (_slot) do {
|
|
|
|
case "RIFLE_POINTER": {primaryWeapon _unit};
|
|
|
|
case "LAUNCHER_POINTER": {secondaryWeapon _unit};
|
|
|
|
case "PISTOL_POINTER": {handgunWeapon _unit};
|
|
|
|
default {""};
|
|
|
|
};
|
2023-09-17 07:32:39 +00:00
|
|
|
|
2024-08-11 15:08:50 +00:00
|
|
|
if (_weapon == "") exitWith {};
|
2023-09-17 07:32:39 +00:00
|
|
|
|
2024-08-11 15:08:50 +00:00
|
|
|
private _baseClass = getText (configFile >> "CfgWeapons" >> _item >> "baseWeapon");
|
2023-09-17 07:32:39 +00:00
|
|
|
|
2024-08-11 15:08:50 +00:00
|
|
|
[_unit, _weapon, _item, _baseClass + _variant] call EFUNC(common,switchAttachmentMode);
|
|
|
|
},
|
|
|
|
false,
|
|
|
|
_variant
|
2023-09-17 07:32:39 +00:00
|
|
|
] call CBA_fnc_addItemContextMenuOption;
|
|
|
|
} forEach [
|
|
|
|
["", LSTRING(Mode_IRDual)],
|
|
|
|
["_IP", LSTRING(Mode_IRPointer)],
|
|
|
|
["_II", LSTRING(Mode_IRIlluminator)],
|
|
|
|
["_VP", LSTRING(Mode_VisiblePointer)]
|
|
|
|
];
|