diff --git a/addons/sys_rack/CfgVehicles.hpp b/addons/sys_rack/CfgVehicles.hpp index 8ea5c2004..dd83ed1c1 100644 --- a/addons/sys_rack/CfgVehicles.hpp +++ b/addons/sys_rack/CfgVehicles.hpp @@ -94,7 +94,7 @@ class CfgVehicles { displayName = CSTRING(dashUpper); // Name is displayed in the interaction menu. shortName = CSTRING(dashUpperShort); componentName = "ACRE_VRC110"; - allowedPositions[] = {"driver", {"cargo", 0}}; // Who has access "inside" - anyone inside, "external" - provides access upto 10m away, "driver", "gunner", "copilot", "commander" + allowedPositions[] = {"driver", {"cargo", 0}, "commander"}; // Who has access "inside" - anyone inside, "external" - provides access upto 10m away, "driver", "gunner", "copilot", "commander" isRadioRemovable = 1; intercom[] = {"intercom_1"}; }; @@ -102,7 +102,7 @@ class CfgVehicles { displayName = CSTRING(dashLower); // If you have multiple racks a text label helps identify the particular rack. shortName = CSTRING(dashLowerShort); componentName = "ACRE_VRC103"; - allowedPositions[] = {"driver", {"cargo", 0}}; + allowedPositions[] = {"driver", {"cargo", 0}, "commander"}; mountedRadio = "ACRE_PRC117F"; intercom[] = {"intercom_1"}; }; diff --git a/addons/sys_rack/XEH_PREP.hpp b/addons/sys_rack/XEH_PREP.hpp index a173436bd..1c770e402 100644 --- a/addons/sys_rack/XEH_PREP.hpp +++ b/addons/sys_rack/XEH_PREP.hpp @@ -29,6 +29,7 @@ PREP(configureRackIntercom); PREP(initializeRack); PREP(getRackBaseClassname); PREP(getRackFromRadio); +PREP(getRackLetterFromRadio); PREP(getMountableRadios); PREP(getMountedRadio); PREP(getWiredIntercoms); diff --git a/addons/sys_rack/fnc_getRackLetterFromRadio.sqf b/addons/sys_rack/fnc_getRackLetterFromRadio.sqf new file mode 100644 index 000000000..c78f6bc1a --- /dev/null +++ b/addons/sys_rack/fnc_getRackLetterFromRadio.sqf @@ -0,0 +1,30 @@ +#include "script_component.hpp" +/* + * Author: ACRE2Team, mrschick + * Returns the rack letter if a radio is currently mounted. + * + * Arguments: + * 0: Radio ID + * + * Return Value: + * Letter on Work knob corresponding to the rack, or "" if radio is not in a rack + * + * Example: + * ["ACRE_PRC152_ID_1"] call acre_sys_rack_fnc_getRackLetterFromRadio + * + * Public: No + */ + +params ["_radioId"]; + +private _return = ""; + +private _wiredRacks = [vehicle acre_player, acre_player, EGVAR(sys_intercom,activeIntercom), "wiredRacks"] call EFUNC(sys_intercom,getStationConfiguration); +{ + private _rackId = _x select 0; + if (([_rackId] call FUNC(getMountedRadio)) == _radioId) exitWith { + _return = [RACK_LETTERS] select _forEachIndex; + }; +} forEach _wiredRacks; + +_return diff --git a/addons/sys_rack/fnc_rackChildrenActions.sqf b/addons/sys_rack/fnc_rackChildrenActions.sqf index c475e3cd3..8454a7777 100644 --- a/addons/sys_rack/fnc_rackChildrenActions.sqf +++ b/addons/sys_rack/fnc_rackChildrenActions.sqf @@ -106,20 +106,31 @@ if (_mountedRadio == "") then { // Empty ] call ace_interact_menu_fnc_createAction; _actions pushBack [_action, [], _target]; }; - }; - - // Start using (only if not yet accessible and not connected to intercom) - if (!(_mountedRadio in ACRE_ACCESSIBLE_RACK_RADIOS) && {!([_mountedRadio, acre_player] call FUNC(isRadioHearable))}) then { - private _action = [ - QGVAR(useMountedRadio), - localize LSTRING(useRadio), - "", - {_this call FUNC(startUsingMountedRadio)}, - {true}, - {}, - _mountedRadio - ] call ace_interact_menu_fnc_createAction; - _actions pushBack [_action, [], _target]; + } else { + // Start using (only if not yet accessible and not connected to intercom) + if (!([_mountedRadio, acre_player] call FUNC(isRadioHearable))) then { + private _action = [ + QGVAR(useMountedRadio), + localize LSTRING(useRadio), + "", + {_this call FUNC(startUsingMountedRadio)}, + {true}, + {}, + _mountedRadio + ] call ace_interact_menu_fnc_createAction; + _actions pushBack [_action, [], _target]; + } else { + // Open FFCS (only if not accessible but wired to intercom) + // mimics standalone radio interaction to radios wired to intercom for easier UX + private _action = [ + QGVAR(useMountedRadio), + format [localize LSTRING(useIntercomRadio), ([_mountedRadio] call FUNC(getRackLetterFromRadio))], + "", + {[] call EFUNC(sys_intercom,openGui)}, + {true} + ] call ace_interact_menu_fnc_createAction; + _actions pushBack [_action, [], _target]; + }; }; }; diff --git a/addons/sys_rack/script_component.hpp b/addons/sys_rack/script_component.hpp index 3cbdc18f4..b5cde696d 100644 --- a/addons/sys_rack/script_component.hpp +++ b/addons/sys_rack/script_component.hpp @@ -21,6 +21,8 @@ #define MAX_EXTERNAL_RACK_DISTANCE 10 +#define RACK_LETTERS "A", "B", "C", "D", "E", "F" + #include "script_acre_rack_defines.hpp" #include "\idi\acre\addons\sys_components\script_acre_component_defines.hpp" diff --git a/addons/sys_rack/stringtable.xml b/addons/sys_rack/stringtable.xml index 5b66699b7..5fae69ee5 100644 --- a/addons/sys_rack/stringtable.xml +++ b/addons/sys_rack/stringtable.xml @@ -89,6 +89,11 @@ Использовать Kullan + + Use via Intercom (Work: %1) + Durch Intercom verwenden (Work: %1) + Usa tramite l'intercom (Work: %1) + Unable to unmount radio as you have no inventory space. Funkgerät kann nicht deinstalliert werden. Nicht genug Platz im Inventar.