diff --git a/addons/screenshotMode/functions/fn_toggleTFAR.sqf b/addons/screenshotMode/functions/fn_toggleTFAR.sqf index d7be317e..4705fb2b 100644 --- a/addons/screenshotMode/functions/fn_toggleTFAR.sqf +++ b/addons/screenshotMode/functions/fn_toggleTFAR.sqf @@ -7,9 +7,9 @@ if (!_tfarEnabled) exitWith {}; if (_newState) then { TFAR_VolumeHudTransparency = GVAR(tfar); - [] call TFAR_fnc_updateSpeakVolumeUI; + {call TFAR_fnc_updateSpeakVolumeUI} call CBA_fnc_directCall; } else { GVAR(tfar) = TFAR_VolumeHudTransparency; TFAR_VolumeHudTransparency = 1; - [] call TFAR_fnc_updateSpeakVolumeUI; + {call TFAR_fnc_updateSpeakVolumeUI} call CBA_fnc_directCall; }; diff --git a/addons/zeus/XEH_preClientInit.sqf b/addons/zeus/XEH_preClientInit.sqf index 17053924..93bf4ffb 100644 --- a/addons/zeus/XEH_preClientInit.sqf +++ b/addons/zeus/XEH_preClientInit.sqf @@ -38,77 +38,82 @@ if (isClass (configFile >> "CfgPatches" >> "tfar_core")) then { [ "TFAR_event_OnSWchannelSet", { - if !(isNull (getAssignedCuratorLogic ace_player)) exitWith {}; + [{ + if !(isNull (getAssignedCuratorLogic ace_player)) exitWith {}; - params ["_unit", "_radio", "_channel", "_additional"]; + params ["_unit", "_radio", "_channel", "_additional"]; - private _frequency = [(call TFAR_fnc_activeSwRadio), (_channel +1)] call TFAR_fnc_getChannelFrequency; - if (_additional) then { - if (_channel isEqualTo (_unit getVariable [QGVAR(channelAdditionalSW), -1])) exitWith { - _unit setVariable [QGVAR(channelAdditionalSW), nil, true]; - _unit setVariable [QGVAR(freqAdditionalSW), nil, true]; + private _frequency = [(call TFAR_fnc_activeSwRadio), (_channel +1)] call TFAR_fnc_getChannelFrequency; + if (_additional) then { + if (_channel isEqualTo (_unit getVariable [QGVAR(channelAdditionalSW), -1])) exitWith { + _unit setVariable [QGVAR(channelAdditionalSW), nil, true]; + _unit setVariable [QGVAR(freqAdditionalSW), nil, true]; + }; + _unit setVariable [QGVAR(channelAdditionalSW), _channel, true]; + _unit setVariable [QGVAR(freqAdditionalSW), _frequency, true]; + }else{ + _unit setVariable [QGVAR(channelSW), _channel, true]; + _unit setVariable [QGVAR(freqSW), _frequency, true]; }; - _unit setVariable [QGVAR(channelAdditionalSW), _channel, true]; - _unit setVariable [QGVAR(freqAdditionalSW), _frequency, true]; - }else{ - _unit setVariable [QGVAR(channelSW), _channel, true]; - _unit setVariable [QGVAR(freqSW), _frequency, true]; - }; + }, _this] call CBA_fnc_directCall; } ] call CBA_fnc_addEventHandler; [ "TFAR_event_OnLRchannelSet", { - if !(isNull (getAssignedCuratorLogic ace_player)) exitWith {}; + [{ + if !(isNull (getAssignedCuratorLogic ace_player)) exitWith {}; - params ["_unit", "", "", "_channel", "_additional"]; + params ["_unit", "", "", "_channel", "_additional"]; - // TFAR_fnc_activeLRRadio has to be called in a non-scheduled environment - private _frequency = {[(call TFAR_fnc_activeLRRadio), (_channel + 1)] call TFAR_fnc_getChannelFrequency; } call CBA_fnc_directCall; - if (_additional) then { + private _frequency = [(call TFAR_fnc_activeLRRadio), (_channel + 1)] call TFAR_fnc_getChannelFrequency; + if (_additional) then { - if (_channel isEqualTo (_unit getVariable [QGVAR(freqAdditionalLR), -1])) exitWith { - _unit setVariable [QGVAR(channelAdditionalLR), nil, true]; - _unit setVariable [QGVAR(freqAdditionalLR), nil, true]; + if (_channel isEqualTo (_unit getVariable [QGVAR(freqAdditionalLR), -1])) exitWith { + _unit setVariable [QGVAR(channelAdditionalLR), nil, true]; + _unit setVariable [QGVAR(freqAdditionalLR), nil, true]; + }; + _unit setVariable [QGVAR(channelAdditionalLR), _channel, true]; + _unit setVariable [QGVAR(freqAdditionalLR), _frequency, true]; + }else{ + _unit setVariable [QGVAR(channelLR), _channel, true]; + _unit setVariable [QGVAR(freqLR), _frequency, true]; }; - _unit setVariable [QGVAR(channelAdditionalLR), _channel, true]; - _unit setVariable [QGVAR(freqAdditionalLR), _frequency, true]; - }else{ - _unit setVariable [QGVAR(channelLR), _channel, true]; - _unit setVariable [QGVAR(freqLR), _frequency, true]; - }; + }, _this] call CBA_fnc_directCall; } ] call CBA_fnc_addEventHandler; [ "TFAR_event_OnFrequencyChanged", { - if !(isNull (getAssignedCuratorLogic ace_player)) exitWith {}; + [{ + if !(isNull (getAssignedCuratorLogic ace_player)) exitWith {}; - params ["_unit", "_radio", "_channel", "", "_frequency"]; + params ["_unit", "_radio", "_channel", "", "_frequency"]; - private _backpackLR = call TFAR_fnc_activeLRRadio; - if (_backpackLR isEqualTo _radio) then { - if (_channel isEqualTo (_unit getVariable [QGVAR(channelLR), -1])) then { - _unit setVariable [QGVAR(freqLR), _frequency, true]; - }else{ - if (_channel isEqualTo (_unit getVariable [QGVAR(channelAdditionalLR), -1])) then { - _unit setVariable [QGVAR(freqAdditionalLR), _frequency, true]; - }; - }; - }else{ - private _loadoutRadio = call TFAR_fnc_activeSwRadio; - if (_loadoutRadio isEqualTo _radio) then { - if (_channel isEqualTo (_unit getVariable [QGVAR(channelSW), -1])) then { - _unit setVariable [QGVAR(freqSW), _frequency, true]; + private _backpackLR = call TFAR_fnc_activeLRRadio; + if (_backpackLR isEqualTo _radio) then { + if (_channel isEqualTo (_unit getVariable [QGVAR(channelLR), -1])) then { + _unit setVariable [QGVAR(freqLR), _frequency, true]; }else{ - if (_channel isEqualTo (_unit getVariable [QGVAR(channelAdditionalSW), -1])) then { - _unit setVariable [QGVAR(freqAdditionalSW), _frequency, true]; + if (_channel isEqualTo (_unit getVariable [QGVAR(channelAdditionalLR), -1])) then { + _unit setVariable [QGVAR(freqAdditionalLR), _frequency, true]; + }; + }; + }else{ + private _loadoutRadio = call TFAR_fnc_activeSwRadio; + if (_loadoutRadio isEqualTo _radio) then { + if (_channel isEqualTo (_unit getVariable [QGVAR(channelSW), -1])) then { + _unit setVariable [QGVAR(freqSW), _frequency, true]; + }else{ + if (_channel isEqualTo (_unit getVariable [QGVAR(channelAdditionalSW), -1])) then { + _unit setVariable [QGVAR(freqAdditionalSW), _frequency, true]; + }; }; }; }; - }; + }, _this] call CBA_fnc_directCall; } ] call CBA_fnc_addEventHandler; diff --git a/addons/zeus/functions/fnc_moduleDiagnosticsGetPlayerFreqsAtStart.sqf b/addons/zeus/functions/fnc_moduleDiagnosticsGetPlayerFreqsAtStart.sqf index da28722b..9d58dfe3 100644 --- a/addons/zeus/functions/fnc_moduleDiagnosticsGetPlayerFreqsAtStart.sqf +++ b/addons/zeus/functions/fnc_moduleDiagnosticsGetPlayerFreqsAtStart.sqf @@ -6,35 +6,37 @@ if (isClass (configFile >> "CfgPatches" >> "acre_main")) then { }; if (isClass (configFile >> "CfgPatches" >> "tfar_core")) then { - private _radioSW = call TFAR_fnc_activeSwRadio; - if (!(isNil "_radioSW") && {!(_radioSW isEqualTo "")} && {(player getVariable [QGVAR(freqSW), -1]) isEqualTo -1}) then { - - private _radioChannelSW = _radioSW call TFAR_fnc_getSwChannel; - if (!(isNil "_radioChannelSW") && {!(_radioChannelSW isEqualTo -1)}) then { - player setVariable [QGVAR(channelSW), _radioChannelSW, true]; - player setVariable [QGVAR(freqSW), [_radioSW, (_radioChannelSW +1)] call TFAR_fnc_getChannelFrequency, true]; - }; - - private _radioAdditionalChannelSW = _radioSW call TFAR_fnc_getAdditionalSwChannel; - if (!(isNil "_radioAdditionalChannelSW") && {!(_radioAdditionalChannelSW isEqualTo -1)}) then { - player setVariable [QGVAR(channelAdditionalSW), _radioAdditionalChannelSW, true]; - player setVariable [QGVAR(freqAdditionalSW), [_radioSW, (_radioAdditionalChannelSW +1)] call TFAR_fnc_getChannelFrequency, true]; + { + private _radioSW = call TFAR_fnc_activeSwRadio; + if (!(isNil "_radioSW") && {!(_radioSW isEqualTo "")} && {(player getVariable [QGVAR(freqSW), -1]) isEqualTo -1}) then { + + private _radioChannelSW = _radioSW call TFAR_fnc_getSwChannel; + if (!(isNil "_radioChannelSW") && {!(_radioChannelSW isEqualTo -1)}) then { + player setVariable [QGVAR(channelSW), _radioChannelSW, true]; + player setVariable [QGVAR(freqSW), [_radioSW, (_radioChannelSW +1)] call TFAR_fnc_getChannelFrequency, true]; + }; + + private _radioAdditionalChannelSW = _radioSW call TFAR_fnc_getAdditionalSwChannel; + if (!(isNil "_radioAdditionalChannelSW") && {!(_radioAdditionalChannelSW isEqualTo -1)}) then { + player setVariable [QGVAR(channelAdditionalSW), _radioAdditionalChannelSW, true]; + player setVariable [QGVAR(freqAdditionalSW), [_radioSW, (_radioAdditionalChannelSW +1)] call TFAR_fnc_getChannelFrequency, true]; + }; }; - }; - private _radioLR = call TFAR_fnc_activeLRRadio; - if (!(isNil "_radioLR") && {!(_radioSW isEqualTo "")} && {(player getVariable [QGVAR(freqLR), -1]) isEqualTo -1}) then { + private _radioLR = call TFAR_fnc_activeLRRadio; + if (!(isNil "_radioLR") && {!(_radioSW isEqualTo "")} && {(player getVariable [QGVAR(freqLR), -1]) isEqualTo -1}) then { - private _radioChannelLR = _radioLR call TFAR_fnc_getLrChannel; - if (!(isNil "_radioChannelLR") && {!(_radioChannelLR isEqualTo -1)}) then { - player setVariable [QGVAR(channelLR), _radioChannelLR, true]; - player setVariable [QGVAR(freqLR), [_radioLR, (_radioChannelLR +1)] call TFAR_fnc_getChannelFrequency, true]; - }; + private _radioChannelLR = _radioLR call TFAR_fnc_getLrChannel; + if (!(isNil "_radioChannelLR") && {!(_radioChannelLR isEqualTo -1)}) then { + player setVariable [QGVAR(channelLR), _radioChannelLR, true]; + player setVariable [QGVAR(freqLR), [_radioLR, (_radioChannelLR +1)] call TFAR_fnc_getChannelFrequency, true]; + }; - private _radioAdditionalChannelLR = _radioLR call TFAR_fnc_getAdditionalLrChannel; - if (!(isNil "_radioAdditionalChannelLR") && {!(_radioAdditionalChannelLR isEqualTo -1)}) then { - player setVariable [QGVAR(channelAdditionalLR), _radioAdditionalChannelLR, true]; - player setVariable [QGVAR(freqAdditionalLR), [_radioLR, (_radioAdditionalChannelLR +1)] call TFAR_fnc_getChannelFrequency, true]; + private _radioAdditionalChannelLR = _radioLR call TFAR_fnc_getAdditionalLrChannel; + if (!(isNil "_radioAdditionalChannelLR") && {!(_radioAdditionalChannelLR isEqualTo -1)}) then { + player setVariable [QGVAR(channelAdditionalLR), _radioAdditionalChannelLR, true]; + player setVariable [QGVAR(freqAdditionalLR), [_radioLR, (_radioAdditionalChannelLR +1)] call TFAR_fnc_getChannelFrequency, true]; + }; }; - }; + } call CBA_fnc_directCall; }; \ No newline at end of file