diff --git a/addons/ace_interact/fnc_radioChildrenActions.sqf b/addons/ace_interact/fnc_radioChildrenActions.sqf index 10239ac97..f6af86abc 100644 --- a/addons/ace_interact/fnc_radioChildrenActions.sqf +++ b/addons/ace_interact/fnc_radioChildrenActions.sqf @@ -43,6 +43,17 @@ if (!(_radio in ACRE_EXTERNALLY_USED_PERSONAL_RADIOS)) then { _action = [QGVAR(makeActive), localize LSTRING(setAsActive), "", {[(_this select 2) select 0] call EFUNC(api,setCurrentRadio)}, {!((_this select 2) select 1)}, {}, [_radio, _active]] call ace_interact_menu_fnc_createAction; _actions pushBack [_action, [], _target]; + // Loudspeakers + if (_radio in ACRE_ACCESSIBLE_RACK_RADIOS) then { + if ([_radio, "isExternalAudio"] call EFUNC(sys_data,dataEvent)) then { + _action = ["acre_loudspeaker", localize ELSTRING(sys_rack,turnOffSpeaker), "", {[((_this select 2) select 0), false] call EFUNC(sys_rack,activateRackSpeaker)}, {true}, {}, _params] call ace_interact_menu_fnc_createAction; + } else { + _action = ["acre_loudspeaker", localize ELSTRING(sys_rack,turnOnSpeaker), "", {[((_this select 2) select 0), true] call EFUNC(sys_rack,activateRackSpeaker)}, {true}, {}, _params] call ace_interact_menu_fnc_createAction; + }; + + _actions pushBack [_action, [], _target]; + }; + // External radios. Show only options to share/stop sharing the radio if you are the actual owner and not an external user. if (!(_radio in ACRE_ACTIVE_EXTERNAL_RADIOS || _radio in ACRE_HEARABLE_RACK_RADIOS)) then { _action = [QGVAR(shareRadio), localize ELSTRING(sys_external,shareRadio), "", {[(_this select 2) select 0, true] call EFUNC(sys_external,allowExternalUse)}, {!([(_this select 2) select 0] call EFUNC(sys_external,isRadioShared))}, {}, _params] call ace_interact_menu_fnc_createAction; diff --git a/addons/api/fnc_addRackToVehicle.sqf b/addons/api/fnc_addRackToVehicle.sqf index ccf2dee18..58dc93da4 100644 --- a/addons/api/fnc_addRackToVehicle.sqf +++ b/addons/api/fnc_addRackToVehicle.sqf @@ -17,6 +17,7 @@ * 4: Base classname of the mounted radio (Without ID). Empty string for no radio (default: "") * 7: Components (default: []) * 8: Connected intercoms (default: []) + * 9: Speaker position (default: [0,0,0]) * 2: Force initialisation (default: false) * 3: Condition called with argument "_unit". If a longer function is given, it should be precompiled. (default: {}) * @@ -24,7 +25,7 @@ * Rack added successfully * * Example: - * [cursorTarget, ["ACRE_VRC103", "Upper Dash", "Dash", false, ["external"], [], "ACRE_PRC117F", [], ["intercom_1"]], false] call acre_api_fnc_addRackToVehicle + * [cursorTarget, ["ACRE_VRC103", "Upper Dash", "Dash", false, ["external"], [], "ACRE_PRC117F", [], ["intercom_1"], [-1.0, 2.0, 0.0]]] call acre_api_fnc_addRackToVehicle * * Public: Yes */ @@ -67,7 +68,7 @@ if (count _rackConfiguration != 9) exitWith { false }; -_rackConfiguration params [["_rackClassname", ""], ["_rackName", ""], ["_rackShortName", ""], ["_isRadioRemovable", false], ["_allowed", ["inside"]], ["_disabled", []], ["_mountedRadio", ""], ["_defaultComponents", []], ["_intercoms", []]]; +_rackConfiguration params [["_rackClassname", ""], ["_rackName", ""], ["_rackShortName", ""], ["_isRadioRemovable", false], ["_allowed", ["inside"]], ["_disabled", []], ["_mountedRadio", ""], ["_defaultComponents", []], ["_intercoms", []], ["_speakerPosition", [0, 0, 0]]]; if (_rackClassname isEqualTo "") exitWith { WARNING_1("No rack specified for vehicle %1",_vehicle); @@ -134,7 +135,7 @@ private _selectPlayer = { _vehicle setVariable [QEGVAR(sys_rack,initPlayer), _player, true]; }; - [QEGVAR(sys_rack,addVehicleRacks), [_vehicle, _rackClassname, _rackName, _rackShortName, _isRadioRemovable, _allowed, _disabled, _mountedRadio, _defaultComponents, _intercoms], _player] call CBA_fnc_targetEvent; + [QEGVAR(sys_rack,addVehicleRacks), [_vehicle, _rackClassname, _rackName, _rackShortName, _isRadioRemovable, _allowed, _disabled, _mountedRadio, _defaultComponents, _intercoms, _speakerPosition], _player] call CBA_fnc_targetEvent; }, [_selectPlayer, _condition, _vehicle, _rackClassname, _rackName, _rackShortName, _isRadioRemovable, _allowed, _disabled, _mountedRadio, _defaultComponents, _intercoms]] call CBA_fnc_waitUntilAndExecute; true diff --git a/addons/sys_prc117f/fnc_initializeRadio.sqf b/addons/sys_prc117f/fnc_initializeRadio.sqf index b92443033..837be08da 100644 --- a/addons/sys_prc117f/fnc_initializeRadio.sqf +++ b/addons/sys_prc117f/fnc_initializeRadio.sqf @@ -40,5 +40,6 @@ HASH_SET(_radioData,"volume",1); HASH_SET(_radioData,"currentChannel",0); HASH_SET(_radioData,"radioOn", 1); HASH_SET(_radioData,"pressedButton", -1); -HASH_SET(_radioData,"powerSource", "BAT"); +HASH_SET(_radioData,"powerSource","BAT"); HASH_SET(_radioData,"pgm_pa_mode", "ON"); +HASH_SET(_radioData,"audioPath","HEADSET"); diff --git a/addons/sys_prc117f/radio/fnc_getExternalAudioPosition.sqf b/addons/sys_prc117f/radio/fnc_getExternalAudioPosition.sqf index 18a5a09f6..460458b7b 100644 --- a/addons/sys_prc117f/radio/fnc_getExternalAudioPosition.sqf +++ b/addons/sys_prc117f/radio/fnc_getExternalAudioPosition.sqf @@ -16,4 +16,20 @@ * Public: No */ -[0,0,0] +params ["_radioId", "_event", "_eventData", "_radioData"]; + +private _obj = [_radioId] call EFUNC(sys_radio,getRadioObject); +private _pos = getPosASL _obj; + +private _rackId = [_radioId] call EFUNC(sys_rack,getRackFromRadio); +if (_rackId isEqualTo "") then { + _pos = [0,0,0]; +} else { + private _vehicle = [_radioId] call EFUNC(sys_rack,getVehicleFromRack); + private _position = [_rackId, _vehicle] call EFUNC(sys_rack,getRackPosition); + if !(_position isEqualTo [0, 0, 0]) then { + _pos = ATLtoASL (_vehicle modelToWorld _position); + }; +}; + +_pos diff --git a/addons/sys_prc117f/radio/fnc_isExternalAudio.sqf b/addons/sys_prc117f/radio/fnc_isExternalAudio.sqf index be6a96eaf..cd2072b8b 100644 --- a/addons/sys_prc117f/radio/fnc_isExternalAudio.sqf +++ b/addons/sys_prc117f/radio/fnc_isExternalAudio.sqf @@ -16,4 +16,6 @@ * Public: No */ -false +params ["_radioId", "_event", "_eventData", "_radioData"]; + +(HASH_GET(_radioData, "audioPath") == "RACKSPEAKER") diff --git a/addons/sys_prc148/radio/fnc_getExternalAudioPosition.sqf b/addons/sys_prc148/radio/fnc_getExternalAudioPosition.sqf index 893fe69be..2316c3cd4 100644 --- a/addons/sys_prc148/radio/fnc_getExternalAudioPosition.sqf +++ b/addons/sys_prc148/radio/fnc_getExternalAudioPosition.sqf @@ -20,8 +20,18 @@ params ["_radioId", "_event", "_eventData", "_radioData"]; private _obj = [_radioId] call EFUNC(sys_radio,getRadioObject); private _pos = getPosASL _obj; -if (_obj isKindOf "Man") then { - _pos = ATLtoASL (_obj modelToWorld (_obj selectionPosition "RightShoulder")); + +private _rackId = [_radioId] call EFUNC(sys_rack,getRackFromRadio); +if (_rackId isEqualTo "") then { + if (_obj isKindOf "Man") then { + _pos = ATLtoASL (_obj modelToWorld (_obj selectionPosition "RightShoulder")); + }; +} else { + private _vehicle = [_radioId] call EFUNC(sys_rack,getVehicleFromRack); + private _position = [_rackId, _vehicle] call EFUNC(sys_rack,getRackPosition); + if !(_position isEqualTo [0, 0, 0]) then { + _pos = ATLtoASL (_vehicle modelToWorld _position); + }; }; _pos; diff --git a/addons/sys_prc148/radio/fnc_isExternalAudio.sqf b/addons/sys_prc148/radio/fnc_isExternalAudio.sqf index 39afd3a15..aeb731d44 100644 --- a/addons/sys_prc148/radio/fnc_isExternalAudio.sqf +++ b/addons/sys_prc148/radio/fnc_isExternalAudio.sqf @@ -18,4 +18,4 @@ params ["_radioId", "_event", "_eventData", "_radioData"]; -(HASH_GET(_radioData, "audioPath") == "INTAUDIO") +(HASH_GET(_radioData, "audioPath") in ["INTAUDIO", "RACKSPEAKER"]) diff --git a/addons/sys_prc152/fnc_initializeRadio.sqf b/addons/sys_prc152/fnc_initializeRadio.sqf index 6d235c4d2..2ebe215ae 100644 --- a/addons/sys_prc152/fnc_initializeRadio.sqf +++ b/addons/sys_prc152/fnc_initializeRadio.sqf @@ -41,5 +41,5 @@ for "_i" from 0 to (count _channels)-1 do { HASH_SET(_radioData,"volume",1); HASH_SET(_radioData,"currentChannel",0); HASH_SET(_radioData,"radioOn",1); -HASH_SET(_radioData,"audioPath", "TOPAUDIO"); +HASH_SET(_radioData,"audioPath","TOPAUDIO"); HASH_SET(_radioData,"powerSource","BAT"); diff --git a/addons/sys_prc152/radio/fnc_getExternalAudioPosition.sqf b/addons/sys_prc152/radio/fnc_getExternalAudioPosition.sqf index 893fe69be..2316c3cd4 100644 --- a/addons/sys_prc152/radio/fnc_getExternalAudioPosition.sqf +++ b/addons/sys_prc152/radio/fnc_getExternalAudioPosition.sqf @@ -20,8 +20,18 @@ params ["_radioId", "_event", "_eventData", "_radioData"]; private _obj = [_radioId] call EFUNC(sys_radio,getRadioObject); private _pos = getPosASL _obj; -if (_obj isKindOf "Man") then { - _pos = ATLtoASL (_obj modelToWorld (_obj selectionPosition "RightShoulder")); + +private _rackId = [_radioId] call EFUNC(sys_rack,getRackFromRadio); +if (_rackId isEqualTo "") then { + if (_obj isKindOf "Man") then { + _pos = ATLtoASL (_obj modelToWorld (_obj selectionPosition "RightShoulder")); + }; +} else { + private _vehicle = [_radioId] call EFUNC(sys_rack,getVehicleFromRack); + private _position = [_rackId, _vehicle] call EFUNC(sys_rack,getRackPosition); + if !(_position isEqualTo [0, 0, 0]) then { + _pos = ATLtoASL (_vehicle modelToWorld _position); + }; }; _pos; diff --git a/addons/sys_prc152/radio/fnc_isExternalAudio.sqf b/addons/sys_prc152/radio/fnc_isExternalAudio.sqf index 39afd3a15..aeb731d44 100644 --- a/addons/sys_prc152/radio/fnc_isExternalAudio.sqf +++ b/addons/sys_prc152/radio/fnc_isExternalAudio.sqf @@ -18,4 +18,4 @@ params ["_radioId", "_event", "_eventData", "_radioData"]; -(HASH_GET(_radioData, "audioPath") == "INTAUDIO") +(HASH_GET(_radioData, "audioPath") in ["INTAUDIO", "RACKSPEAKER"]) diff --git a/addons/sys_prc77/radio/fnc_getExternalAudioPosition.sqf b/addons/sys_prc77/radio/fnc_getExternalAudioPosition.sqf index 48f7b162b..0d79cfaf7 100644 --- a/addons/sys_prc77/radio/fnc_getExternalAudioPosition.sqf +++ b/addons/sys_prc77/radio/fnc_getExternalAudioPosition.sqf @@ -20,4 +20,20 @@ * Public: No */ -[0,0,0]; +params ["_radioId", "_event", "_eventData", "_radioData"]; + +private _obj = [_radioId] call EFUNC(sys_radio,getRadioObject); +private _pos = getPosASL _obj; + +private _rackId = [_radioId] call EFUNC(sys_rack,getRackFromRadio); +if (_rackId isEqualTo "") then { + _pos = [0,0,0]; +} else { + private _vehicle = [_radioId] call EFUNC(sys_rack,getVehicleFromRack); + private _position = [_rackId, _vehicle] call EFUNC(sys_rack,getRackPosition); + if !(_position isEqualTo [0, 0, 0]) then { + _pos = ATLtoASL (_vehicle modelToWorld _position); + }; +}; + +_pos diff --git a/addons/sys_prc77/radio/fnc_initializeRadio.sqf b/addons/sys_prc77/radio/fnc_initializeRadio.sqf index 6e387d406..d59cfe0f7 100644 --- a/addons/sys_prc77/radio/fnc_initializeRadio.sqf +++ b/addons/sys_prc77/radio/fnc_initializeRadio.sqf @@ -71,15 +71,16 @@ HASH_SET(_radioData,"radioOn",1); //0 - OFF, 1 - ON HASH_SET(_radioData,"band",_band); //{0,1} HASH_SET(_radioData,"currentPreset",[ARR_2(_knobPositions,_secondPresetKnobPositions)]); //Array of Presetarrays (KnobPositions) HASH_SET(_radioData,"currentChannel",_knobPositions); -HASH_SET(_radioData,"powerSource", "BAT"); +HASH_SET(_radioData,"powerSource","BAT"); +HASH_SET(_radioData,"audioPath","HEADSET"); //Common Channel Settings HASH_SET(_radioData,"frequencyTX",_frequencyTx); HASH_SET(_radioData,"frequencyRX",_frequencyTx); HASH_SET(_radioData,"power",3500); HASH_SET(_radioData,"mode","singleChannel"); -HASH_SET(_radioData,"CTCSSTx", 150); -HASH_SET(_radioData,"CTCSSRx", 150); +HASH_SET(_radioData,"CTCSSTx",150); +HASH_SET(_radioData,"CTCSSRx",150); HASH_SET(_radioData,"modulation","FM"); HASH_SET(_radioData,"encryption",0); HASH_SET(_radioData,"TEK",""); diff --git a/addons/sys_prc77/radio/fnc_isExternalAudio.sqf b/addons/sys_prc77/radio/fnc_isExternalAudio.sqf index 9ad8daa75..83f2407ce 100644 --- a/addons/sys_prc77/radio/fnc_isExternalAudio.sqf +++ b/addons/sys_prc77/radio/fnc_isExternalAudio.sqf @@ -20,4 +20,6 @@ * Public: No */ -false; +params ["_radioId", "_event", "_eventData", "_radioData"]; + +(HASH_GET(_radioData, "audioPath") == "RACKSPEAKER") diff --git a/addons/sys_rack/XEH_PREP.hpp b/addons/sys_rack/XEH_PREP.hpp index a173436bd..2a6d85eed 100644 --- a/addons/sys_rack/XEH_PREP.hpp +++ b/addons/sys_rack/XEH_PREP.hpp @@ -8,6 +8,7 @@ PREP(rackListChildrenActions); PREP(onReturnRackId); PREP(onReturnRadioId); +PREP(activateRackSpeaker); PREP(addRack); PREP(addRackOnReturn); PREP(initVehicle); diff --git a/addons/sys_rack/XEH_postInit.sqf b/addons/sys_rack/XEH_postInit.sqf index d3e65da89..e15eb1260 100644 --- a/addons/sys_rack/XEH_postInit.sqf +++ b/addons/sys_rack/XEH_postInit.sqf @@ -57,9 +57,9 @@ if (vehicle acre_player != acre_player) then { }] call CBA_fnc_addEventHandler; [QGVAR(addVehicleRacks), { - params ["_vehicle", "_rackClassname", "_displayName", "_rackName", "_rackShortName", "_isRadioRemovable", "_allowed", "_disabled", "_mountedRadio", "_components", "_intercoms"]; + params ["_vehicle", "_rackClassname", "_displayName", "_rackName", "_rackShortName", "_isRadioRemovable", "_allowed", "_disabled", "_mountedRadio", "_components", "_intercoms", "_speakerPosition"]; - [_vehicle, _rackClassname, _displayName, _rackName, _rackShortName, _isRadioRemovable, _allowed, _disabled, _mountedRadio, _components, _intercoms] call FUNC(addRack); + [_vehicle, _rackClassname, _displayName, _rackName, _rackShortName, _isRadioRemovable, _allowed, _disabled, _mountedRadio, _components, _intercoms, _speakerPosition] call FUNC(addRack); // Give some time for the racks to initialise properly [{ diff --git a/addons/sys_rack/fnc_activateRackSpeaker.sqf b/addons/sys_rack/fnc_activateRackSpeaker.sqf new file mode 100644 index 000000000..a1b8b21ed --- /dev/null +++ b/addons/sys_rack/fnc_activateRackSpeaker.sqf @@ -0,0 +1,24 @@ + #include "script_component.hpp" +/* + * Author: ACRE2Team + * Sets the mounted radio external audio to ON/OFF. + * + * Arguments: + * 0: Radio Unique ID + * 1: External audio on/off + * 1: Rack Unique ID + * + * Return Value: + * None + * + * Example: + * ["ACRE_PRC152_ID_1", true] call acre_sys_rack_fnc_activateRackSpeaker + * + * Public: No + */ + +params ["_radioId", "_active", ["_rackId",""]]; + +// TODO: For version 2.7. Implement check if rack has an external speaker + +[_radioId, "setState", ["audioPath", "RACKSPEAKER"]] call EFUNC(sys_data,dataEvent); diff --git a/addons/sys_rack/fnc_addRack.sqf b/addons/sys_rack/fnc_addRack.sqf index 609cb499e..6ea03af6c 100644 --- a/addons/sys_rack/fnc_addRack.sqf +++ b/addons/sys_rack/fnc_addRack.sqf @@ -24,11 +24,11 @@ * Public: No */ -params ["_vehicle", "_rackClassname", "_rackName", "_rackShortName", ["_isRadioRemovable", true], ["_allowed", ["inside"]], ["_disabled", []], ["_mountedRadio",""], ["_defaultComponents", []], ["_intercoms",[]]]; +params ["_vehicle", "_rackClassname", "_rackName", "_rackShortName", ["_isRadioRemovable", true], ["_allowed", ["inside"]], ["_disabled", []], ["_mountedRadio",""], ["_defaultComponents", []], ["_intercoms",[]], ["_rackPosition", [0, 0, 0]]]; private _queue = _vehicle getVariable [QGVAR(queue), []]; -_queue pushBack [_rackClassname, _rackName, _rackShortName, _isRadioRemovable, _allowed, _disabled, _mountedRadio, _defaultComponents, _intercoms]; +_queue pushBack [_rackClassname, _rackName, _rackShortName, _isRadioRemovable, _allowed, _disabled, _mountedRadio, _defaultComponents, _intercoms, _rackPosition]; _vehicle setVariable [QGVAR(queue), _queue]; // Request RACK ID diff --git a/addons/sys_rack/fnc_initVehicle.sqf b/addons/sys_rack/fnc_initVehicle.sqf index 1ca3eb03c..d7b772be6 100644 --- a/addons/sys_rack/fnc_initVehicle.sqf +++ b/addons/sys_rack/fnc_initVehicle.sqf @@ -37,7 +37,17 @@ if (!_initialized) then { WARNING_2("Rack short name %1 is longer than 4 characters for vehicle %2",_shortName,_vehicle); }; - [_vehicle, _componentName, _displayName, _shortName, _isRadioRemovable, _allowed, _disabled, _mountedRadio, _components, _intercoms] call FUNC(addRack); + // Speaker + private _positionConfig = _x >> "rackPosition"; + private _speakerPosition = [0, 0, 0]; // Default to main action point + if (isText _positionConfig) then { + _speakerPosition = _vehicle selectionPosition (getText _positionConfig); // Convert to coordinates for sys_core intercomPFH checks + }; + if (isArray _positionConfig) then { + _speakerPosition = getArray _positionConfig; + }; + + [_vehicle, _componentName, _displayName, _shortName, _isRadioRemovable, _allowed, _disabled, _mountedRadio, _components, _intercoms, _positionConfig] call FUNC(addRack); } forEach (configProperties [_racks, "isClass _x", true]); _vehicle setVariable [QGVAR(initialized), true, true]; diff --git a/addons/sys_rack/fnc_initializeRack.sqf b/addons/sys_rack/fnc_initializeRack.sqf index 93e376e7a..9e31c61ce 100644 --- a/addons/sys_rack/fnc_initializeRack.sqf +++ b/addons/sys_rack/fnc_initializeRack.sqf @@ -13,13 +13,13 @@ * None * * Example: - * ["ACRE_VRC110_ID_1","initializeRack",["ACRE_VRC110_ID_1","Dash",true,["inside"],[["cargo", 1],["ffv", [2]]],false,[],vehicle1],(acre_sys_data_radioData getVariable "ACRE_VRC110_ID_1")] call acre_sys_rack_fnc_initializeRack + * ["ACRE_VRC110_ID_1","initializeRack",["ACRE_VRC110_ID_1","Dash",true,["inside"],[["cargo", 1],["ffv", [2]]],false,[],[0,0,0],vehicle1],(acre_sys_data_radioData getVariable "ACRE_VRC110_ID_1")] call acre_sys_rack_fnc_initializeRack * * Public: No */ params ["_rackId", "", "_eventData", "_rackData"]; -_eventData params ["_componentName", "_displayName", "_shortName", "_isRadioRemovable", "_allowed", "_disabled", "_mountedRadio", "_defaultComponents", "_intercoms", "_vehicle"]; +_eventData params ["_componentName", "_displayName", "_shortName", "_isRadioRemovable", "_allowed", "_disabled", "_mountedRadio", "_defaultComponents", "_intercoms", "_rackPosition", "_vehicle"]; HASH_SET(_rackData,"name",_displayName); @@ -29,6 +29,7 @@ HASH_SET(_rackData,"disabled",_disabled); HASH_SET(_rackData,"mountedRadio",_mountedRadio); HASH_SET(_rackData,"isRadioRemovable",_isRadioRemovable); HASH_SET(_rackData,"wiredIntercoms",_intercoms); +HASH_SET(_rackData,"rackPosition",_rackPosition); HASH_SET(_rackData,"vehicle",_vehicle); //Only run on server as initializeRack is called globally. diff --git a/addons/sys_rack/sem90/fnc_sem90UnmountRadio.sqf b/addons/sys_rack/sem90/fnc_sem90UnmountRadio.sqf index d033dfd56..47510d0c8 100644 --- a/addons/sys_rack/sem90/fnc_sem90UnmountRadio.sqf +++ b/addons/sys_rack/sem90/fnc_sem90UnmountRadio.sqf @@ -24,3 +24,4 @@ private _radioId = _eventData; //Enable VAA Mode. [_radioId, "setState", ["powerSource", "BAT"]] call EFUNC(sys_data,dataEvent); +[_radioId, "setState", ["audioPath", "HEADSET"]] call EFUNC(sys_data,dataEvent); diff --git a/addons/sys_rack/stringtable.xml b/addons/sys_rack/stringtable.xml index d4cb4fbff..be086d64c 100644 --- a/addons/sys_rack/stringtable.xml +++ b/addons/sys_rack/stringtable.xml @@ -183,5 +183,11 @@ Dejar de usar todas ArrĂȘter de tout utiliser + + Turn On Speaker + + + Turn Off Speaker + diff --git a/addons/sys_rack/vrc103/fnc_vrc103UnmountRadio.sqf b/addons/sys_rack/vrc103/fnc_vrc103UnmountRadio.sqf index f091c1447..dc70616c8 100644 --- a/addons/sys_rack/vrc103/fnc_vrc103UnmountRadio.sqf +++ b/addons/sys_rack/vrc103/fnc_vrc103UnmountRadio.sqf @@ -24,3 +24,4 @@ private _radioId = _eventData; //Enable VAA Mode. [_radioId, "setState", ["powerSource", "BAT"]] call EFUNC(sys_data,dataEvent); +[_radioId, "setState", ["audioPath", "HEADSET"]] call EFUNC(sys_data,dataEvent); diff --git a/addons/sys_rack/vrc110/fnc_vrc110UnmountRadio.sqf b/addons/sys_rack/vrc110/fnc_vrc110UnmountRadio.sqf index ccd2e5183..d878c64cb 100644 --- a/addons/sys_rack/vrc110/fnc_vrc110UnmountRadio.sqf +++ b/addons/sys_rack/vrc110/fnc_vrc110UnmountRadio.sqf @@ -24,3 +24,9 @@ private _radioId = _eventData; // Switch back to battery mode. [_radioId, "setState", ["powerSource", "BAT"]] call EFUNC(sys_data,dataEvent); + +private _audioPath = [_radioId, "getState", "audioPath"] call EFUNC(sys_data,dataEvent); + +if (_audioPath == "RACKSPEAKER") then { + [_radioId, "setState", ["audioPath", "TOPAUDIO"]] call EFUNC(sys_data,dataEvent); +}; diff --git a/addons/sys_rack/vrc111/fnc_vrc111UnmountRadio.sqf b/addons/sys_rack/vrc111/fnc_vrc111UnmountRadio.sqf index 2a95efbfd..14cb1008a 100644 --- a/addons/sys_rack/vrc111/fnc_vrc111UnmountRadio.sqf +++ b/addons/sys_rack/vrc111/fnc_vrc111UnmountRadio.sqf @@ -24,3 +24,9 @@ private _radioId = _eventData; // Switch back to battery mode. [_radioId, "setState", ["powerSource", "BAT"]] call EFUNC(sys_data,dataEvent); + +private _audioPath = [_radioId, "getState", "audioPath"] call EFUNC(sys_data,dataEvent); + +if (_audioPath == "RACKSPEAKER") then { + [_radioId, "setState", ["audioPath", "TOPAUDIO"]] call EFUNC(sys_data,dataEvent); +}; diff --git a/addons/sys_rack/vrc64/fnc_vrc64UnmountRadio.sqf b/addons/sys_rack/vrc64/fnc_vrc64UnmountRadio.sqf index 3797b0f4d..e79100ccc 100644 --- a/addons/sys_rack/vrc64/fnc_vrc64UnmountRadio.sqf +++ b/addons/sys_rack/vrc64/fnc_vrc64UnmountRadio.sqf @@ -24,3 +24,4 @@ private _radioId = _eventData; //Enable VAA Mode. [_radioId, "setState", ["powerSource", "BAT"]] call EFUNC(sys_data,dataEvent); +[_radioId, "setState", ["audioPath", "HEADSET"]] call EFUNC(sys_data,dataEvent); diff --git a/addons/sys_sem52sl/radio/fnc_getExternalAudioPosition.sqf b/addons/sys_sem52sl/radio/fnc_getExternalAudioPosition.sqf index 9770a76a2..b7f5a1872 100644 --- a/addons/sys_sem52sl/radio/fnc_getExternalAudioPosition.sqf +++ b/addons/sys_sem52sl/radio/fnc_getExternalAudioPosition.sqf @@ -51,8 +51,18 @@ params ["_radioId", "_event", "_eventData", "_radioData"]; private _obj = [_radioId] call EFUNC(sys_radio,getRadioObject); private _pos = getPosASL _obj; -if (_obj isKindOf "Man") then { - _pos = ATLtoASL (_obj modelToWorldVisual (_obj selectionPosition "RightShoulder")); + +private _rackId = [_radioId] call EFUNC(sys_rack,getRackFromRadio); +if (_rackId isEqualTo "") then { + if (_obj isKindOf "Man") then { + _pos = ATLtoASL (_obj modelToWorld (_obj selectionPosition "RightShoulder")); + }; +} else { + private _vehicle = [_radioId] call EFUNC(sys_rack,getVehicleFromRack); + private _position = [_rackId, _vehicle] call EFUNC(sys_rack,getRackPosition); + if !(_position isEqualTo [0, 0, 0]) then { + _pos = ATLtoASL (_vehicle modelToWorld _position); + }; }; _pos; diff --git a/addons/sys_sem52sl/radio/fnc_initializeRadio.sqf b/addons/sys_sem52sl/radio/fnc_initializeRadio.sqf index c68c5637b..1bd2c9d2e 100644 --- a/addons/sys_sem52sl/radio/fnc_initializeRadio.sqf +++ b/addons/sys_sem52sl/radio/fnc_initializeRadio.sqf @@ -83,4 +83,4 @@ HASH_SET(_radioData,"channelKnobPosition", 2); // Channel 1 (after on/off option HASH_SET(_radioData,"volumeKnobPosition", 0);// mid-way HASH_SET(_radioData,"programmingStep", 0); HASH_SET(_radioData,"lastActiveChannel",0); -HASH_SET(_radioData,"audioPath", "HEADSET"); +HASH_SET(_radioData,"audioPath","HEADSET"); diff --git a/addons/sys_sem52sl/radio/fnc_isExternalAudio.sqf b/addons/sys_sem52sl/radio/fnc_isExternalAudio.sqf index 07c1362b7..c520a11ef 100644 --- a/addons/sys_sem52sl/radio/fnc_isExternalAudio.sqf +++ b/addons/sys_sem52sl/radio/fnc_isExternalAudio.sqf @@ -42,4 +42,4 @@ params ["_radioId", "_event", "_eventData", "_radioData"]; -(HASH_GET(_radioData, "audioPath") == "INTSPEAKER") +(HASH_GET(_radioData, "audioPath") in ["INTSPEAKER", "RACKSPEAKER"]) diff --git a/addons/sys_sem70/radio/fnc_getExternalAudioPosition.sqf b/addons/sys_sem70/radio/fnc_getExternalAudioPosition.sqf index 9770a76a2..b7f5a1872 100644 --- a/addons/sys_sem70/radio/fnc_getExternalAudioPosition.sqf +++ b/addons/sys_sem70/radio/fnc_getExternalAudioPosition.sqf @@ -51,8 +51,18 @@ params ["_radioId", "_event", "_eventData", "_radioData"]; private _obj = [_radioId] call EFUNC(sys_radio,getRadioObject); private _pos = getPosASL _obj; -if (_obj isKindOf "Man") then { - _pos = ATLtoASL (_obj modelToWorldVisual (_obj selectionPosition "RightShoulder")); + +private _rackId = [_radioId] call EFUNC(sys_rack,getRackFromRadio); +if (_rackId isEqualTo "") then { + if (_obj isKindOf "Man") then { + _pos = ATLtoASL (_obj modelToWorld (_obj selectionPosition "RightShoulder")); + }; +} else { + private _vehicle = [_radioId] call EFUNC(sys_rack,getVehicleFromRack); + private _position = [_rackId, _vehicle] call EFUNC(sys_rack,getRackPosition); + if !(_position isEqualTo [0, 0, 0]) then { + _pos = ATLtoASL (_vehicle modelToWorld _position); + }; }; _pos; diff --git a/addons/sys_sem70/radio/fnc_initializeRadio.sqf b/addons/sys_sem70/radio/fnc_initializeRadio.sqf index 51fe548ef..60fd25083 100644 --- a/addons/sys_sem70/radio/fnc_initializeRadio.sqf +++ b/addons/sys_sem70/radio/fnc_initializeRadio.sqf @@ -82,8 +82,8 @@ HASH_SET(_radioData,"radioOn",1); HASH_SET(_radioData,"volume",1); HASH_SET(_radioData,"currentChannel",GVAR(manualChannel)); // Manual Channel //HASH_SET(_radioData,"lastActiveChannel",GVAR(manualChannel)); -HASH_SET(_radioData,"audioPath", "HEADSET"); -HASH_SET(_radioData,"powerSource", "BAT"); +HASH_SET(_radioData,"audioPath","HEADSET"); +HASH_SET(_radioData,"powerSource","BAT"); // Channel //HASH_SET(_radioData,"mode","singleChannel"); // or "sem70AKW" diff --git a/addons/sys_sem70/radio/fnc_isExternalAudio.sqf b/addons/sys_sem70/radio/fnc_isExternalAudio.sqf index 07c1362b7..f3f0bb5d5 100644 --- a/addons/sys_sem70/radio/fnc_isExternalAudio.sqf +++ b/addons/sys_sem70/radio/fnc_isExternalAudio.sqf @@ -42,4 +42,4 @@ params ["_radioId", "_event", "_eventData", "_radioData"]; -(HASH_GET(_radioData, "audioPath") == "INTSPEAKER") +(HASH_GET(_radioData, "audioPath") == "RACKSPEAKER")