Skip to content

Commit

Permalink
General - Cleanup all spaces in SQF macros (#1318)
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror authored Mar 1, 2024
1 parent 9769bf1 commit 5024078
Show file tree
Hide file tree
Showing 354 changed files with 2,121 additions and 2,117 deletions.
2 changes: 1 addition & 1 deletion addons/api/fnc_addRackToVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private _selectPlayer = {
} forEach ([] call CBA_fnc_players);

if (isNull _player) then {
WARNING_1("No unit found for condition %1, defaulting to first player",_condition);
WARNING_1("No unit found for condition %1 - defaulting to first player",_condition);
_player = ([] call CBA_fnc_players) select 0;
};
};
Expand Down
4 changes: 2 additions & 2 deletions addons/api/fnc_basicMissionSetup.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ params [
// Run once
if (!isNil QGVAR(basicMissionSetup) && {GVAR(basicMissionSetup)}) exitWith {};

TRACE_1("enter", _this);
TRACE_1("enter",_this);

// Basic setup
private _setupRadios = _logic getVariable ["RadioSetup", false];
Expand Down Expand Up @@ -102,7 +102,7 @@ private _addRadios = {

};

TRACE_1("Adding Radios", _cleanRadioList);
TRACE_1("Adding Radios",_cleanRadioList);

if ((backpack _player == "") && {(["ACRE_PRC77", "ACRE_PRC117F"] arrayIntersect _cleanRadioList) isNotEqualTo []}) then {
_player addBackpack "B_AssaultPack_khk";
Expand Down
2 changes: 1 addition & 1 deletion addons/api/fnc_getBaseRadio.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ params [
["_radioId", "", [""]]
];

TRACE_1("", _radioId);
TRACE_1("",_radioId);
if ( ([_radioId] call FUNC(isBaseRadio)) ) exitWith {
_radioId
};
Expand Down
4 changes: 2 additions & 2 deletions addons/api/fnc_getPresetChannelData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ if (_channelReference isEqualType []) then {
private _presetData = [_radioClass, _presetName] call EFUNC(sys_data,getPresetData);
if (isNil "_presetData") exitWith { nil };

private _channels = HASH_GET(_presetData, "channels");
private _channel = HASHLIST_SELECT(_channels, _channelNumber);
private _channels = HASH_GET(_presetData,"channels");
private _channel = HASHLIST_SELECT(_channels,_channelNumber);

if (isNil "_channel") exitWith { nil };
_channel
8 changes: 4 additions & 4 deletions addons/api/fnc_getPresetChannelField.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ _channelNumber = _channelNumber - 1;
private _presetData = [_radioClass, _presetName] call EFUNC(sys_data,getPresetData);
if (isNil "_presetData") exitWith { nil };

private _channels = HASH_GET(_presetData, "channels");
private _channel = HASHLIST_SELECT(_channels, _channelNumber);
private _channels = HASH_GET(_presetData,"channels");
private _channel = HASHLIST_SELECT(_channels,_channelNumber);

private _fieldName = [_radioClass, _fieldName] call FUNC(mapChannelFieldName);

if (!HASH_HASKEY(_channel, _fieldName)) exitWith { nil };
private _value = HASH_GET(_channel, _fieldName);
if (!HASH_HASKEY(_channel,_fieldName)) exitWith { nil };
private _value = HASH_GET(_channel,_fieldName);

if (isNil "_value") exitWith { nil };
_value
2 changes: 1 addition & 1 deletion addons/api/fnc_initVehicleRacks.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if (_condition isEqualTo {} && {_vehiclePresetName isNotEqualTo ""}) then {
private _index = _players findIf {[_x] call _condition};

if (_index == -1) then {
WARNING_1("No unit found for condition %1, defaulting to first player",_condition);
WARNING_1("No unit found for condition %1 - defaulting to first player",_condition);
_index = 0;
};
_player = _players select _index;
Expand Down
6 changes: 3 additions & 3 deletions addons/api/fnc_isKindOf.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ if (_parent == "") then {

private _isAcre = getNumber (configFile >> "CfgAcreComponents" >> _parent >> "isAcre");
// diag_log text format["_radioId: %1 isAcre: %2", _parent, _isAcre];
TRACE_2("", _parent, _isAcre);
TRACE_2("",_parent,_isAcre);
if (_isAcre == 0) exitWith {
false
};
TRACE_2("", _parent, _radioType);
TRACE_2("",_parent,_radioType);

if (_parent == _radioType) exitWith {
true
Expand All @@ -49,7 +49,7 @@ if (_parent == _radioType) exitWith {

while { _parent != "" } do {
if (_parent == _radioType) exitWith {
TRACE_2("", _parent, _radioType);
TRACE_2("",_parent,_radioType);
true
};
_parent = configName (inheritsFrom ( configFile >> "CfgAcreComponents" >> _parent));
Expand Down
4 changes: 2 additions & 2 deletions addons/api/fnc_mapChannelFieldName.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ params [
["_fieldName", "", [""]]
];

TRACE_1("CALLING", "");
TRACE_1("CALLING","");
private _baseRadio = [_radioId] call FUNC(getBaseRadio);
TRACE_1("", _baseRadio);
TRACE_1("",_baseRadio);
switch _baseRadio do {
case "ACRE_PRC148": {
if (_fieldName == "description" || _fieldName == "name") then {
Expand Down
10 changes: 5 additions & 5 deletions addons/api/fnc_nameChannels.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
FUNC(_channelNamesForPresets) = {
params ["_channelNames", "_presetNames"];

TRACE_1("enter", _this);
TRACE_1("enter",_this);
if (_presetNames isNotEqualTo []) then {
{
if (_x != "") then {
Expand Down Expand Up @@ -52,7 +52,7 @@ private _channelNamesNoSides = {
_presetNames pushBack [_x, _presetName];
} forEach ((call FUNC(getAllRadios)) select 0);

TRACE_1("Configuring radio for presets", _presetNames);
TRACE_1("Configuring radio for presets",_presetNames);
[_this, _presetNames] call FUNC(_channelNamesForPresets);
};

Expand All @@ -64,7 +64,7 @@ private _channelNamesForPresetGroup = {
_presetNames pushBack [_x, _presetName];
} forEach ((call FUNC(getAllRadios)) select 0);

TRACE_1("Configuring radio for presets", _presetNames);
TRACE_1("Configuring radio for presets",_presetNames);
[_channelNames, _presetNames] call FUNC(_channelNamesForPresets);
};

Expand All @@ -73,7 +73,7 @@ params ["_logic", "_units", "_activated"];

if (!_activated) exitWith {};

TRACE_1("enter", _this);
TRACE_1("enter",_this);

private _sideNumber = _logic getVariable ["SideSelect", false];
private _channelNames = [
Expand All @@ -93,7 +93,7 @@ private _setupSides = false;
{
if (_x isKindOf QGVAR(basicMissionSetup)) exitWith {
_setupSides = _x getVariable ["RadioSetup", false];
TRACE_1("Dedicated basic mission module, checking sides configuration", _setupSides);
TRACE_1("Dedicated basic mission module - checking sides configuration",_setupSides);
};
} forEach (allMissionObjects "logic");

Expand Down
2 changes: 1 addition & 1 deletion addons/api/fnc_setPresetChannelField.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ TRACE_1("",_channelNumber);
//_channelNumber = ["getCurrentChannel"] call GUI_DATA_EVENT;
private _presetData = [_radioClass, _presetName] call EFUNC(sys_data,getPresetData);
if (isNil "_presetData") exitWith {false};
TRACE_1("", _presetData);
TRACE_1("",_presetData);

private _channels = HASH_GET(_presetData,"channels");
TRACE_1("",_channels);
Expand Down
4 changes: 2 additions & 2 deletions addons/api/fnc_tests.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ private ["_test"];
#define ASSERT_BOOL(val1,val2) (val1 isEqualTo val2)
#define ASSERT_STRING(val1,val2) (val1 == val2)
#define ASSERT_TYPE(val1,val2) (val2 isEqualType val1)
#define PASS(fncName) PUSH(GVAR(testResults), [ARR_2(QUOTE(fncName),true)])
#define FAIL(fncName) PUSH(GVAR(testResults), [ARR_2(QUOTE(fncName),false)])
#define PASS(fncName) PUSH(GVAR(testResults),[ARR_2(QUOTE(fncName),true)])
#define FAIL(fncName) PUSH(GVAR(testResults),[ARR_2(QUOTE(fncName),false)])


/*
Expand Down
18 changes: 9 additions & 9 deletions addons/main/script_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ SQF equivalent of extensions/src/ACRE2Shared/Types.h
#define DEFUNC(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)

#define GET_STATE(id) ([GVAR(currentRadioId), "getState", id] call EFUNC(sys_data,dataEvent))
#define SET_STATE(id, val) ([GVAR(currentRadioId), "setState", [id, val]] call EFUNC(sys_data,dataEvent))
#define SET_STATE_CRIT(id, val) ([GVAR(currentRadioId), "setStateCritical", [id, val]] call EFUNC(sys_data,dataEvent))
#define GET_STATE_DEF(id, default) ([id, default] call FUNC(getDefaultState))
#define SET_STATE(id, val) ([GVAR(currentRadioId),"setState",[id,val]] call EFUNC(sys_data,dataEvent))
#define SET_STATE_CRIT(id, val) ([GVAR(currentRadioId), "setStateCritical",[id,val]] call EFUNC(sys_data,dataEvent))
#define GET_STATE_DEF(id, default) ([id,default] call FUNC(getDefaultState))

#define SCRATCH_SET(radioId, key, val) ([radioId, key, val] call EFUNC(sys_data,setScratchData))
#define SCRATCH_GET(radioId, key) ([radioId, key] call EFUNC(sys_data,getScratchData))
#define SCRATCH_GET_DEF(radioId, key, defaultVal) ([radioId, key, defaultVal] call EFUNC(sys_data,getScratchData))
#define SCRATCH_SET(radioId, key, val) ([radioId,key,val] call EFUNC(sys_data,setScratchData))
#define SCRATCH_GET(radioId, key) ([radioId,key] call EFUNC(sys_data,getScratchData))
#define SCRATCH_GET_DEF(radioId, key, defaultVal) ([radioId,key,defaultVal] call EFUNC(sys_data,getScratchData))

#define GET_TS3ID(object) (object call { private _ret = (_this getVariable [QGVAR(ts3id), -1]); if (_ret == -1) then { WARNING_1("%1 has no TS3 ID",_this); }; _ret })

Expand All @@ -116,16 +116,16 @@ SQF equivalent of extensions/src/ACRE2Shared/Types.h
#define HASH_CREATE (call EFUNC(main,fastHashCreate))
#define HASH_DELETE(hash) (ACRE_FAST_HASH_TO_DELETE pushBack hash)
#define HASH_HASKEY(hash, key) (!(isNil {hash getVariable key}))
#define HASH_SET(hash, key, val) (hash setVariable [key, val])
#define HASH_SET(hash, key, val) (hash setVariable [key,val])
#define HASH_GET(hash, key) (hash getVariable key)
#define HASH_REM(hash, key) (hash setVariable [key, nil])
#define HASH_REM(hash, key) (hash setVariable [key,nil])
#define HASH_COPY(hash) (hash call EFUNC(main,fastHashCopy))
#define HASH_KEYS(hash) (hash call EFUNC(main,fastHashKeys))

#define HASHLIST_CREATELIST(keys) []
#define HASHLIST_CREATEHASH(hashList) HASH_CREATE
#define HASHLIST_SELECT(hashList, index) (hashList select index)
#define HASHLIST_SET(hashList, index, value) (hashList set[index, value])
#define HASHLIST_SET(hashList, index, value) (hashList set[index,value])
#define HASHLIST_PUSH(hashList, value) (hashList pushBack value)

#define BASECLASS(radioId) ([radioId] call EFUNC(sys_radio,getRadioBaseClassname))
Expand Down
4 changes: 2 additions & 2 deletions addons/sys_attenuate/fnc_getAttenuationTurnedOut.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private _attenuationTurnedOut = 0;
private _effectType = [_unit] call FUNC(getAttenuationEffectType);
if (_effectType isEqualTo "") exitWith {_attenuationTurnedOut};

private _cachedAttenuation = HASH_GET(GVAR(attenuationTurnedOutCache), _effectType);
private _cachedAttenuation = HASH_GET(GVAR(attenuationTurnedOutCache),_effectType);
if (!isNil "_cachedAttenuation") exitWith {_cachedAttenuation};

private _attenuationsEffectsCfg = configFile >> "CfgSoundEffects" >> "AttenuationsEffects";
Expand All @@ -34,6 +34,6 @@ if (isNumber (_attenuationCfg)) then {
_attenuationTurnedOut = getNumber (_attenuationsEffectsCfg >> "acreDefaultAttenuationTurnedOut");
};

HASH_SET(GVAR(attenuationTurnedOutCache), _effectType, _attenuationTurnedOut);
HASH_SET(GVAR(attenuationTurnedOutCache),_effectType,_attenuationTurnedOut);

_attenuationTurnedOut
4 changes: 2 additions & 2 deletions addons/sys_attenuate/fnc_getVehicleAttenuation.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private _attenuation = 0;
private _effectType = [_unit] call FUNC(getAttenuationEffectType);
if (_effectType isEqualTo "") exitWith {_attenuation};

private _cachedAttenuation = HASH_GET(GVAR(attenuationCache), _effectType);
private _cachedAttenuation = HASH_GET(GVAR(attenuationCache),_effectType);
if (!isNil "_cachedAttenuation") exitWith {_cachedAttenuation};

private _attenuationsEffectsCfg = configFile >> "CfgSoundEffects" >> "AttenuationsEffects";
Expand All @@ -34,6 +34,6 @@ if (isNumber (_attenuationCfg)) then {
_attenuation = getNumber (_attenuationsEffectsCfg >> "acreDefaultAttenuation");
};

HASH_SET(GVAR(attenuationCache), _effectType, _attenuation);
HASH_SET(GVAR(attenuationCache),_effectType,_attenuation);

_attenuation
2 changes: 1 addition & 1 deletion addons/sys_bf888s/functions/fnc_onChannelKnobPress.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if (_knob == 0) then {
_newChannel = ((_currentChannel + _currentDirection) max 0) min 15;
};

TRACE_2("Channel", _newChannel, _currentChannel);
TRACE_2("Channel",_newChannel,_currentChannel);
if (_newChannel != _currentChannel) then {
["setCurrentChannel", _newChannel] call GUI_DATA_EVENT;

Expand Down
24 changes: 12 additions & 12 deletions addons/sys_bf888s/functions/fnc_preset_information.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ for "_i" from 0 to 15 do {
HASH_SET(_channel,"frequencyRX",_frequency);
HASH_SET(_channel,"power",5000);
HASH_SET(_channel,"encryption",0);
HASH_SET(_channel,"channelMode", "BASIC");
HASH_SET(_channel,"CTCSSTx", 69.3);
HASH_SET(_channel,"CTCSSRx", 69.3);
HASH_SET(_channel,"channelMode","BASIC");
HASH_SET(_channel,"CTCSSTx",69.3);
HASH_SET(_channel,"CTCSSRx",69.3);
HASH_SET(_channel,"modulation","FM");
HASH_SET(_channel,"trafficRate",16);
HASH_SET(_channel,"TEK","");
Expand All @@ -63,9 +63,9 @@ for "_i" from 16 to 31 do {
HASH_SET(_channel,"frequencyRX",_frequency);
HASH_SET(_channel,"power",5000);
HASH_SET(_channel,"encryption",0);
HASH_SET(_channel,"channelMode", "BASIC");
HASH_SET(_channel,"CTCSSTx", 69.3);
HASH_SET(_channel,"CTCSSRx", 69.3);
HASH_SET(_channel,"channelMode","BASIC");
HASH_SET(_channel,"CTCSSTx",69.3);
HASH_SET(_channel,"CTCSSRx",69.3);
HASH_SET(_channel,"modulation","FM");
HASH_SET(_channel,"trafficRate",16);
HASH_SET(_channel,"TEK","");
Expand All @@ -91,9 +91,9 @@ for "_i" from 32 to 47 do {
HASH_SET(_channel,"frequencyRX",_frequency);
HASH_SET(_channel,"power",5000);
HASH_SET(_channel,"encryption",0);
HASH_SET(_channel,"channelMode", "BASIC");
HASH_SET(_channel,"CTCSSTx", 69.3);
HASH_SET(_channel,"CTCSSRx", 69.3);
HASH_SET(_channel,"channelMode","BASIC");
HASH_SET(_channel,"CTCSSTx",69.3);
HASH_SET(_channel,"CTCSSRx",69.3);
HASH_SET(_channel,"modulation","FM");
HASH_SET(_channel,"trafficRate",16);
HASH_SET(_channel,"TEK","");
Expand All @@ -118,9 +118,9 @@ for "_i" from 48 to 63 do {
HASH_SET(_channel,"frequencyRX",_frequency);
HASH_SET(_channel,"power",5000);
HASH_SET(_channel,"encryption",0);
HASH_SET(_channel,"channelMode", "BASIC");
HASH_SET(_channel,"CTCSSTx", 69.3);
HASH_SET(_channel,"CTCSSRx", 69.3);
HASH_SET(_channel,"channelMode","BASIC");
HASH_SET(_channel,"CTCSSTx",69.3);
HASH_SET(_channel,"CTCSSRx",69.3);
HASH_SET(_channel,"modulation","FM");
HASH_SET(_channel,"trafficRate",16);
HASH_SET(_channel,"TEK","");
Expand Down
10 changes: 5 additions & 5 deletions addons/sys_bf888s/functions/fnc_render.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private _currentChannel = _currentAbsChannel;
private _currentVolume = GET_STATE("volume"); //from 0 to 1
private _currentVolumeKnobState = round (_currentVolume * 5);

{_x ctrlEnable false;} forEach [RADIO_CTRL(201), RADIO_CTRL(202)];
{_x ctrlEnable false;} forEach [RADIO_CTRL(201),RADIO_CTRL(202)];

private _currentViewFrame = 0;
_currentViewFrame = 0;
Expand All @@ -40,11 +40,11 @@ _currentViewFrame = 0;

RADIO_CTRL(106) ctrlSetText format ["\idi\acre\addons\sys_bf888s\Data\knobs\channel\bf888s_ui_pre_%1.paa", _currentChannel + 1];
RADIO_CTRL(107) ctrlSetText format ["\idi\acre\addons\sys_bf888s\Data\knobs\volume\bf888s_ui_vol_%1.paa", _currentVolumeKnobState];
RADIO_CTRL(201) ctrlSetTooltip format ["%1: %2", LELSTRING(sys_radio,ui_CurrentChannel), _currentChannel + 1];
RADIO_CTRL(202) ctrlSetTooltip format ["%1: %2%3", LELSTRING(sys_radio,ui_CurrentVolume), round (_currentVolume * 100), "%"];
RADIO_CTRL(201) ctrlSetTooltip format ["%1: %2",LELSTRING(sys_radio,ui_CurrentChannel), _currentChannel + 1];
RADIO_CTRL(202) ctrlSetTooltip format ["%1: %2%3", LELSTRING(sys_radio,ui_CurrentVolume),round (_currentVolume * 100), "%"];
RADIO_CTRL(99999) ctrlSetText QPATHTOF(Data\static\bf888s_ui_backplate.paa);

{_x ctrlEnable true;} forEach [RADIO_CTRL(201), RADIO_CTRL(202)];
{_x ctrlEnable true;} forEach [RADIO_CTRL(201),RADIO_CTRL(202)];

TRACE_3("rendering", _currentChannel, _currentVolume, EGVAR(sys_radio,currentRadioDialog));
TRACE_3("rendering",_currentChannel,_currentVolume,EGVAR(sys_radio,currentRadioDialog));
true
4 changes: 2 additions & 2 deletions addons/sys_bf888s/radio/fnc_getChannelData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
* Public: No
*/

TRACE_1("888S getChannelData", _this);
TRACE_1("888S getChannelData",_this);
params ["_radioId", "", "_eventData", "_radioData"];

private _cachedChannels = SCRATCH_GET_DEF(_radioId, "cachedFullChannels", []);
private _cachedChannels = SCRATCH_GET_DEF(_radioId,"cachedFullChannels",[]);
private _return = nil;
if (_eventData < (count _cachedChannels)) then {
_return = _cachedChannels select _eventData;
Expand Down
28 changes: 14 additions & 14 deletions addons/sys_bf888s/radio/fnc_getChannelDataInternal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@

params ["_channelNumber", "_radioData"];

private _channels = HASH_GET(_radioData, "channels");
private _channel = HASHLIST_SELECT(_channels, _channelNumber);
private _channels = HASH_GET(_radioData,"channels");
private _channel = HASHLIST_SELECT(_channels,_channelNumber);

private _return = HASH_CREATE;

HASH_SET(_return, "mode", "singleChannel");
HASH_SET(_return, "frequencyTX", HASH_GET(_channel, "frequencyTX"));
HASH_SET(_return, "frequencyRX", HASH_GET(_channel, "frequencyRX"));
HASH_SET(_return, "power", HASH_GET(_channel, "power"));
HASH_SET(_return, "CTCSSTx", HASH_GET(_channel, "CTCSSTx"));
HASH_SET(_return, "CTCSSRx", HASH_GET(_channel, "CTCSSRx"));
HASH_SET(_return, "modulation", HASH_GET(_channel, "modulation"));
HASH_SET(_return, "encryption", HASH_GET(_channel, "encryption"));
HASH_SET(_return, "TEK", HASH_GET(_channel, "tek"));
HASH_SET(_return, "trafficRate", HASH_GET(_channel, "trafficRate"));
HASH_SET(_return, "syncLength", HASH_GET(_channel, "phase"));
HASH_SET(_return,"mode","singleChannel");
HASH_SET(_return,"frequencyTX",HASH_GET(_channel,"frequencyTX"));
HASH_SET(_return,"frequencyRX",HASH_GET(_channel,"frequencyRX"));
HASH_SET(_return,"power",HASH_GET(_channel,"power"));
HASH_SET(_return,"CTCSSTx",HASH_GET(_channel,"CTCSSTx"));
HASH_SET(_return,"CTCSSRx",HASH_GET(_channel,"CTCSSRx"));
HASH_SET(_return,"modulation",HASH_GET(_channel,"modulation"));
HASH_SET(_return,"encryption",HASH_GET(_channel,"encryption"));
HASH_SET(_return,"TEK",HASH_GET(_channel,"tek"));
HASH_SET(_return,"trafficRate",HASH_GET(_channel,"trafficRate"));
HASH_SET(_return,"syncLength",HASH_GET(_channel,"phase"));

TRACE_2("THINGS: ",_return, _channel);
TRACE_2("THINGS: ",_return,_channel);

_return
Loading

0 comments on commit 5024078

Please sign in to comment.