diff --git a/.gitignore b/.gitignore index ae27039..bd92f5b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,8 @@ __pycache__ mission.sqm framework/rsc/loadouts/*.sqf framework/rsc/scripts/*.sqf -!framework/rsc/loadouts/*.sqf +!framework/rsc/loadouts/!*.sqf +framework/rsc/loadouts/test*.sqf # Todos and changelogs TODO.md diff --git a/framework/components/3den/XEH_PREP.sqf b/framework/components/3den/XEH_PREP.sqf index 72a6cef..7bb7f46 100644 --- a/framework/components/3den/XEH_PREP.sqf +++ b/framework/components/3den/XEH_PREP.sqf @@ -15,4 +15,4 @@ PREP(main_setConfig); PREP(unitConstructor); PREP(missionDataSet); -PREP(missionDataGet); +PREP(missionDataGet); \ No newline at end of file diff --git a/framework/components/3den/functions/fn_addMenuItem.sqf b/framework/components/3den/functions/fn_addMenuItem.sqf index da8e6ef..082c74e 100644 --- a/framework/components/3den/functions/fn_addMenuItem.sqf +++ b/framework/components/3den/functions/fn_addMenuItem.sqf @@ -39,7 +39,7 @@ if (!isNil "_action") then { if (!isNil "_children") then { { - ([_path] + _x) call FUNC(addMenuItem); + [_path] + _x call FUNC(addMenuItem); } forEach _children; }; diff --git a/framework/components/3den/functions/fn_addToInit.sqf b/framework/components/3den/functions/fn_addToInit.sqf index e0851ee..c36d410 100644 --- a/framework/components/3den/functions/fn_addToInit.sqf +++ b/framework/components/3den/functions/fn_addToInit.sqf @@ -25,7 +25,7 @@ if (_line isEqualType {}) then { _line = toString _line; }; -if ((_line select [(count _line - 1), 1]) != ";") then { +if (_line select [count _line - 1, 1] != ";") then { _line = [_line, ";"] joinString ""; }; diff --git a/framework/components/3den/functions/fn_main_iconViewer.sqf b/framework/components/3den/functions/fn_main_iconViewer.sqf index 1e64083..8494899 100644 --- a/framework/components/3den/functions/fn_main_iconViewer.sqf +++ b/framework/components/3den/functions/fn_main_iconViewer.sqf @@ -26,7 +26,7 @@ if (!hasInterface) exitWith {}; disableSerialization; private _fnc_GRID_X = { - pixelW * pixelGridNoUIScale * (((_this) * (2)) / 4) + pixelW * pixelGridNoUIScale * ((_this * 2) / 4) }; private _fnc_GRID_Y = { @@ -49,10 +49,10 @@ switch _mode do { private _icons = []; private _addons = allAddonsInfo apply {_x select 0}; { - _icons append (addonFiles [_x, ".paa"]); - _icons append (addonFiles [_x, ".jpg"]); - _icons append (addonFiles [_x, ".tga"]); - _icons append (addonFiles [_x, ".bmp"]); + _icons append addonFiles [_x, ".paa"]; + _icons append addonFiles [_x, ".jpg"]; + _icons append addonFiles [_x, ".tga"]; + _icons append addonFiles [_x, ".bmp"]; } forEach _addons; localNamespace setVariable [QGVAR(gameIcons), _icons]; @@ -74,10 +74,10 @@ switch _mode do { private _TABLE_HEIGHT = 120; private _pos = [ - safeZoneX + (safeZoneW / 2) - (((_TABLE_WIDTH / 2) call _fnc_GRID_X)), - safeZoneY + (safeZoneH / 2) - (((_TABLE_HEIGHT / 2) call _fnc_GRID_Y)), - ((_TABLE_WIDTH) call _fnc_GRID_X), - ((_TABLE_HEIGHT) call _fnc_GRID_Y) + safeZoneX + safeZoneW / 2 - (_TABLE_WIDTH / 2 call _fnc_GRID_X), + safeZoneY + safeZoneH / 2 - (_TABLE_HEIGHT / 2 call _fnc_GRID_Y), + (_TABLE_WIDTH call _fnc_GRID_X), + (_TABLE_HEIGHT call _fnc_GRID_Y) ]; private _ctrlGroupMain = _display ctrlCreate ["RscControlsGroupNoScrollbars", -1]; @@ -91,7 +91,7 @@ switch _mode do { _background ctrlCommit 0; private _headerBackground = _display ctrlCreate ["RscText", -1, _ctrlGroupMain]; - _headerBackground ctrlSetPosition [0, 0, _pos select 2, ((3) call _fnc_GRID_Y)]; + _headerBackground ctrlSetPosition [0, 0, _pos select 2, (3 call _fnc_GRID_Y)]; _headerBackground ctrlSetBackgroundColor [ profilenamespace getvariable ['GUI_BCG_RGB_R', 0.3843], profilenamespace getvariable ['GUI_BCG_RGB_G', 0.7019], @@ -102,17 +102,17 @@ switch _mode do { _headerBackground ctrlCommit 0; private _headerText = _display ctrlCreate ["RscText", -1, _ctrlGroupMain]; - _headerText ctrlSetPosition [0, 0, _pos select 2, ((3) call _fnc_GRID_Y)]; + _headerText ctrlSetPosition [0, 0, _pos select 2, (3 call _fnc_GRID_Y)]; _headerText ctrlSetFont "RobotoCondensed"; _headerText ctrlSetTextColor [0.95, 0.95, 0.95, 1]; - _headerText ctrlSetFontHeight (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); + _headerText ctrlSetFontHeight (((safezoneW / safezoneH min 1.2) / 1.2) / 25) * 1; _headerText ctrlSetText "Icon Viewer"; _headerText ctrlEnable false; _headerText ctrlCommit 0; private _closeButton = _display ctrlCreate ["ctrlButtonPictureKeepAspect", -1, _ctrlGroupMain]; _closeButton ctrlSetText "\a3\3DEN\Data\Displays\Display3DEN\search_end_ca.paa"; - _closeButton ctrlSetPosition [(_pos select 2) - ((3 + 0.5) call _fnc_GRID_X), 0, ((3 + 0.5) call _fnc_GRID_X), ((3) call _fnc_GRID_Y)]; + _closeButton ctrlSetPosition [(_pos select 2) - (3 + 0.5 call _fnc_GRID_X), 0, (3 + 0.5 call _fnc_GRID_X), (3 call _fnc_GRID_Y)]; _closeButton ctrlAddEventHandler ["ButtonClick", { private _display = uiNamespace getVariable [QGVAR(icons_idd), displayNull]; if (!isNull _display) then {_display closeDisplay 2;}; @@ -120,7 +120,7 @@ switch _mode do { _closeButton ctrlCommit 0; private _footerBackground = _display ctrlCreate ["RscText", -1, _ctrlGroupMain]; - _footerBackground ctrlSetPosition [0, (_pos select 3) - ((5) call _fnc_GRID_Y), _pos select 2, ((5) call _fnc_GRID_Y)]; + _footerBackground ctrlSetPosition [0, (_pos select 3) - (5 call _fnc_GRID_Y), _pos select 2, (5 call _fnc_GRID_Y)]; _footerBackground ctrlSetBackgroundColor [0.1, 0.1, 0.1, 1]; _footerBackground ctrlEnable false; _footerBackground ctrlCommit 0; @@ -128,9 +128,9 @@ switch _mode do { private _ctrlGroupList = _display ctrlCreate ["RscControlsGroupNoScrollbars", 12002, _ctrlGroupMain]; _ctrlGroupList ctrlSetPosition [ 0, - ((3 + 0.5) call _fnc_GRID_Y), + (3 + 0.5 call _fnc_GRID_Y), _pos select 2, - (_pos select 3) - ((3 + 0.5 + 0.5 + 5) call _fnc_GRID_Y) + (_pos select 3) - (3 + 0.5 + 0.5 + 5 call _fnc_GRID_Y) ]; _ctrlGroupList ctrlSetBackgroundColor [1, 1, 1, 0.9]; _ctrlGroupList ctrlCommit 0; @@ -139,18 +139,18 @@ switch _mode do { private _boxesX = localNamespace getVariable [QGVAR(icons_boxesX), 5]; private _boxesY = localNamespace getVariable [QGVAR(icons_boxesY), 5]; - private _w0 = ((_origPos select 2) - ((_boxesX + 1) * ((0.5) call _fnc_GRID_X))) / _boxesX; - private _h0 = ((_origPos select 3) - ((_boxesY + 1) * ((0.5) call _fnc_GRID_Y))) / _boxesY; - private _x0 = (0.5) call _fnc_GRID_X; - private _y0 = (0.5) call _fnc_GRID_Y; + private _w0 = ((_origPos select 2) - (_boxesX + 1) * (0.5 call _fnc_GRID_X)) / _boxesX; + private _h0 = ((_origPos select 3) - (_boxesY + 1) * (0.5 call _fnc_GRID_Y)) / _boxesY; + private _x0 = 0.5 call _fnc_GRID_X; + private _y0 = 0.5 call _fnc_GRID_Y; private _ctrls = []; - for [{_i = 0}, {_i < _boxesY}, {_i = _i + 1}] do { - private _y = _y0 + (((0.5) call _fnc_GRID_Y) + _h0) * _i; - private _x = _x0; - - for [{_j = 0}, {_j < _boxesX}, {_j = _j + 1}] do { - _x = _x0 + (((0.5) call _fnc_GRID_X) + _w0) * _j; + for "_i" from 0 to _boxesY do { + private _y = _y0 + ((0.5 call _fnc_GRID_Y) + _h0) * _i; + + private "_x"; + for "_j" from 0 to _boxesX do { + _x = _x0 + ((0.5 call _fnc_GRID_X) + _w0) * _j; private _pos = [_x, _y, _w0, _h0]; private _ctrlBox = _display ctrlCreate ["RscControlsGroupNoScrollbars", -1, _ctrlGroupList]; @@ -181,7 +181,7 @@ switch _mode do { ]; _ctrlTextTitle setVariable ["bg", _ctrlTextBG]; - _ctrlTextTitle ctrlSetPosition [0, 0, _pos select 2, (ctrlTextHeight _ctrlTextTitle) min (_pos select 3)]; + _ctrlTextTitle ctrlSetPosition [0, 0, _pos select 2, ctrlTextHeight _ctrlTextTitle min (_pos select 3)]; _ctrlTextTitle ctrlEnable false; _ctrlTextTitle ctrlCommit 0; @@ -220,14 +220,14 @@ switch _mode do { private _ctrlSearchInfo = _display ctrlCreate ["RscStructuredText", -1, _ctrlGroupMain]; _ctrlSearchInfo ctrlSetPosition [ - ((0.5) call _fnc_GRID_X), - (_pos select 3) - ((1 + 3) call _fnc_GRID_Y), - ((_TABLE_WIDTH - 0.5*2) call _fnc_GRID_X), - ((3) call _fnc_GRID_Y) + (0.5 call _fnc_GRID_X), + (_pos select 3) - (1 + 3 call _fnc_GRID_Y), + (_TABLE_WIDTH - 0.5*2 call _fnc_GRID_X), + (3 call _fnc_GRID_Y) ]; _ctrlSearchInfo ctrlSetTextColor [0.95, 0.95, 0.95, 1]; _ctrlSearchInfo ctrlEnable false; - _ctrlSearchInfo ctrlSetFontHeight (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); + _ctrlSearchInfo ctrlSetFontHeight (((safezoneW / safezoneH min 1.2) / 1.2) / 25) * 1; _ctrlSearchInfo ctrlSetStructuredText parseText format ["%1 "+LSTRING(images_found)+"", 0]; _ctrlSearchInfo ctrlCommit 0; @@ -235,10 +235,10 @@ switch _mode do { private _ctrlSearchCheckbox = _display ctrlCreate ["ctrlCheckbox", 12001, _ctrlGroupMain]; _ctrlSearchCheckbox ctrlSetPosition [ - ((_TABLE_WIDTH / 2) call _fnc_GRID_X) - ((_TABLE_WIDTH / 4) call _fnc_GRID_X) - ((3 + 0.5) call _fnc_GRID_X), - (_pos select 3) - ((1 + 3) call _fnc_GRID_Y), - ((3) call _fnc_GRID_X), - ((3) call _fnc_GRID_Y) + (_TABLE_WIDTH / 2 call _fnc_GRID_X) - (_TABLE_WIDTH / 4 call _fnc_GRID_X) - (3 + 0.5 call _fnc_GRID_X), + (_pos select 3) - (1 + 3 call _fnc_GRID_Y), + (3 call _fnc_GRID_X), + (3 call _fnc_GRID_Y) ]; _ctrlSearchCheckbox ctrlAddEventHandler ["CheckedChanged", { private _checked = (_this select 1) isEqualTo 1; @@ -256,24 +256,24 @@ switch _mode do { private _ctrlSearch = _display ctrlCreate ["RscEdit", 12001, _ctrlGroupMain]; _ctrlSearch ctrlSetPosition [ - ((_TABLE_WIDTH / 2) call _fnc_GRID_X) - ((_TABLE_WIDTH / 4) call _fnc_GRID_X), - (_pos select 3) - ((1 + 3) call _fnc_GRID_Y), - ((_TABLE_WIDTH / 2) call _fnc_GRID_X), - ((3) call _fnc_GRID_Y) + (_TABLE_WIDTH / 2 call _fnc_GRID_X) - (_TABLE_WIDTH / 4 call _fnc_GRID_X), + (_pos select 3) - (1 + 3 call _fnc_GRID_Y), + (_TABLE_WIDTH / 2 call _fnc_GRID_X), + (3 call _fnc_GRID_Y) ]; _ctrlSearch ctrlSetFont "RobotoCondensed"; _ctrlSearch ctrlSetTextColor [0.95, 0.95, 0.95, 1]; _ctrlSearch ctrlSetText (localNamespace getVariable [QGVAR(icons_searchText), ""]); - _ctrlSearch ctrlSetFontHeight (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); + _ctrlSearch ctrlSetFontHeight (((safezoneW / safezoneH min 1.2) / 1.2) / 25) * 1; _ctrlSearch ctrlSetBackgroundColor [0, 0, 0, 0.7]; _ctrlSearch ctrlCommit 0; private _ctrlButtonSearch = _display ctrlCreate ["ctrlButtonPictureKeepAspect", 12001, _ctrlGroupMain]; _ctrlButtonSearch ctrlSetPosition [ - ((_TABLE_WIDTH / 2) call _fnc_GRID_X) - ((_TABLE_WIDTH / 4) call _fnc_GRID_X) + ((_TABLE_WIDTH / 2) call _fnc_GRID_X) + ((0.5) call _fnc_GRID_Y), - (_pos select 3) - ((4) call _fnc_GRID_Y), - ((3) call _fnc_GRID_X), - ((3) call _fnc_GRID_Y) + (_TABLE_WIDTH / 2 call _fnc_GRID_X) - (_TABLE_WIDTH / 4 call _fnc_GRID_X) + (_TABLE_WIDTH / 2 call _fnc_GRID_X) + (0.5 call _fnc_GRID_Y), + (_pos select 3) - (4 call _fnc_GRID_Y), + (3 call _fnc_GRID_X), + (3 call _fnc_GRID_Y) ]; _ctrlButtonSearch ctrlSetText "\a3\3DEN\Data\Displays\Display3DEN\search_start_ca.paa"; _ctrlButtonSearch ctrlSetBackgroundColor [0, 0, 0, 0]; @@ -299,13 +299,13 @@ switch _mode do { private _ctrlPageInfo = _display ctrlCreate ["RscStructuredText", -1, _ctrlGroupMain]; _ctrlPageInfo ctrlSetPosition [ - (1 + 3 + 0.5) call _fnc_GRID_X, - (_pos select 3) - ((1 + 3) call _fnc_GRID_Y), - ((10) call _fnc_GRID_X), - ((5) call _fnc_GRID_Y) + 1 + 3 + 0.5 call _fnc_GRID_X, + (_pos select 3) - (1 + 3 call _fnc_GRID_Y), + (10 call _fnc_GRID_X), + (5 call _fnc_GRID_Y) ]; _ctrlPageInfo ctrlSetTextColor [0.95, 0.95, 0.95, 1]; - _ctrlPageInfo ctrlSetFontHeight (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); + _ctrlPageInfo ctrlSetFontHeight (((safezoneW / safezoneH min 1.2) / 1.2) / 25) * 1; _ctrlPageInfo ctrlSetStructuredText parseText format ["1 | %2", 99, 99]; _ctrlPageInfo ctrlEnable false; _ctrlPageInfo ctrlCommit 0; @@ -314,32 +314,32 @@ switch _mode do { private _ctrlButtonL = _display ctrlCreate ["ctrlButton", -1, _ctrlGroupMain]; _ctrlButtonL ctrlSetPosition [ - (1) call _fnc_GRID_X, - (_pos select 3) - ((1 + 3) call _fnc_GRID_Y), - ((3) call _fnc_GRID_X), - ((3) call _fnc_GRID_Y) + 1 call _fnc_GRID_X, + (_pos select 3) - (1 + 3 call _fnc_GRID_Y), + (3 call _fnc_GRID_X), + (3 call _fnc_GRID_Y) ]; _ctrlButtonL ctrlSetFont "PuristaMedium"; _ctrlButtonL ctrlSetText "<"; _ctrlButtonL ctrlSetTooltip LSTRING(previous_page); _ctrlButtonL ctrlSetBackgroundColor [1, 1, 1, 0.15]; - _ctrlButtonL ctrlSetFontHeight (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); + _ctrlButtonL ctrlSetFontHeight (((safezoneW / safezoneH min 1.2) / 1.2) / 25) * 1; _ctrlButtonL ctrlSetTextColor [0.95, 0.95, 0.95, 1]; _ctrlButtonL ctrlAddEventHandler ["ButtonClick", {["changePage", [-1]] call FUNC(main_iconViewer);}]; _ctrlButtonL ctrlCommit 0; private _ctrlButtonR = _display ctrlCreate ["ctrlButton", -1, _ctrlGroupMain]; _ctrlButtonR ctrlSetPosition [ - (1 + 3 + 0.5 + 10 + 0.5) call _fnc_GRID_X, - (_pos select 3) - ((1 + 3) call _fnc_GRID_Y), - ((3) call _fnc_GRID_X), - ((3) call _fnc_GRID_Y) + 1 + 3 + 0.5 + 10 + 0.5 call _fnc_GRID_X, + (_pos select 3) - (1 + 3 call _fnc_GRID_Y), + (3 call _fnc_GRID_X), + (3 call _fnc_GRID_Y) ]; _ctrlButtonR ctrlSetFont "PuristaMedium"; _ctrlButtonR ctrlSetText ">"; _ctrlButtonR ctrlSetTooltip LSTRING(next_page); _ctrlButtonR ctrlSetBackgroundColor [1, 1, 1, 0.15]; - _ctrlButtonR ctrlSetFontHeight (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); + _ctrlButtonR ctrlSetFontHeight (((safezoneW / safezoneH min 1.2) / 1.2) / 25) * 1; _ctrlButtonR ctrlSetTextColor [0.95, 0.95, 0.95, 1]; _ctrlButtonR ctrlAddEventHandler ["ButtonClick", {["changePage", [1]] call FUNC(main_iconViewer);}]; _ctrlButtonR ctrlCommit 0; @@ -351,11 +351,11 @@ switch _mode do { if (_searchText != "") then { if (localNamespace getVariable [QGVAR(icons_caseSensitive), true]) then { - _items = _items select {(_x find _searchText) > -1}; + _items = _items select {_x find _searchText > -1}; } else { _searchText = toLowerANSI _searchText; - _items = _items select {(toLowerANSI _x find _searchText) > -1}; + _items = _items select {toLowerANSI _x find _searchText > -1}; }; }; @@ -404,7 +404,7 @@ switch _mode do { private _maxPages = ceil (count _items / _iconsPerPage); private _n = count _items; - for [{_i = 0}, {_i < _iconsPerPage}, {_i = _i + 1}] do { + for "_i" from 0 to _iconsPerPage do { private _ctrlBox = _ctrls select _i; private _idx = _page * _iconsPerPage + _i; diff --git a/framework/components/3den/functions/fn_main_setConfig.sqf b/framework/components/3den/functions/fn_main_setConfig.sqf index 54bef32..6298947 100644 --- a/framework/components/3den/functions/fn_main_setConfig.sqf +++ b/framework/components/3den/functions/fn_main_setConfig.sqf @@ -15,13 +15,12 @@ * Public: No */ -params ["_cmfMenu"]; +// params ["_cmfMenu"]; /* Handle player attempting to delete logic */ { if ((_x get3DENAttribute 'Name') isEqualTo ['cmf_3den_missionDataLogic_old']) then { _x addEventHandler ['UnregisteredFromWorld3DEN', { - params ['_entity']; ['Deleted CMF Mission Data', 1, 1] call BIS_fnc_3DENNotification; }]; }; @@ -41,7 +40,6 @@ FUNC(setConfig_missionDataHandler) = { GVAR(missionDataLogic_old) = _logic; _logic addEventHandler ['UnregisteredFromWorld3DEN', { - params ['_entity']; ['Deleted CMF Mission Data', 1, 1] call BIS_fnc_3DENNotification; }]; @@ -83,7 +81,7 @@ FUNC(setConfig_missionDataHandler) = { _hash pushBack ["M_TITLE", ctrlText (_display displayCtrl 100)]; /* Mission Type */ - _hash pushBack ["M_TYPE", [lbCurSel (_display displayCtrl 101), (_display displayCtrl 101) lbData (lbCurSel (_display displayCtrl 101))]]; + _hash pushBack ["M_TYPE", [lbCurSel (_display displayCtrl 101), (_display displayCtrl 101) lbData lbCurSel (_display displayCtrl 101)]]; _hash pushBack ["M_CTYPE", ctrlText (_display displayCtrl 102)]; /* Equipment Map */ @@ -120,12 +118,12 @@ FUNC(setConfig_missionDataHandler) = { "components\3den\data\icon_gametype_csar_ca.paa", "components\3den\data\icon_gametype_qrf_ca.paa" ]; - private _picture = if ((lbCurSel (_display displayCtrl 101)) > count _pictures - 1) then { + private _picture = if (lbCurSel (_display displayCtrl 101) > count _pictures - 1) then { "components\3den\data\icon_gametype_empty_ca.paa" } else { - _pictures select (lbCurSel (_display displayCtrl 101)) + _pictures select lbCurSel (_display displayCtrl 101) }; - private _gameType = [([_hash, "M_TYPE"] call CBA_fnc_hashGet) select 1, [_hash, "M_CTYPE"] call CBA_fnc_hashGet] select ((([_hash, "M_TYPE"] call CBA_fnc_hashGet) select 1) isEqualTo "custom"); + // private _gameType = [([_hash, "M_TYPE"] call CBA_fnc_hashGet) select 1, [_hash, "M_CTYPE"] call CBA_fnc_hashGet] select ((([_hash, "M_TYPE"] call CBA_fnc_hashGet) select 1) isEqualTo "custom"); private _author = profileName; private _gameName = [_hash, "M_TITLE"] call CBA_fnc_hashGet; diff --git a/framework/components/3den/functions/fn_removeFromInit.sqf b/framework/components/3den/functions/fn_removeFromInit.sqf index 886ae83..ea9e5d8 100644 --- a/framework/components/3den/functions/fn_removeFromInit.sqf +++ b/framework/components/3den/functions/fn_removeFromInit.sqf @@ -25,12 +25,12 @@ if (_index isEqualTo -1) exitWith { false }; private _p1 = _init select [0, _index]; private _deleteRange = count _line + _index; -if ((_init select [(count _line) + _index, 1]) isEqualTo ";") then { +if (_init select [count _line + _index, 1] isEqualTo ";") then { _deleteRange = count _line + 1 + _index; }; private _p2 = _init select [_deleteRange, count _init]; -_init = (_p1 + _p2) splitString toString [13, 10]; +_init = _p1 + _p2 splitString toString [13, 10]; _init = _init select { _x != " " && { _x != "" } }; _init = _init joinString toString [13, 10]; diff --git a/framework/components/3den/functions/fn_unitConstructor.sqf b/framework/components/3den/functions/fn_unitConstructor.sqf index d165bd6..0206aeb 100644 --- a/framework/components/3den/functions/fn_unitConstructor.sqf +++ b/framework/components/3den/functions/fn_unitConstructor.sqf @@ -39,8 +39,8 @@ private _fnc_customUnitControl = { }; private _unitArr = []; -switch (_unitID) do { - case ("COMPANY"): { +switch _unitID do { + case "COMPANY": { _unitArr = [ [ // COY HQ 3, "INF", 0, [ @@ -211,7 +211,7 @@ switch (_unitID) do { ]; }; - case ("PLATOON"): { + case "PLATOON": { _unitArr = [ [ // PLT HQ 2, "INF", 0, [ @@ -295,7 +295,7 @@ switch (_unitID) do { ]; }; - case ("SQUAD"): { + case "SQUAD": { _unitArr = [ [ // Squadleader 1, "INF", 0, [ @@ -324,7 +324,7 @@ switch (_unitID) do { ]; }; - case ("FIRETEAM"): { + case "FIRETEAM": { _unitArr = [ [ 0, "INF", -1, [ @@ -338,11 +338,11 @@ switch (_unitID) do { ]; }; - case ("UNIT"): { + case "UNIT": { GVAR(unitConstructor_customMenuReturn) = []; [] spawn _fnc_customUnitControl; - waitUntil {(count GVAR(unitConstructor_customMenuReturn)) > 0}; + waitUntil {count GVAR(unitConstructor_customMenuReturn) > 0}; GVAR(unitConstructor_customMenuReturn) params ["_role", "_prettyRole", "_rank", "_level", "_type"]; _unitArr = [[ @@ -354,7 +354,7 @@ switch (_unitID) do { GVAR(unitConstructor_customMenuReturn) = []; }; - case ("ZEUS"): { + case "ZEUS": { _unitArr = [ [ 0, "ZEUS", 0, [ @@ -364,7 +364,7 @@ switch (_unitID) do { ]; }; - case ("PHANTOM"): { + case "PHANTOM": { _unitArr = [ [ 3, "TRANS", 0, [ @@ -375,7 +375,7 @@ switch (_unitID) do { ]; }; - case ("REAPER"): { + case "REAPER": { _unitArr = [ [ 3, "LCAS", 0, [ @@ -386,7 +386,7 @@ switch (_unitID) do { ]; }; - case ("UGLY"): { + case "UGLY": { _unitArr = [ [ 3, "HCAS", 0, [ @@ -397,7 +397,7 @@ switch (_unitID) do { ]; }; - case ("HAWG"): { + case "HAWG": { _unitArr = [ [ 3, "FWCAS", 0, [ @@ -407,7 +407,7 @@ switch (_unitID) do { ]; }; - case ("PAVEMENT"): { + case "PAVEMENT": { _unitArr = [ [ 3, "BOMBER", 0, [ @@ -417,7 +417,7 @@ switch (_unitID) do { ]; }; - case ("SIERRA"): { + case "SIERRA": { _unitArr = [ [ 2, "APC", 0, [ @@ -429,7 +429,7 @@ switch (_unitID) do { ]; }; - case ("MIKE"): { + case "MIKE": { _unitArr = [ [ 2, "IFV", 0, [ @@ -441,7 +441,7 @@ switch (_unitID) do { ]; }; - case ("TANGO"): { + case "TANGO": { _unitArr = [ [ 2, "MBT", 0, [ @@ -453,7 +453,7 @@ switch (_unitID) do { ]; }; - case ("ANVIL"): { + case "ANVIL": { _unitArr = [ [ 2, "SPAAG", 0, [ @@ -465,7 +465,7 @@ switch (_unitID) do { ]; }; - case ("MORTARS"): { + case "MORTARS": { _unitArr = [ [ 1, "MORTAR", 0, [ @@ -476,7 +476,7 @@ switch (_unitID) do { ]; }; - case ("ROMEO"): { + case "ROMEO": { _unitArr = [ [ 1, "RECON", 0, [ @@ -487,7 +487,7 @@ switch (_unitID) do { ]; }; - case ("ENGI"): { + case "ENGI": { _unitArr = [ [ 1, "ENGI", 0, [ @@ -498,7 +498,7 @@ switch (_unitID) do { ]; }; - case ("LOGI"): { + case "LOGI": { _unitArr = [ [ 1, "LOGI", 0, [ @@ -509,7 +509,7 @@ switch (_unitID) do { ]; }; - case ("MMG"): { + case "MMG": { _unitArr = [ [ 1, "MMG", 0, [ @@ -521,7 +521,7 @@ switch (_unitID) do { ]; }; - case ("HMG"): { + case "HMG": { _unitArr = [ [ 1, "HMG", 0, [ @@ -533,7 +533,7 @@ switch (_unitID) do { ]; }; - case ("MAT"): { + case "MAT": { _unitArr = [ [ 1, "MAT", 0, [ @@ -545,7 +545,7 @@ switch (_unitID) do { ]; }; - case ("HAT"): { + case "HAT": { _unitArr = [ [ 1, "HAT", 0, [ @@ -557,7 +557,7 @@ switch (_unitID) do { ]; }; - case ("DHAT"): { + case "DHAT": { _unitArr = [ [ 1, "DHAT", 0, [ @@ -569,7 +569,7 @@ switch (_unitID) do { ]; }; - case ("RGR_RFL_SQUAD"): { + case "RGR_RFL_SQUAD": { _unitArr = [ [ // Squadleader 1, "RECON", 0, [ @@ -598,7 +598,7 @@ switch (_unitID) do { ]; }; - case ("RGR_MG_SQUAD"): { + case "RGR_MG_SQUAD": { _unitArr = [ [ // Squadleader 1, "RECON", 0, [ diff --git a/framework/components/aar/functions/fn_endMission.sqf b/framework/components/aar/functions/fn_endMission.sqf index 7935da3..d6cc6b7 100644 --- a/framework/components/aar/functions/fn_endMission.sqf +++ b/framework/components/aar/functions/fn_endMission.sqf @@ -33,9 +33,9 @@ EFUNC(inline_aar,endMission) = { private _missionData = missionNameSpace getVariable [QEGVAR(common,missionData), []]; private _hash = [_missionData] call CBA_fnc_hashCreate; private _operationName = [_hash, "M_TITLE", [getMissionConfigValue ['IntelBriefingName', briefingName]] call EFUNC(common,hexToASCII)] call CBA_fnc_hashGet; - private _op = format ["%1 was an operational %2", _operationName, (["Success", "Failure"] select !(_opSuccess)), (["fcba03", "fc3d03"] select !(_opSuccess))]; - private _tac = format ["%1 was a tactical %2", _operationName, (["Success", "Failure"] select !(_tacSuccess))]; - private _message = _message splitString toString [13,10] joinString "
"; + private _op = format ["%1 was an operational %2", _operationName, (["Success", "Failure"] select !_opSuccess), (["fcba03", "fc3d03"] select !_opSuccess)]; + private _tac = format ["%1 was a tactical %2", _operationName, (["Success", "Failure"] select !_tacSuccess)]; + private _message = _message splitString toString [13, 10] joinString "
"; if (_message != "") then { _message = format ["
%1", _message]; }; private _objectives = _objectivesState splitString toString [13,10] joinString "
"; if (_objectives != "") then { _objectives = format ["
%1", _objectives]; }; @@ -112,7 +112,7 @@ EFUNC(inline_aar,endMission) = { /* Open dialog for reading */ waitUntil { count (missionNameSpace getVariable [QGVAR(AAR_playerReports), []]) != 0 }; - private _display = (findDisplay 60000) createDisplay QGVAR(aarReadingDisplay); + private _display = findDisplay 60000 createDisplay QGVAR(aarReadingDisplay); uiNamespace setVariable [QGVAR(aarIndex), 0]; /* Set first AAR entry */ @@ -126,9 +126,9 @@ EFUNC(inline_aar,endMission) = { _display spawn { private _curValue = (count (missionNameSpace getVariable [QGVAR(AAR_playerReports), []])); while { !isNull _this } do { - waitUntil { (count (missionNameSpace getVariable [QGVAR(AAR_playerReports), []])) != _curValue }; + waitUntil { count (missionNameSpace getVariable [QGVAR(AAR_playerReports), []]) != _curValue }; private _curValue = (count (missionNameSpace getVariable [QGVAR(AAR_playerReports), []])); - ((ctrlParent _ctrl) displayCtrl 300) ctrlSetText format ["AAR Feedback (%1/%2)", (uiNamespace getVariable [QGVAR(aarIndex), 0]) + 1, _curValue]; + (ctrlParent _ctrl displayCtrl 300) ctrlSetText format ["AAR Feedback (%1/%2)", (uiNamespace getVariable [QGVAR(aarIndex), 0]) + 1, _curValue]; }; }; @@ -137,11 +137,11 @@ EFUNC(inline_aar,endMission) = { params ["_ctrl"]; private _index = uiNamespace getVariable [QGVAR(aarIndex), 0]; - private _currentAAR = ( missionNameSpace getVariable [QGVAR(AAR_playerReports), []]) select (0 max (_index - 1)); - ((ctrlParent _ctrl) displayCtrl 100) ctrlSetText (_currentAAR select 0); - ((ctrlParent _ctrl) displayCtrl 101) ctrlSetText (_currentAAR select 1); - ((ctrlParent _ctrl) displayCtrl 102) ctrlSetText (_currentAAR select 2); - ((ctrlParent _ctrl) displayCtrl 300) ctrlSetText format ["AAR Feedback (%1/%2)", (0 max (_index + 1)), (count (missionNameSpace getVariable [QGVAR(AAR_playerReports), []]))]; + private _currentAAR = ( missionNameSpace getVariable [QGVAR(AAR_playerReports), []]) select 0 max (_index - 1); + (ctrlParent _ctrl displayCtrl 100) ctrlSetText (_currentAAR select 0); + (ctrlParent _ctrl displayCtrl 101) ctrlSetText (_currentAAR select 1); + (ctrlParent _ctrl displayCtrl 102) ctrlSetText (_currentAAR select 2); + (ctrlParent _ctrl displayCtrl 300) ctrlSetText format ["AAR Feedback (%1/%2)", (0 max (_index + 1)), (count (missionNameSpace getVariable [QGVAR(AAR_playerReports), []]))]; uiNamespace setVariable [QGVAR(aarIndex), (0 max (_index - 1))]; }]; @@ -151,16 +151,16 @@ EFUNC(inline_aar,endMission) = { params ["_ctrl"]; private _index = uiNamespace getVariable [QGVAR(aarIndex), 0]; - private _currentAAR = ( missionNameSpace getVariable [QGVAR(AAR_playerReports), []]) select ((count (missionNameSpace getVariable [QGVAR(AAR_playerReports), []])) min (_index + 1)); - ((ctrlParent _ctrl) displayCtrl 100) ctrlSetText (_currentAAR select 0); - ((ctrlParent _ctrl) displayCtrl 101) ctrlSetText (_currentAAR select 1); - ((ctrlParent _ctrl) displayCtrl 102) ctrlSetText (_currentAAR select 2); - ((ctrlParent _ctrl) displayCtrl 300) ctrlSetText format ["AAR Feedback (%1/%2)", - ((count (missionNameSpace getVariable [QGVAR(AAR_playerReports), []])) min (_index + 2)), + private _currentAAR = ( missionNameSpace getVariable [QGVAR(AAR_playerReports), []]) select count (missionNameSpace getVariable [QGVAR(AAR_playerReports), []]) min (_index + 1); + (ctrlParent _ctrl displayCtrl 100) ctrlSetText (_currentAAR select 0); + (ctrlParent _ctrl displayCtrl 101) ctrlSetText (_currentAAR select 1); + (ctrlParent _ctrl displayCtrl 102) ctrlSetText (_currentAAR select 2); + (ctrlParent _ctrl displayCtrl 300) ctrlSetText format ["AAR Feedback (%1/%2)", + (count (missionNameSpace getVariable [QGVAR(AAR_playerReports), []]) min (_index + 2)), (count (missionNameSpace getVariable [QGVAR(AAR_playerReports), []])) ]; - uiNamespace setVariable [QGVAR(aarIndex), ((count (missionNameSpace getVariable [QGVAR(AAR_playerReports), []])) min (_index + 1))]; + uiNamespace setVariable [QGVAR(aarIndex), (count (missionNameSpace getVariable [QGVAR(AAR_playerReports), []]) min (_index + 1))]; }]; }] remoteExec ["spawn", 0, true]; @@ -179,7 +179,7 @@ EFUNC(inline_aar,endMission) = { private _EHIndex = addMissionEventHandler ["EntityCreated", { params ["_entity"]; - if ((typeof _entity) isEqualTo "ModuleEndMission_F" && local _entity) then { + if (typeof _entity isEqualTo "ModuleEndMission_F" && local _entity) then { deleteVehicle _entity; [] spawn EFUNC(inline_aar,endMission); }; diff --git a/framework/components/aar/functions/fn_playback.sqf b/framework/components/aar/functions/fn_playback.sqf index f22a1e0..5e48cd9 100644 --- a/framework/components/aar/functions/fn_playback.sqf +++ b/framework/components/aar/functions/fn_playback.sqf @@ -31,7 +31,7 @@ _this spawn { private _markers = _data select 4; /* Get length of recording */ - private _timeSpan = [0, ((_objects select (count _objects - 1)) select 0) - (_data select 2)]; + private _timeSpan = [0, ((_objects select count _objects - 1) select 0) - (_data select 2)]; /* Loop through data */ while { true } do { diff --git a/framework/components/aar/functions/fn_record.sqf b/framework/components/aar/functions/fn_record.sqf index d4dee37..47100fd 100644 --- a/framework/components/aar/functions/fn_record.sqf +++ b/framework/components/aar/functions/fn_record.sqf @@ -67,7 +67,7 @@ _this spawn { _objects pushBack [_x, typeof _x, side _x, lifeState _x, getPosASL _x, getDir _x, crew _x, _fireData]; _x setVariable [QGVAR(fire_data), [], true]; - } forEach (allUnits + allDead); + } forEach allUnits + allDead; private _objectArray = [_time, _objects]; /* get marker data */ diff --git a/framework/components/aar/functions/fn_stats.sqf b/framework/components/aar/functions/fn_stats.sqf index 63dedbb..ebb8aeb 100644 --- a/framework/components/aar/functions/fn_stats.sqf +++ b/framework/components/aar/functions/fn_stats.sqf @@ -16,7 +16,7 @@ */ SCRIPT(stats); -if (isServer) then { +if isServer then { addMissionEventHandler ["EntityKilled", { /* Track deaths */ if (isPlayer (_this select 0)) then { @@ -29,13 +29,13 @@ if (isServer) then { /* Track kills */ if (isPlayer (_this select 1) && (_this select 0) isKindOf "Man") then { - switch (true) do { - case (([side (_this select 1), side group (_this select 0)] call BIS_fnc_sideIsEnemy) && (side group (_this select 0) != civilian)): { + switch true do { + case ([side (_this select 1), side group (_this select 0)] call BIS_fnc_sideIsEnemy && { side group (_this select 0) != civilian }): { private _kills = (_this select 1) getVariable [QGVAR(stats_E_kills), 0]; (_this select 1) setVariable [QGVAR(stats_E_kills), _kills + 1, true]; }; - case (([side (_this select 1), side group (_this select 0)] call BIS_fnc_sideIsFriendly) && (side group (_this select 0) != civilian)): { + case ([side (_this select 1), side group (_this select 0)] call BIS_fnc_sideIsFriendly && { side group (_this select 0) != civilian }): { private _kills = (_this select 1) getVariable [QGVAR(stats_F_kills), 0]; (_this select 1) setVariable [QGVAR(stats_F_kills), _kills + 1, true]; }; diff --git a/framework/components/ai/functions/fn_artillery.sqf b/framework/components/ai/functions/fn_artillery.sqf index 2447108..5ce87d2 100644 --- a/framework/components/ai/functions/fn_artillery.sqf +++ b/framework/components/ai/functions/fn_artillery.sqf @@ -25,7 +25,7 @@ private _fnc_register = { /* Check if the vehicle is a artillery vehicle */ private _isArtillery = [GVAR(artilleryHash), typeof _vehicle] call CBA_fnc_hashGet; if (isNil "_isArtillery") then { - _isArtillery = (getNumber (configOf _vehicle >> "artilleryScanner")) > 0; + _isArtillery = getNumber (configOf _vehicle >> "artilleryScanner") > 0; GVAR(artilleryHash) = [GVAR(artilleryHash), typeof _vehicle, _isArtillery] call CBA_fnc_hashSet; }; if (!_isArtillery) exitWith { }; @@ -40,14 +40,14 @@ private _fnc_register = { ["lambs_danger_OnInformationShared", { params ["", "_shareGroup", "_target"]; - if (!SETTING(reinforceArtillery) || (getPos _target) isEqualTo []) exitWith { }; + if (!SETTING(reinforceArtillery) || getPos _target isEqualTo []) exitWith { }; /* Check if automatic artillery is allowed for side */ private _allowedSides = call compile format ["[%1]", SETTING(reinforceArtillerySides)]; - if !((side _shareGroup) in _allowedSides) exitWith {}; + if !(side _shareGroup in _allowedSides) exitWith {}; /* Don't do danger close */ - if ( (leader _shareGroup) distance _target < 100 ) exitWith { }; + if ( leader _shareGroup distance _target < 100 ) exitWith { }; /* Timeout between fire missions */ private _timeout = [GVAR(artilleryTimeOut), side _shareGroup, 0] call CBA_fnc_hashGet; @@ -59,7 +59,7 @@ private _fnc_register = { GVAR(artilleryTargets) pushBack [side _shareGroup, _target, _mainSalvo]; - [{ time < ([GVAR(artilleryTimeOut), side (_this select 0), 0] call CBA_fnc_hashGet) }, { + [{ time < [GVAR(artilleryTimeOut), side (_this select 0), 0] call CBA_fnc_hashGet }, { GVAR(artilleryTargets) deleteAt (GVAR(artilleryTargets) find (_this select 1)); }, [_shareGroup, [side _shareGroup, _target, _mainSalvo]]] call CBA_fnc_waitUntilAndExecute; diff --git a/framework/components/ai/functions/fn_hostage.sqf b/framework/components/ai/functions/fn_hostage.sqf index 05addaf..62254c5 100644 --- a/framework/components/ai/functions/fn_hostage.sqf +++ b/framework/components/ai/functions/fn_hostage.sqf @@ -56,7 +56,7 @@ GVAR(hostage_followPlayerFNC) = { [_hostage getVariable QGVAR(hostage_handler)] call CBA_fnc_removePerFrameHandler; }; - if ((vehicle _target) isEqualTo _target) then { + if (vehicle _target isEqualTo _target) then { if (vehicle _hostage != _hostage) then { unassignVehicle _hostage; }; @@ -65,7 +65,7 @@ GVAR(hostage_followPlayerFNC) = { _hostage setUnitPos ([stance _target] call GVAR(hostage_translateStance)); } else { if (vehicle _hostage != _hostage) exitWith { - _hostage moveInCargo [vehicle _target, (vehicle _target) getCargoIndex _hostage]; + _hostage moveInCargo [vehicle _target, vehicle _target getCargoIndex _hostage]; }; private _getSeat = [vehicle _target] call ace_captives_fnc_findEmptyNonFFVCargoSeat; @@ -80,7 +80,7 @@ GVAR(hostage_followPlayerFNC) = { _hostage setVariable [QGVAR(hostage_handler), _handle, true]; }; -if (_captive) then { +if _captive then { [_unit, true] call ACE_captives_fnc_setHandcuffed; }; diff --git a/framework/components/ai/functions/fn_panic.sqf b/framework/components/ai/functions/fn_panic.sqf index b308291..b848839 100644 --- a/framework/components/ai/functions/fn_panic.sqf +++ b/framework/components/ai/functions/fn_panic.sqf @@ -35,7 +35,7 @@ /* 50% Chance of group retreating when paniced */ if (SETTING(panicRetreatChance) > random 1) then { LOG_1("%1 is Retreating", _unit); - private _attackDir = _unit getDir (getAttackTarget _unit); + private _attackDir = _unit getDir getAttackTarget _unit; private _retreatDir = (_attackDir + 180) % 360; private _retreatPos = _unit getPos [_retreatDir, random 500]; diff --git a/framework/components/ai/functions/fn_preventProne.sqf b/framework/components/ai/functions/fn_preventProne.sqf index 14d6b93..6c48e3f 100644 --- a/framework/components/ai/functions/fn_preventProne.sqf +++ b/framework/components/ai/functions/fn_preventProne.sqf @@ -31,7 +31,7 @@ SCRIPT(preventProne); params ["_unit", "_anim"]; /* Check if animation is a state change animation to prone */ - if ((_anim in _proneAnimArray) || (unitPos _unit isEqualTo "down")) then { + if (_anim in _proneAnimArray || unitPos _unit isEqualTo "down") then { _unit setunitPos "middle" }; }]; diff --git a/framework/components/ai/functions/fn_reinforce.sqf b/framework/components/ai/functions/fn_reinforce.sqf index d3845b1..9cfc29e 100644 --- a/framework/components/ai/functions/fn_reinforce.sqf +++ b/framework/components/ai/functions/fn_reinforce.sqf @@ -39,9 +39,9 @@ if (!isServer) exitWith {}; params ["", "_shareGroup", "_target"]; if (_reinforceGroup getVariable [QGVAR(reinforce_disableGroup), false]) exitWith {}; - if ((group _target) getVariable [QGVAR(reinforce_disableTarget), false]) exitWith {}; + if (group _target getVariable [QGVAR(reinforce_disableTarget), false]) exitWith {}; - if ( (leader _reinforceGroup distance leader _shareGroup) < SETTING(reinforceRange) && _reinforceGroup != _shareGroup && !(_reinforceGroup getVariable [QGVAR(reinforce_targetGroup), grpNull] isEqualTo _shareGroup) && side _reinforceGroup isEqualTo side _shareGroup ) then { + if ( leader _reinforceGroup distance leader _shareGroup < SETTING(reinforceRange) && _reinforceGroup != _shareGroup && !(_reinforceGroup getVariable [QGVAR(reinforce_targetGroup), grpNull] isEqualTo _shareGroup) && side _reinforceGroup isEqualTo side _shareGroup ) then { LOG_2("%1 reinforcing %2(TaskRush)", groupId _reinforceGroup, groupId _shareGroup); [_reinforceGroup, 200, 15, [], getPos _target, false] spawn lambs_wp_fnc_taskRush; diff --git a/framework/components/common/XEH_3denInit.sqf b/framework/components/common/XEH_3denInit.sqf index 6f1a2a0..af46542 100644 --- a/framework/components/common/XEH_3denInit.sqf +++ b/framework/components/common/XEH_3denInit.sqf @@ -34,7 +34,7 @@ private _acreRadioRackAction = [ private _display = ctrlParent _ctrl; private _vehicles = get3DENSelected "object"; private _comboCtrl = _display displayCtrl 100; - private _radio = call compile (_comboCtrl lbData (lbCurSel _comboCtrl)); + private _radio = call compile (_comboCtrl lbData lbCurSel _comboCtrl); if (isNil "_radio") exitWith { ["You need to select a radio", 1, 1] call BIS_fnc_3DENNotification; @@ -65,7 +65,7 @@ private _simulationAction = [ }; private _selections = get3DENSelected "object"; - private _first = (_selections) select 0; + private _first = _selections select 0; private _toggle = (simulationEnabled _first); { @@ -134,12 +134,12 @@ private _carryAction = [ private _disableCommand = "[this, fales] call ace_dragging_fnc_setCarryable"; private _selections = get3DENSelected "object"; - private _first = (_selections) select 0; + private _first = _selections select 0; private _isSet = ([_first, _enableCommand] call EFUNC(3den,inInit) || [_first, _disableCommand] call EFUNC(3den,inInit)); private _toggle = ([_first, _enableCommand] call EFUNC(3den,inInit) || !_isSet); { - if (_toggle) then { + if _toggle then { if ([_x, _disableCommand] call EFUNC(3den,inInit)) then { [_x, _disableCommand] call EFUNC(3den,removeFromInit); }; @@ -171,12 +171,12 @@ private _dragAction = [ private _disableCommand = "[this, fales] call ace_dragging_fnc_setDraggable"; private _selections = get3DENSelected "object"; - private _first = (_selections) select 0; + private _first = _selections select 0; private _isSet = ([_first, _enableCommand] call EFUNC(3den,inInit) || [_first, _disableCommand] call EFUNC(3den,inInit)); private _toggle = ([_first, _enableCommand] call EFUNC(3den,inInit) || !_isSet); { - if (_toggle) then { + if _toggle then { if ([_x, _disableCommand] call EFUNC(3den,inInit)) then { [_x, _disableCommand] call EFUNC(3den,removeFromInit); }; diff --git a/framework/components/common/XEH_postInit.sqf b/framework/components/common/XEH_postInit.sqf index 61ca95f..6f208af 100644 --- a/framework/components/common/XEH_postInit.sqf +++ b/framework/components/common/XEH_postInit.sqf @@ -23,11 +23,12 @@ cmf_player removeDiarySubject "Statistics"; cmf_player removeDiarySubject "Units"; /* Create sub category for radios */ -[(call acre_api_fnc_getAllRadios) select 0, "Radios", "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\call_ca.paa", 1] call ace_arsenal_fnc_addRightPanelButton; +[call acre_api_fnc_getAllRadios select 0, "Radios", "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\call_ca.paa", 1] call ace_arsenal_fnc_addRightPanelButton; /* Remove KP ranks ace interactions */ [{ - if (isNil { ([(ace_interact_menu_ActSelfNamespace getVariable (typeOf player)), ["ACE_SelfActions","KPR_Admin"]] call ace_interact_menu_fnc_findActionNode) }) exitWith {}; + playerClass = typeOf player; + if (isNil { ([(ace_interact_menu_ActSelfNamespace getVariable playerClass), ["ACE_SelfActions","KPR_Admin"]] call ace_interact_menu_fnc_findActionNode) }) exitWith {}; [(typeOf player), 1, ["ACE_SelfActions", "KPR_Admin"]] call ace_interact_menu_fnc_removeActionFromClass; [(typeOf player), 1, ["ACE_SelfActions", "ACE_Equipment", "KPR_Check"]] call ace_interact_menu_fnc_removeActionFromClass; @@ -76,7 +77,7 @@ cmf_player addEventHandler ["Killed", { /* Player respawn event */ cmf_player addEventHandler ["Respawn", { - params ["_unit", "_corpse"]; + params ["_unit", ""]; /* Load loadout */ if (!isNil { cmf_player getVariable [QGVAR(player_loadout), nil] }) then { diff --git a/framework/components/common/functions/fn_acreRestore.sqf b/framework/components/common/functions/fn_acreRestore.sqf index 3322588..789ce37 100644 --- a/framework/components/common/functions/fn_acreRestore.sqf +++ b/framework/components/common/functions/fn_acreRestore.sqf @@ -19,8 +19,8 @@ params ["_newUnit", "_oldUnit"]; if (isNull _oldUnit) exitWith { }; private _oldPTT = cmf_player getVariable [QGVAR(ACREPTT), call acre_api_fnc_getMultiPushToTalkAssignment]; -private _oldRadios = ([_oldUnit] call acre_sys_core_fnc_getGear) select { ([_x] call acre_api_fnc_getBaseRadio) != "" }; -private _newRadios = ([_newUnit] call acre_sys_core_fnc_getGear) select { ([_x] call acre_api_fnc_getBaseRadio) != "" }; +private _oldRadios = ([_oldUnit] call acre_sys_core_fnc_getGear) select { [_x] call acre_api_fnc_getBaseRadio != "" }; +private _newRadios = ([_newUnit] call acre_sys_core_fnc_getGear) select { [_x] call acre_api_fnc_getBaseRadio != "" }; /* If old unit had no radios exit this script */ if (count _oldRadios isEqualTo 0) exitWith { }; diff --git a/framework/components/common/functions/fn_chatHandler.sqf b/framework/components/common/functions/fn_chatHandler.sqf index 1def127..ffed48c 100644 --- a/framework/components/common/functions/fn_chatHandler.sqf +++ b/framework/components/common/functions/fn_chatHandler.sqf @@ -16,7 +16,7 @@ */ /* Own join message */ -if (hasInterface) then { +if hasInterface then { [{ !isNull player }, { @@ -24,20 +24,20 @@ if (hasInterface) then { private _roleDescription = "Unknown"; if (roleDescription player != "") then { - _roleDescription = ((roleDescription player) splitString "@") select 0; + _roleDescription = (roleDescription player splitString "@") select 0; }; private _disconUnits = missionNameSpace getVariable [QEGVAR(respawn,disconUnits), createHashMap]; - private _disconUnit = _disconUnits get (getPlayerUID player); + private _disconUnit = _disconUnits get getPlayerUID player; if (!isNil "_disconUnit") then { if ( !ESETTING(gameplay,safestart) || missionNamespace getVariable [QEGVAR(gameplay,safestart_disable), false] ) then { [format ["%1 Re-jipped", name player]] remoteExec ["systemChat", 0, false]; } else { - [format ["%1 Joined %2 in ""%3"" as a ""%4""", name player, _sideLUT select ((side player) call BIS_fnc_sideID), groupID group player, _roleDescription]] remoteExec ["systemChat", 0, false]; + [format ["%1 Joined %2 in ""%3"" as a ""%4""", name player, _sideLUT select (side player call BIS_fnc_sideID), groupID group player, _roleDescription]] remoteExec ["systemChat", 0, false]; }; } else { - [format ["%1 Joined %2 in ""%3"" as a ""%4""", name player, _sideLUT select ((side player) call BIS_fnc_sideID), groupID group player, _roleDescription]] remoteExec ["systemChat", 0, false]; + [format ["%1 Joined %2 in ""%3"" as a ""%4""", name player, _sideLUT select (side player call BIS_fnc_sideID), groupID group player, _roleDescription]] remoteExec ["systemChat", 0, false]; }; }] call CBA_fnc_waitUntilAndExecute; }; @@ -51,7 +51,7 @@ addMissionEventHandler ["HandleChatMessage", { if (" CONNECTED" in toUpper _text) then { private _name = (_text splitString " "); _name deleteAt 0; - _name deleteAt (count _name - 1); + _name deleteAt count _name - 1; _name = _name joinString " "; private _message = format ["%1 in lobby selection", _name]; _return = ["", _message]; diff --git a/framework/components/common/functions/fn_countDown.sqf b/framework/components/common/functions/fn_countDown.sqf index 8efc982..e1b8424 100644 --- a/framework/components/common/functions/fn_countDown.sqf +++ b/framework/components/common/functions/fn_countDown.sqf @@ -19,10 +19,10 @@ params ["_time", "_text", ["_blocking", false]]; private _fnc_CD_CountDown = { - params["_time", "_text", "_i"]; + params["_time", "_text"]; - for [{ _i=_time }, { _i >= 0 }, { _i = _i - 1 }] do { - hintSilent (format ["%1 %2", _text, ([((_i) / 60) + 0.01, "HH:MM"] call BIS_fnc_timetostring)]); + for "_i" from _time to 0 step -1 do { + hintSilent (format ["%1 %2", _text, ([_i / 60 + 0.01, "HH:MM"] call BIS_fnc_timetostring)]); sleep 1; }; hintSilent ""; @@ -30,7 +30,7 @@ private _fnc_CD_CountDown = { /* If true will block further execution until timer is done */ -if (_blocking) then { +if _blocking then { [_time, _text] call _fnc_CD_CountDown; } else { [_time, _text] spawn _fnc_CD_CountDown; diff --git a/framework/components/common/functions/fn_diary.sqf b/framework/components/common/functions/fn_diary.sqf index 4f0c8ad..546f304 100644 --- a/framework/components/common/functions/fn_diary.sqf +++ b/framework/components/common/functions/fn_diary.sqf @@ -58,10 +58,11 @@ private _settingsArr = [GVAR(clientSettings), _x] call CBA_fnc_hashGet; { private _title = [_x select 1, (_x select 1) select 0] select ((_x select 1) isEqualType []); + private _setting = _x; _clientSettings = _clientSettings + format [ " %1: %2
", _title, - str (missionNamespace getVariable [_x select 0, ""]) + str (missionNamespace getVariable [_setting select 0, ""]) ]; } forEach _settingsArr; _clientSettings = _clientSettings + "
"; diff --git a/framework/components/common/functions/fn_fireEffect.sqf b/framework/components/common/functions/fn_fireEffect.sqf index 65fbfd3..b21b502 100644 --- a/framework/components/common/functions/fn_fireEffect.sqf +++ b/framework/components/common/functions/fn_fireEffect.sqf @@ -44,20 +44,20 @@ private _density = (_radius * 0.7) * 30; /* Fire Particle effect creation */ _fireSource setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal", 16, 10, 32, 1], "", "Billboard", 1, 1.5, [0, 0, 0], [0, 1, 0], 0, 0.045, 0.04, 0.05, [1.8, 0.12], [[1,1,1,-1]], [0.5, 1], 0, 0, "", "", _fireSource]; -_fireSource setDropInterval (0.15 - 0.01 * _radius); +_fireSource setDropInterval 0.15 - 0.01 * _radius; _fireSource setParticleRandom [0.4, [_radius - 0.1, _radius - 0.1, 0.3], [0.1, 0.5, 0.1], 0, 0.1, [0.1,0.1,0.1,0], 0, 0, 0.1]; /* Smoke Particle effect creation */ _smokeSource setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal_02", 8, 0, 40, 1], "", "Billboard", 1, 22, [0,0,0], [0,2.5,0], 1, 0.05, 0.04, 0.05, [2, 20], [[0.35,0.35,0.35,0.6],[0.35,0.35,0.35,0.75],[0.35,0.35,0.35,0.45],[0.42,0.42,0.42,0.28],[0.42,0.42,0.42,0.16],[0.42,0.42,0.42,0.09], [0.42,0.42,0.42,0.06],[0.5,0.5,0.5,0.02],[0.5,0.5,0.5,0]], [1,0.55,0.35], 0.3, 0.2, "", "", _smokeSource]; -_smokeSource setDropInterval (0.65 - 0.05 * _radius); +_smokeSource setDropInterval 0.65 - 0.05 * _radius; _smokeSource setParticleRandom [8, [5,5,0.15], [0.25,0.5,1.25], 0.5, 0, [0,0,0,0.06], 0, 0, 0.5]; /* Light creation */ -_lightSize = (1 + (_radius * 0.7)) / 2; -_light = "#lightpoint" createVehicleLocal (getPos _fireSource); +_lightSize = (1 + _radius * 0.7) / 2; +_light = "#lightpoint" createVehicleLocal getPos _fireSource; if (_source isEqualType objNull) then { - _light setPosASL [(getPosASL _source) select 0, (getPosASL _source) select 1, ((getPosASL _source) select 2) + 0.5]; + _light setPosASL [getPosASL _source select 0, getPosASL _source select 1, (getPosASL _source select 2) + 0.5]; _light attachTo [_source]; } else { _light setPosASL [_source select 0, _source select 1, (_source select 2) + 0.5]; @@ -65,7 +65,7 @@ if (_source isEqualType objNull) then { _light setLightBrightness 1.0; _light setLightColor [1, 0.65, 0.4]; _light setLightAmbient [0.15, 0.05, 0]; -_light setLightIntensity (50 + 400 * _lightSize); +_light setLightIntensity 50 + 400 * _lightSize; _light setLightAttenuation [0, 0, 0, 1]; _light setLightDayLight false; diff --git a/framework/components/common/functions/fn_notification.sqf b/framework/components/common/functions/fn_notification.sqf index 4b0bf3d..ecd4eef 100644 --- a/framework/components/common/functions/fn_notification.sqf +++ b/framework/components/common/functions/fn_notification.sqf @@ -79,7 +79,7 @@ _textCtrl ctrlCommit 0.4; } forEach _this; }, [_textCtrl, _borderCtrl], _speed + 0.3] call CBA_fnc_waitAndExecute; -GVAR(notifications) = ([[_borderCtrl, _textCtrl]] + GVAR(notifications)) select {!isNull (_x select 0) && { !isNull (_x select 1) }}; +GVAR(notifications) = [[_borderCtrl, _textCtrl]] + GVAR(notifications) select {!isNull (_x select 0) && { !isNull (_x select 1) }}; private _offsetY = 0; if (count GVAR(notifications) > 0) then { @@ -92,7 +92,7 @@ if (count GVAR(notifications) > 0) then { _ctrlText ctrlSetPosition [(_posX + NOTIFICATION_BORDER_W), (_posY + _offsetY)]; _ctrlBorder ctrlCommit 0.25; _ctrlText ctrlCommit 0.25; - _offsetY = _offsetY + NOTIFICATION_M + ((ctrlPosition _ctrlText) select 3); + _offsetY = _offsetY + NOTIFICATION_M + (ctrlPosition _ctrlText select 3); if (_activeNotifications > 3) then { _ctrlText ctrlSetFade 1; diff --git a/framework/components/common/functions/fn_parseMarkdown.sqf b/framework/components/common/functions/fn_parseMarkdown.sqf index 3602ea9..0932037 100644 --- a/framework/components/common/functions/fn_parseMarkdown.sqf +++ b/framework/components/common/functions/fn_parseMarkdown.sqf @@ -34,10 +34,10 @@ _style = createHashMapFromArray _style; private _parsedStyles = createHashMap; { private _key = _x; - private _value = _y; + // private _value = _y; private _parsed = ""; - if (_diary) then { + if _diary then { _parsed = "%1:%2 | %3
", [_hour, 2] call CBA_fnc_formatNumber, [_minute, 2] call CBA_fnc_formatNumber, _name]; - if ((date select 3) < _hour || (date select 3) < _hour && { (date select 4) < _minute } ) then { + if (date select 3 < _hour || date select 3 < _hour && { date select 4 < _minute } ) then { private _hours = _hour - (date select 3); private _minutes = abs (_minute - (date select 4)) max 0; _string = _string + format [" %1h %2m", _hours, _minutes]; diff --git a/framework/components/environment/functions/fn_getWeatherDescriptors.sqf b/framework/components/environment/functions/fn_getWeatherDescriptors.sqf index 89f0ffd..fe2a602 100644 --- a/framework/components/environment/functions/fn_getWeatherDescriptors.sqf +++ b/framework/components/environment/functions/fn_getWeatherDescriptors.sqf @@ -22,7 +22,7 @@ private _date = date; -private _overcast = switch (true) do { +private _overcast = switch true do { case (overcast >= 0.0 && { overcast < 0.125 }): { "Clear" }; case (overcast > 0.125 && { overcast < 0.375 }): { "Mostly Clear" }; case (overcast > 0.375 && { overcast < 0.625 }): { "Partly Cloudy" }; @@ -31,7 +31,7 @@ private _overcast = switch (true) do { default { "Clear" }; }; -private _rain = switch (true) do { +private _rain = switch true do { case (rain >= 0.0 && { rain < 0.125 }): { "Clear" }; case (rain > 0.125 && { rain < 0.375 }): { "Light Shower" }; case (rain > 0.375 && { rain < 0.625 }): { "Light Rain" }; @@ -40,7 +40,7 @@ private _rain = switch (true) do { default { "Clear" }; }; -private _fog = switch (true) do { +private _fog = switch true do { case (fog >= 0.0 && { fog < 0.125 }): { "Clear" }; case (fog > 0.125 && { fog < 0.375 }): { "Light Fog" }; case (fog > 0.375 && { fog < 0.625 }): { "Moderate Fog" }; @@ -53,12 +53,12 @@ private _wind = format["%2° at %1m/s", [(wind call CBA_fnc_vect2Polar) select 0 private _humidity = format["%1", round ((ace_weather_currentHumidity * 100 * 10) / 10)] + "%"; private _temperature = format["%1°C", round (ambientTemperature select 0)]; -private _moonPhase = switch (true) do { - case ((moonPhase date) >= 0.0 && { (moonPhase date) < 0.25 }): { "New Moon" }; - case ((moonPhase date) > 0.25 && { (moonPhase date) < 0.5 }): { "Crescent Moon" }; - case ((moonPhase date) > 0.5 && { (moonPhase date) < 0.75 }): { "Quarter Moon" }; - case ((moonPhase date) > 0.75 && { (moonPhase date) < 0.9 }): { "Gibbous Moon" }; - case ((moonPhase date) > 0.9 && { (moonPhase date) <= 1.0 }): { "Full Moon" }; +private _moonPhase = switch true do { + case (moonPhase date >= 0.0 && { moonPhase date < 0.25 }): { "New Moon" }; + case (moonPhase date > 0.25 && { moonPhase date < 0.5 }): { "Crescent Moon" }; + case (moonPhase date > 0.5 && { moonPhase date < 0.75 }): { "Quarter Moon" }; + case (moonPhase date > 0.75 && { moonPhase date < 0.9 }): { "Gibbous Moon" }; + case (moonPhase date > 0.9 && { moonPhase date <= 1.0 }): { "Full Moon" }; default { "Clear" }; }; diff --git a/framework/components/environment/functions/fn_sunAngle.sqf b/framework/components/environment/functions/fn_sunAngle.sqf index 29b8579..f0e2bdd 100644 --- a/framework/components/environment/functions/fn_sunAngle.sqf +++ b/framework/components/environment/functions/fn_sunAngle.sqf @@ -27,7 +27,7 @@ #define EQUINOX_ERROR 2 /* Equinox - 360 is the number of orbital degrees per year, 365 the number of days per year. 81 accounts for march equinox */ -#define EQUINOX_MAR ((360 * dateToNumber _date) - (360 * (81 + EQUINOX_ERROR) / 365)) +#define EQUINOX_MAR (360 * dateToNumber _date - 360 * (81 + EQUINOX_ERROR) / 365) /* verify and cleanup input parameters */ _date = []; @@ -58,9 +58,9 @@ _return pushBack asin( sin _declination * sin _latitude + cos _declination * cos /* calculate solar zentih angle */ if ( sin (90 - (_return select 0)) != 0) then { if (dayTime <= 12) then { - _return pushBack (acos ( ((sin _declination) * (cos _latitude) - (cos _hra) * (cos _declination) * (sin _latitude)) / sin (90 - (_return select 0)) )); + _return pushBack acos ( (sin _declination * cos _latitude - cos _hra * cos _declination * sin _latitude) / sin (90 - (_return select 0)) ); } else { - _return pushBack (360 - acos ( ((sin _declination) * (cos _latitude) - (cos _hra) * (cos _declination) * (sin _latitude)) / sin (90 - (_return select 0)) )); + _return pushBack 360 - acos ( (sin _declination * cos _latitude - cos _hra * cos _declination * sin _latitude) / sin (90 - (_return select 0)) ); }; } else { _return pushBack 90; diff --git a/framework/components/gameplay/functions/fn_flashbangOverride.sqf b/framework/components/gameplay/functions/fn_flashbangOverride.sqf index 92f2053..28e9832 100644 --- a/framework/components/gameplay/functions/fn_flashbangOverride.sqf +++ b/framework/components/gameplay/functions/fn_flashbangOverride.sqf @@ -26,13 +26,13 @@ GVAR(flashbang_extraEffects) = { private _sparkEmitter = "#particlesource" createVehicleLocal [((_this select 0) select 0), ((_this select 0) select 1), ((_this select 0) select 2) + 0.1]; [_SmokeEmitter, _sparkEmitter] spawn { - params["_SmokeEmitter", "_sparkEmitter"]; + params["_smokeEmitter", "_sparkEmitter"]; _sparkEmitter setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal.p3d",16,0,12,0],"","Billboard",1,20,[0,0,1.2],[0,0,0],0,10.071,7.9,0,[0.005,0.005,0.005,0.005,0.005,0.005,0.005,0.005,0.005,0],[[1,1,1,-6.5],[1,1,1,-6],[1,1,1,-5.5],[1,1,1,-4.5]],[1000],1,0,"","","",0,false,0,[[20000,13000,8000,0.5]]]; _sparkEmitter setParticleRandom [1,[2,2,1],[0,0,0],0,0,[0,0.15,0.15,0],0,0,1,0]; _sparkEmitter setDropInterval 0.5; - _SmokeEmitter setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal.p3d",16,12,13,0],"","Billboard",1,30,[0,0,0],[0,0,0],0,0.051,0.04,0,[3.5],[[0.305037,0.301192,0.3,0.05]],[1000],0.001,0.008,"","","",0,false,0,[[0,0,0,0]]]; - _SmokeEmitter setParticleRandom [1,[4,1.5,1],[0,0,0],0,0,[0,0,0,0],0,0,1,0]; - _SmokeEmitter setDropInterval 0.0005; + _smokeEmitter setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal.p3d",16,12,13,0],"","Billboard",1,30,[0,0,0],[0,0,0],0,0.051,0.04,0,[3.5],[[0.305037,0.301192,0.3,0.05]],[1000],0.001,0.008,"","","",0,false,0,[[0,0,0,0]]]; + _smokeEmitter setParticleRandom [1,[4,1.5,1],[0,0,0],0,0,[0,0,0,0],0,0,1,0]; + _smokeEmitter setDropInterval 0.0005; _smokeEmitter spawn { sleep 0.1; @@ -119,8 +119,8 @@ GVAR(flashbang_explosion) = { private _fired_event = { if (!SETTING(flashbang)) exitWith {}; - private _grenadeConfig = (createHashMapFromArray GVAR(flashbang_grenades)) getOrDefault [(_this select 5), [-1]]; - if ((_grenadeConfig select 0) > -1) then { + private _grenadeConfig = createHashMapFromArray GVAR(flashbang_grenades) getOrDefault [(_this select 5), [-1]]; + if (_grenadeConfig select 0 > -1) then { [(_this select 6), _grenadeConfig] spawn { params["_grenade", "_grenadeConfig", ""]; _grenadeConfig params["_grenadeFuze", ["_bangs", 1], ["_bangDelay", {random [0.1, 0.3, 0.8]}]]; @@ -184,7 +184,7 @@ private _fired_event = { } } forEach _units; sleep _bangDelay; - private _newPos = (getPos _grenadeObject) getPos [(random 1), (random 360)]; + private _newPos = getPos _grenadeObject getPos [(random 1), (random 360)]; if ([_grenadeObject, "VIEW"] checkVisibility [[(_newPos select 0), (_newPos select 1), _height + 0.5], [(_posASL select 0), (_posASL select 1), _height + 0.5]] > 0.6) then { _grenadeObject setPosASL [(_newPos select 0), (_newPos select 1), _height + 0.03]; _grenadeObject setVectorUp [(random(selectRandom[1,-1])),(random(selectRandom[1,-1])),0]; diff --git a/framework/components/gameplay/functions/fn_repairRearmStation.sqf b/framework/components/gameplay/functions/fn_repairRearmStation.sqf index 85ea756..77d40de 100644 --- a/framework/components/gameplay/functions/fn_repairRearmStation.sqf +++ b/framework/components/gameplay/functions/fn_repairRearmStation.sqf @@ -60,7 +60,7 @@ _this spawn { /* Reload magazines */ if (_turrets > 0) then { - for "_i" from 0 to (_turrets - 1) do { + for "_i" from 0 to _turrets - 1 do { private _config = (configFile >> "CfgVehicles" >> _type >> "Turrets") select _i; private _turretName = configName _config; _magazines = getArray(_config >> "magazines"); @@ -82,7 +82,7 @@ _this spawn { private _count_other = count (_config >> "Turrets"); if (_count_other > 0) then { - for "_i" from 0 to (_count_other - 1) do { + for "_i" from 0 to _count_other - 1 do { private _config2 = (_config >> "Turrets") select _i; _magazines = getArray(_config2 >> "magazines"); _removed = []; @@ -119,7 +119,7 @@ _this spawn { //_veh vehicleChat "Refuelling..."; QGVAR(reapirRearm_info) cutText ["Refueling...", "PLAIN DOWN"]; while {fuel _veh < 0.99} do { - _veh setFuel ((fuel _veh + 0.01) min 1); + _veh setFuel (fuel _veh + 0.01) min 1; sleep 0.05; }; sleep _reloadTimeFactor; @@ -133,7 +133,7 @@ _this spawn { (_this select 0) params ["_centerPos", ["_centerRadius", 5], ["_types", ["Car", "Tank", "Plane", "Helicopter", "Ship"]]]; while { !(missionNamespace getVariable [QGVAR(repairRearm_disable), false]) } do { - waitUntil { !isNull objectParent player && { (objectParent player distance _centerPos) < _centerRadius && { _types findIf { objectParent player isKindOf _x } != -1 } } }; + waitUntil { !isNull objectParent player && { objectParent player distance _centerPos < _centerRadius && { _types findIf { objectParent player isKindOf _x } != -1 } } }; private _vehicle = objectParent player; LOG_1("repairRearm %1", typeOf _vehicle); @@ -143,7 +143,7 @@ _this spawn { private _repairRearmHandle = _vehicle spawn (_this select 1); /* Wait until player leaves radius */ - waitUntil { (objectParent player distance _centerPos) > _centerRadius }; + waitUntil { objectParent player distance _centerPos > _centerRadius }; if (!scriptDone _repairRearmHandle) then { terminate _repairRearmHandle; QGVAR(reapirRearm_info) cutText ["Cancelled Operation!", "PLAIN DOWN"]; diff --git a/framework/components/gameplay/functions/fn_restrictedVehicle.sqf b/framework/components/gameplay/functions/fn_restrictedVehicle.sqf index 35f3c20..3676387 100644 --- a/framework/components/gameplay/functions/fn_restrictedVehicle.sqf +++ b/framework/components/gameplay/functions/fn_restrictedVehicle.sqf @@ -30,10 +30,10 @@ _vehicle addEventHandler ["GetIn", { //if (!isPlayer _unit) exitWith {}; private _condition = _unit call (_vehicle getVariable [QGVAR(restrictedVehicle_condition), { true }]); - private _role = (assignedVehicleRole _unit) select 0; + private _role = assignedVehicleRole _unit select 0; /* Check if player is allowed to be in seat */ - if ((_role in ["driver", "Turret"]) && { !_condition }) then { + if (_role in ["driver", "Turret"] && { !_condition }) then { ["You do not know how to operate this vehicle"] remoteExec ["hint", _unit]; _unit action ["getOut", _vehicle]; LOG_2("Kicked %1 out of vehicle %2", name _unit, typeOf _vehicle); @@ -45,11 +45,11 @@ _vehicle addEventHandler ["SeatSwitched", { params ["_vehicle", "_unit"]; if (!isPlayer _unit) exitWith {}; - private _role = (assignedVehicleRole _unit) select 0; + private _role = assignedVehicleRole _unit select 0; private _condition = _unit call (_vehicle getVariable [QGVAR(restrictedVehicle_condition), { true }]); /* Check if player is allowed to be in seat */ - if ((_role in ["driver", "Turret"]) && { !_condition }) then { + if (_role in ["driver", "Turret"] && { !_condition }) then { ["You do not know how to operate this vehicle"] remoteExec ["hint", _unit]; _unit action ["getOut", _vehicle]; LOG_2("Kicked %1 out of vehicle %2", name _unit, typeOf _vehicle); diff --git a/framework/components/gameplay/functions/fn_safestart.sqf b/framework/components/gameplay/functions/fn_safestart.sqf index 0a31d17..8df1ee6 100644 --- a/framework/components/gameplay/functions/fn_safestart.sqf +++ b/framework/components/gameplay/functions/fn_safestart.sqf @@ -16,7 +16,7 @@ */ SCRIPT(safestart); -if !(SETTING(safestart)) exitWith {}; +if !SETTING(safestart) exitWith {}; /* Freeze Time */ EGVAR(environment,freezeTime_override) = true; @@ -29,17 +29,17 @@ LOG("Enabled safestart"); GVAR(safestart_phase) = ["Setup", 0]; publicVariable QGVAR(safestart_phase); -[{ (systemTime select 3) >= 19 }, { +[{ systemTime select 3 >= 19 }, { GVAR(safestart_phase) = ["Pre-Start", serverTime]; publicVariable QGVAR(safestart_phase); }] call CBA_fnc_waitUntilAndExecute; -[{ (systemTime select 3) >= 20 }, { +[{ systemTime select 3 >= 20 }, { GVAR(safestart_phase) = ["Briefing", serverTime]; publicVariable QGVAR(safestart_phase); }] call CBA_fnc_waitUntilAndExecute; -[{ (systemTime select 3) >= 20 && { (systemTime select 4) >= 30 } }, { +[{ systemTime select 3 >= 20 && { systemTime select 4 >= 30 } }, { GVAR(safestart_phase) = ["Overtime", serverTime]; publicVariable QGVAR(safestart_phase); }] call CBA_fnc_waitUntilAndExecute; @@ -105,11 +105,11 @@ addMissionEventHandler ["EntityRespawned", { /* Cutoffs */ private _cutoffPhases = missionNameSpace getVariable [QGVAR(safestart_phaseCutOffs), []]; { - if ((_x select 1) > ((serverTime - _startTime))) then { + if (_x select 1 > serverTime - _startTime) then { _safestartHint = _safestartHint + format [ "%1 Cut-off %2
", (_x select 0), - [(_x select 1) - (serverTime), 'MM:SS'] call BIS_fnc_secondsToString + [(_x select 1) - serverTime, 'MM:SS'] call BIS_fnc_secondsToString ]; } else { [] spawn compile (_x select 2); @@ -124,17 +124,17 @@ addMissionEventHandler ["EntityRespawned", { _safestartHint = _safestartHint + ""; private _missionData = missionNameSpace getVariable [QEGVAR(common,missionData), []]; private _equipment = [_missionData] call CBA_fnc_hashCreate; - if (([_equipment, "E_MAP", ""] call CBA_fnc_hashGet) != "") then {_safestartHint = _safestartHint + format["Maps: %1
", [_equipment, "E_MAP"] call CBA_fnc_hashGet]; }; - if (([_equipment, "E_GPS", ""] call CBA_fnc_hashGet) != "") then {_safestartHint = _safestartHint + format["GPS: %1
", [_equipment, "E_GPS"] call CBA_fnc_hashGet]; }; - if (([_equipment, "E_RADIO", ""] call CBA_fnc_hashGet) != "") then {_safestartHint = _safestartHint + format["Radios: %1
", [_equipment, "E_RADIO"] call CBA_fnc_hashGet]; }; - if (([_equipment, "E_NVG", ""] call CBA_fnc_hashGet) != "") then {_safestartHint = _safestartHint + format["NVGs: %1
", [_equipment, "E_NVG"] call CBA_fnc_hashGet]; }; - if (([_equipment, "E_FLASHLIGHT", ""] call CBA_fnc_hashGet) != "") then {_safestartHint = _safestartHint + format["Flashlights: %1
", [_equipment, "E_FLASHLIGHT"] call CBA_fnc_hashGet]; }; - if (([_equipment, "E_FLARE", ""] call CBA_fnc_hashGet) != "") then {_safestartHint = _safestartHint + format["Flares: %1
", [_equipment, "E_FLARE"] call CBA_fnc_hashGet]; }; + if ([_equipment, "E_MAP", ""] call CBA_fnc_hashGet != "") then {_safestartHint = _safestartHint + format["Maps: %1
", [_equipment, "E_MAP"] call CBA_fnc_hashGet]; }; + if ([_equipment, "E_GPS", ""] call CBA_fnc_hashGet != "") then {_safestartHint = _safestartHint + format["GPS: %1
", [_equipment, "E_GPS"] call CBA_fnc_hashGet]; }; + if ([_equipment, "E_RADIO", ""] call CBA_fnc_hashGet != "") then {_safestartHint = _safestartHint + format["Radios: %1
", [_equipment, "E_RADIO"] call CBA_fnc_hashGet]; }; + if ([_equipment, "E_NVG", ""] call CBA_fnc_hashGet != "") then {_safestartHint = _safestartHint + format["NVGs: %1
", [_equipment, "E_NVG"] call CBA_fnc_hashGet]; }; + if ([_equipment, "E_FLASHLIGHT", ""] call CBA_fnc_hashGet != "") then {_safestartHint = _safestartHint + format["Flashlights: %1
", [_equipment, "E_FLASHLIGHT"] call CBA_fnc_hashGet]; }; + if ([_equipment, "E_FLARE", ""] call CBA_fnc_hashGet != "") then {_safestartHint = _safestartHint + format["Flares: %1
", [_equipment, "E_FLARE"] call CBA_fnc_hashGet]; }; if (uniform player != '') then { - _safestartHint = _safestartHint + format["Uniform: %1
", [configFile >> "CfgWeapons" >> (uniform player)] call BIS_fnc_displayName]; + _safestartHint = _safestartHint + format["Uniform: %1
", [configFile >> "CfgWeapons" >> uniform player] call BIS_fnc_displayName]; }; if (primaryWeapon player != '') then { - _safestartHint = _safestartHint + format["Loadout: %1
", [configFile >> "CfgWeapons" >> (primaryWeapon player)] call BIS_fnc_displayName]; + _safestartHint = _safestartHint + format["Loadout: %1
", [configFile >> "CfgWeapons" >> primaryWeapon player] call BIS_fnc_displayName]; }; if ([player] call EFUNC(respawn,getLimit) != -1) then { _safestartHint = _safestartHint + format["Respawns: %1
", [player] call EFUNC(respawn,getLimit)]; @@ -149,7 +149,7 @@ addMissionEventHandler ["EntityRespawned", { [_x] call acre_api_fnc_getDisplayName, [_x] call acre_api_fnc_getRadioChannel, (_pttAssign find _x) + 1, - switch (([_x] call acre_api_fnc_getRadioSpatial)) do { case "LEFT": { "L" }; case "RIGHT": { "R" }; case "CENTER": { "B" }; } + switch ([_x] call acre_api_fnc_getRadioSpatial) do { case "LEFT": { "L" }; case "RIGHT": { "R" }; case "CENTER": { "B" }; } ]; } forEach call acre_api_fnc_getCurrentRadioList; _safestartHint = _safestartHint + "
"; @@ -161,7 +161,7 @@ addMissionEventHandler ["EntityRespawned", { "%1 %2, %3kg %4
", name _x, [_x] call EFUNC(organization,getRole), - ((loadAbs _x / 10) / 2.205) toFixed 2, + (loadAbs _x / 10) / 2.205 toFixed 2, switch (rank _x) do { case 'PRIVATE': { "Pvt" }; case 'CORPORAL': { "Cpl" }; @@ -211,7 +211,7 @@ addMissionEventHandler ["EntityRespawned", { }; /* If the projectile is a grenade delete it */ - if ((configname (inheritsFrom (configFile >> "cfgWeapons" >> "throw" >> _muzzle)) isEqualTo "ThrowMuzzle")) then { + if (configname (inheritsFrom (configFile >> "cfgWeapons" >> "throw" >> _muzzle)) isEqualTo "ThrowMuzzle") then { _projectile setPos [0,0,0]; deleteVehicle _projectile; ["Safestart is active", -1, safezoneY + 0.1] spawn bis_fnc_dynamicText; diff --git a/framework/components/gameplay/functions/fn_tracers.sqf b/framework/components/gameplay/functions/fn_tracers.sqf index 2ed4c66..8e84cba 100644 --- a/framework/components/gameplay/functions/fn_tracers.sqf +++ b/framework/components/gameplay/functions/fn_tracers.sqf @@ -26,19 +26,19 @@ FUNC(addTracers) = { private _tracerMags = []; { - if ((getNumber (configfile >> "CfgMagazines" >> _x >> "tracersEvery")) > 0) then { + if (getNumber (configfile >> "CfgMagazines" >> _x >> "tracersEvery") > 0) then { _tracerMags pushBack _x; }; } forEach _supportedMags; if (count _tracerMags > 0) then { private _newMagazine = []; - if (SETTING(tracersRandomModel)) then { - _newMagazine pushBack (_tracerMags select (random (count _tracerMags))); + if SETTING(tracersRandomModel) then { + _newMagazine pushBack (_tracerMags select random (count _tracerMags)); } else { { private _curMag = getText (configfile >> "CfgMagazines" >> _x >> "model"); - private _curprimaryMag = getText (configfile >> "CfgMagazines" >> ((primaryWeaponMagazine _unit) select 0) >> "model"); + private _curprimaryMag = getText (configfile >> "CfgMagazines" >> primaryWeaponMagazine _unit select 0 >> "model"); if (isNil "_curprimaryMag") then { _curprimaryMag = ""; }; @@ -48,7 +48,7 @@ FUNC(addTracers) = { }; } forEach _tracerMags; - if ((count _newMagazine) isEqualTo 0) then + if (count _newMagazine isEqualTo 0) then { _newMagazine pushBack (_tracerMags select 0); }; @@ -78,7 +78,7 @@ FUNC(addTracers) = { _unit setVariable [QGVAR(tracers_initialized), true, true]; }; - if (SETTING(tracersFlashlight)) then { + if SETTING(tracersFlashlight) then { private _flashLights = []; private _compatMods = [_primaryWeapon] call CBA_fnc_compatibleItems; { @@ -89,7 +89,7 @@ FUNC(addTracers) = { }; } forEach _compatMods; if (count _flashLights > 0) then { - _unit addPrimaryWeaponItem (_flashLights select (random (count _flashLights))); + _unit addPrimaryWeaponItem (_flashLights select random (count _flashLights)); _unit enableGunLights "ForceOn"; }; diff --git a/framework/components/kosherAI/functions/fn_getRole.sqf b/framework/components/kosherAI/functions/fn_getRole.sqf index 9976709..3f093a4 100644 --- a/framework/components/kosherAI/functions/fn_getRole.sqf +++ b/framework/components/kosherAI/functions/fn_getRole.sqf @@ -26,19 +26,19 @@ if (!isNil { _unit getVariable QGVAR(role) }) exitWith { private _fnc_isOperator = { private _unit = _this; - _unit isEqualTo (commander (vehicle _unit)) || - { _unit isEqualTo (driver (vehicle _unit)) || - { _unit isEqualTo (gunner (vehicle _unit)) }}; + _unit isEqualTo commander (vehicle _unit) || + { _unit isEqualTo driver (vehicle _unit) || + { _unit isEqualTo gunner (vehicle _unit) }}; }; /* Crewman */ -if ((vehicle _unit) isKindOf "Tank" && { (_unit call _fnc_isOperator) }) exitWith {_unit setVariable [QGVAR(role), "CRW"]; "CRW"}; +if (vehicle _unit isKindOf "Tank" && { (_unit call _fnc_isOperator) }) exitWith {_unit setVariable [QGVAR(role), "CRW"]; "CRW"}; /* Rotary Pilot */ -if ((vehicle _unit) isKindOf "Helicopter" && { (_unit call _fnc_isOperator) }) exitWith {_unit setVariable [QGVAR(role), "RPIL"]; "RPIL"}; +if (vehicle _unit isKindOf "Helicopter" && { (_unit call _fnc_isOperator) }) exitWith {_unit setVariable [QGVAR(role), "RPIL"]; "RPIL"}; /* Fixed Wing Pilot */ -if ((vehicle _unit) isKindOf "Plane" && { (_unit call _fnc_isOperator) }) exitWith {_unit setVariable [QGVAR(role), "WPIL"]; "WPIL"}; +if (vehicle _unit isKindOf "Plane" && { (_unit call _fnc_isOperator) }) exitWith {_unit setVariable [QGVAR(role), "WPIL"]; "WPIL"}; /* Medic */ if (getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "attendant") isEqualTo 1) exitWith {_unit setVariable [QGVAR(role), "MED"]; "MED"}; @@ -47,16 +47,16 @@ if (getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "attendant") isEqu if (getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") isEqualTo 1) exitWith {_unit setVariable [QGVAR(role), "ENG"]; "ENG"}; /* Anti-tank */ -if ((secondaryWeapon _unit) != "") exitWith {_unit setVariable [QGVAR(role), "AT"]; "AT"}; +if (secondaryWeapon _unit != "") exitWith {_unit setVariable [QGVAR(role), "AT"]; "AT"}; /* Machinegunner */ -if (((primaryweapon _unit) call BIS_fnc_itemtype) select 1 isEqualTo "MachineGun") exitWith {_unit setVariable [QGVAR(role), "MG"]; "MG"}; +if ((primaryweapon _unit call BIS_fnc_itemtype) select 1 isEqualTo "MachineGun") exitWith {_unit setVariable [QGVAR(role), "MG"]; "MG"}; /* Sniper */ -if (((primaryweapon _unit) call BIS_fnc_itemtype) select 1 isEqualTo "SniperRifle") exitWith {_unit setVariable [QGVAR(role), "MAR"]; "MAR"}; +if ((primaryweapon _unit call BIS_fnc_itemtype) select 1 isEqualTo "SniperRifle") exitWith {_unit setVariable [QGVAR(role), "MAR"]; "MAR"}; /* Squad Leader */ -if ((leader _unit) isEqualTo _unit) exitWith {_unit setVariable [QGVAR(role), "SL"]; "SL"}; +if (leader _unit isEqualTo _unit) exitWith {_unit setVariable [QGVAR(role), "SL"]; "SL"}; /* Rifleman */ _unit setVariable [QGVAR(role), "RFL"]; "RFL" \ No newline at end of file diff --git a/framework/components/kosherAI/functions/fn_init.sqf b/framework/components/kosherAI/functions/fn_init.sqf index 926d7d1..5d28c92 100644 --- a/framework/components/kosherAI/functions/fn_init.sqf +++ b/framework/components/kosherAI/functions/fn_init.sqf @@ -42,8 +42,8 @@ if (!isServer) exitWith {}; { _x params ["_side", "_loadout", ["_list", []], ["_whitelist", false]]; - if (_whitelist) then { - if (side _unit isEqualTo _side && { (_unitClass in _list) || (_unitFaction in _list) }) exitWith { + if _whitelist then { + if (side _unit isEqualTo _side && { _unitClass in _list || _unitFaction in _list }) exitWith { private _role = [_unit] call FUNC(getRole); private _whitelist = ([_role] call compile(preprocessFileLineNumbers format["rsc\loadouts\%1.sqf", _loadout])) select 1; diff --git a/framework/components/kosherAI/functions/fn_setLoadout.sqf b/framework/components/kosherAI/functions/fn_setLoadout.sqf index 40c55a7..5e97e19 100644 --- a/framework/components/kosherAI/functions/fn_setLoadout.sqf +++ b/framework/components/kosherAI/functions/fn_setLoadout.sqf @@ -17,17 +17,17 @@ * Public: No */ -params["_unit", "_role", "_whitelist"]; +params ["_unit", "_role", "_whitelist"]; /* Strip unit naked */ -[_unit] call EFUNC(common,stripUnit); +[_unit] call EFUNC(common,stripunit); /* Randomize the loadout they get based on the available items */ -_unit addBackpack (selectRandom (_whitelist select 0)); -_unit addVest (selectRandom (_whitelist select 1)); -_unit forceAddUniform (selectRandom (_whitelist select 2)); -_unit addGoggles (selectRandom (_whitelist select 3)); -_unit addHeadgear (selectRandom (_whitelist select 4)); +_unit addBackpack selectRandom (_whitelist select 0); +_unit addVest selectRandom (_whitelist select 1); +_unit forceAddUniform selectRandom (_whitelist select 2); +_unit addGoggles selectRandom (_whitelist select 3); +_unit addHeadgear selectRandom (_whitelist select 4); /* Add random weapons for each slot */ private _primaries = (_whitelist select 7) select { getNumber (configFile >> "CfgWeapons" >> _x >> "type") isEqualTo 1 }; @@ -49,8 +49,8 @@ if (!isNil "_primary") then { WARNING("Failed to add primary weapon on unit"); }; - private _primaryMagazines = _magazines select { _x in (compatibleMagazines _primary) }; - for "_i" from 2 to round 2 + (random 4) do { + private _primaryMagazines = _magazines select { _x in compatibleMagazines _primary }; + for "_i" from 2 to round 2 + random 4 do { _unit addMagazineGlobal selectRandom _primaryMagazines; }; }; @@ -63,7 +63,7 @@ if (!isNil "_secondary") then { WARNING("Failed to add secondary weapon on unit"); }; - private _secondaryMagazines = _magazines select { _x in (compatibleMagazines _secondary) }; + private _secondaryMagazines = _magazines select { _x in compatibleMagazines _secondary }; for "_i" from 0 to round (random 4) do { _unit addMagazineGlobal selectRandom _secondaryMagazines; }; @@ -77,7 +77,7 @@ if (!isNil "_handgun") then { WARNING("Failed to add handgun weapon on unit"); }; - private _handgunMagazines = _magazines select { _x in (compatibleMagazines _handgun) }; + private _handgunMagazines = _magazines select { _x in compatibleMagazines _handgun }; for "_i" from 1 to 1 + round (random 1) do { _unit addMagazineGlobal selectRandom _handgunMagazines; }; @@ -85,7 +85,7 @@ if (!isNil "_handgun") then { /* Add random weapon attachments if they are available */ for "_i" from 0 to round random 2 do { - _unit addPrimaryWeaponItem (selectRandom (_whitelist select 5)); + _unit addPrimaryWeaponItem selectRandom (_whitelist select 5); }; /* Add grenades */ @@ -94,7 +94,7 @@ for "_i" from 0 to round (random 3) do { }; /* Add Explosives */ -private _compatibleMagazines = (compatibleMagazines primaryWeapon _unit) + (compatibleMagazines handgunWeapon _unit) + (compatibleMagazines secondaryWeapon _unit); +private _compatibleMagazines = compatibleMagazines primaryWeapon _unit + (compatibleMagazines handgunWeapon _unit + compatibleMagazines secondaryWeapon _unit); private _explosives = _magazines select { !(_x in _compatibleMagazines) }; for "_i" from 0 to round (random 2) do { _unit addMagazineGlobal selectRandom _explosives; @@ -102,8 +102,8 @@ for "_i" from 0 to round (random 2) do { /* Add medical equipment */ if (_role isEqualTo "MED") then { - for "_i" from 0 to (random 30) do { - _unit addItem (selectRandom (_whitelist select 8)); + for "_i" from 0 to random 30 do { + _unit addItem selectRandom (_whitelist select 8); } } else { _unit addItem "Medikit"; _unit addItem "Medikit"; diff --git a/framework/components/kosherArsenal/XEH_3denInit.sqf b/framework/components/kosherArsenal/XEH_3denInit.sqf index 453b9b8..2c05460 100644 --- a/framework/components/kosherArsenal/XEH_3denInit.sqf +++ b/framework/components/kosherArsenal/XEH_3denInit.sqf @@ -25,17 +25,6 @@ private _ammoBoxAction = [ } ]; -[ - _path, - "Kosher Arsenal", - "a3\3den\data\displays\display3den\toolbar\open_ca.paa", - {}, - [], - [ - _ammoBoxAction - ] -] call EFUNC(3den,addMenuItem); - private _randomLoadoutAction = [ "Set Random Loadout", "a3\ui_f\data\gui\rsc\rscdisplayarsenal\uniform_ca.paa", @@ -48,7 +37,7 @@ private _randomLoadoutAction = [ params ["_values", "_units"]; private _loadout = format["rsc\loadouts\%1.sqf", _values select 1]; - if !(FILE_EXISTS(_loadout)) exitWith { ERROR_MSG_1("Unable to find loadoutfile: %1", _loadout) }; + if !(fileExists _loadout) exitWith { ERROR_MSG_1("Unable to find loadoutfile: %1", _loadout) }; private _whitelist = [_values select 0, player, true] call compile(preprocessFileLineNumbers _loadout); { @@ -62,7 +51,7 @@ private _randomLoadoutAction = [ ["Set Random Loadout", [ ["EDIT", ["Role", "Role to set unit as"], ["RFL"]], ["EDIT", ["Loadoutfile", "Loadoutfile to use"], [""]] - ], _randomizeLoadout, {}, (get3DENSelected "object") select { _x isKindOf "Man" }] call zen_dialog_fnc_create; + ], _randomizeLoadout, {}, get3DENSelected "object" select { _x isKindOf "Man" }] call zen_dialog_fnc_create; } ]; diff --git a/framework/components/kosherArsenal/functions/fn_ammobox.sqf b/framework/components/kosherArsenal/functions/fn_ammobox.sqf index 9be9bf3..4bbd47a 100644 --- a/framework/components/kosherArsenal/functions/fn_ammobox.sqf +++ b/framework/components/kosherArsenal/functions/fn_ammobox.sqf @@ -1,5 +1,4 @@ #include "script_component.hpp" -#include "\z\ace\addons\arsenal\defines.hpp" /* * Author: Eric * initializes an object as a ammobox @@ -33,7 +32,7 @@ private _onOpen = { private _loadout = player getVariable [QGVAR(loadout), ""]; /* Check if the file exists and load the whitelist */ - if !(FILE_EXISTS(_loadout)) exitWith { ERROR_1("Loadoutfile %1 does not exist!",_loadout) }; + if !(fileExists _loadout) exitWith { ERROR_1("Loadoutfile %1 does not exist!",_loadout) }; private _whitelist = [_role, player, true] call compile(preprocessFileLineNumbers _loadout); /* Get gear from whitelist and check loadout file version */ diff --git a/framework/components/kosherArsenal/functions/fn_forceArsenal.sqf b/framework/components/kosherArsenal/functions/fn_forceArsenal.sqf index 36b87b6..14b0ae7 100644 --- a/framework/components/kosherArsenal/functions/fn_forceArsenal.sqf +++ b/framework/components/kosherArsenal/functions/fn_forceArsenal.sqf @@ -1,5 +1,4 @@ #include "script_component.hpp" -#include "\z\ace\addons\arsenal\defines.hpp" /* * Author: Eric * Force opens kosher arsenal on a unit diff --git a/framework/components/kosherArsenal/functions/fn_init.sqf b/framework/components/kosherArsenal/functions/fn_init.sqf index 6a1e5ae..bae7bce 100644 --- a/framework/components/kosherArsenal/functions/fn_init.sqf +++ b/framework/components/kosherArsenal/functions/fn_init.sqf @@ -1,5 +1,4 @@ #include "script_component.hpp" -#include "\z\ace\addons\arsenal\defines.hpp" /* * Author: Eric * Loads kosherArsenal diff --git a/framework/components/kosherArsenal/script_component.hpp b/framework/components/kosherArsenal/script_component.hpp index 491589c..9541b41 100644 --- a/framework/components/kosherArsenal/script_component.hpp +++ b/framework/components/kosherArsenal/script_component.hpp @@ -12,4 +12,6 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_KOSHERARSENAL #endif -#include "..\main\script_component.hpp" \ No newline at end of file +#include "..\main\script_component.hpp" + +#include "\z\ace\addons\arsenal\defines.hpp" \ No newline at end of file diff --git a/framework/components/kosherGarage/XEH_3denInit.sqf b/framework/components/kosherGarage/XEH_3denInit.sqf index a55197a..788a6d6 100644 --- a/framework/components/kosherGarage/XEH_3denInit.sqf +++ b/framework/components/kosherGarage/XEH_3denInit.sqf @@ -15,7 +15,7 @@ private _createVehicleSpawner = [ private _spawnerpadVar = (all3DENEntities select 0) select { (_x get3DENAttribute 'Name') isEqualTo ['cmf_3den_missionDataLogic_old'] }; for "_y" from 1 to 9001 do { - _spawnerpadVar = QGVAR(spawnpad_) + str(_y); + _spawnerpadVar = QGVAR(spawnpad_) + str _y; if ((all3DENEntities select 0) findIf { [_spawnerpadVar] isEqualTo (_x get3DENAttribute 'Name')} isEqualTo -1) exitWith {}; }; diff --git a/framework/components/kosherGarage/functions/fn_init.sqf b/framework/components/kosherGarage/functions/fn_init.sqf index 5e6b735..8880caf 100644 --- a/framework/components/kosherGarage/functions/fn_init.sqf +++ b/framework/components/kosherGarage/functions/fn_init.sqf @@ -52,7 +52,7 @@ private _action = [QGVAR(root), "Spawn Vehicle", "", { true }, { true }, { "params [""_target"", ""_player"", ""_params""];", "_params params [""_vehicle"", ""_center""];", "(count (nearestObjects [_center, [""AllVehicles""], 5]) isEqualTo 0) &&" - ] joinString endl) + (toString _condition)); + ] joinString endl) + toString _condition); private _action = [ format [QGVAR(%1), _vehicle], diff --git a/framework/components/logistics/XEH_3denInit.sqf b/framework/components/logistics/XEH_3denInit.sqf index c37d3bf..28db14c 100644 --- a/framework/components/logistics/XEH_3denInit.sqf +++ b/framework/components/logistics/XEH_3denInit.sqf @@ -16,7 +16,7 @@ private _crateLoadoutAction = [ params ["_values", "_crates"]; private _path = format["rsc\loadouts\%1.sqf", (_values select 0)]; - if !(FILE_EXISTS(_path)) exitWith { ERROR_MSG_1("Unable to find preset: %1", (_values select 0)); }; + if !fileExists _path exitWith { ERROR_MSG_1("Unable to find preset: %1", (_values select 0)); }; private _presets = [call compile preprocessFileLineNumbers _path] call CBA_fnc_hashCreate; private _preset = [_presets, (_values select 1)] call CBA_fnc_hashGet; @@ -32,7 +32,7 @@ private _crateLoadoutAction = [ ["Set Crate Loadout", [ ["EDIT", ["Logistics File", "Logistics file to use"], [""]], ["EDIT", ["Crate type", "Type of create to make e.g. Fireteam, Medical etc. (case sensitive)"], [""]] - ], _setLoadout, {}, (get3DENSelected "object") select { !(_x isKindOf "Man") }] call zen_dialog_fnc_create; + ], _setLoadout, {}, get3DENSelected "object" select { !(_x isKindOf "Man") }] call zen_dialog_fnc_create; } ]; diff --git a/framework/components/logistics/functions/fn_crateActions.sqf b/framework/components/logistics/functions/fn_crateActions.sqf index 3353c1a..34d9f8c 100644 --- a/framework/components/logistics/functions/fn_crateActions.sqf +++ b/framework/components/logistics/functions/fn_crateActions.sqf @@ -36,7 +36,7 @@ private _action = [QGVAR(crate_menu), "Other", "", {}, { true }, { private _action = ([QGVAR(renameObject), "Destroy Crate", "a3\ui_f_curator\data\cfgmarkers\kia_ca.paa", { _target spawn { private _result = ["Are you sure?", "Confirm", true, true] call BIS_fnc_guiMessage; - if (_result) then { + if _result then { deleteVehicle _this; }; }; diff --git a/framework/components/logistics/functions/fn_cratePFH.sqf b/framework/components/logistics/functions/fn_cratePFH.sqf index 8ee265b..63a74a4 100644 --- a/framework/components/logistics/functions/fn_cratePFH.sqf +++ b/framework/components/logistics/functions/fn_cratePFH.sqf @@ -31,7 +31,7 @@ /* Exit if player is looking at same object */ if (_newObject isEqualTo (_oldObject select 0)) exitWith { - if ((_oldObject select 0) distance cmf_player > 5 || (count crew (_oldObject select 0)) > 0) then { + if ((_oldObject select 0) distance cmf_player > 5 || count crew (_oldObject select 0) > 0) then { terminate (_oldObject select 1); ([QGVAR(name)] call BIS_fnc_rscLayer) cutText ["","plain"]; GVAR(observedCrate) = [objNull, scriptNull]; @@ -50,7 +50,7 @@ _name = _newObject getVariable [QGVAR(objectName), nil]; }; - if (!isNil "_name" && { (count crew (_oldObject select 0)) isEqualTo 0 }) then { + if (!isNil "_name" && { count crew (_oldObject select 0) isEqualTo 0 }) then { private _handle = [format ["%1", _name], -1, -1, 9999, 0.5, 0, ([QGVAR(name)] call BIS_fnc_rscLayer)] spawn BIS_fnc_dynamicText; GVAR(observedCrate) = [_newObject, _handle]; } else { diff --git a/framework/components/logistics/functions/fn_cratePreset.sqf b/framework/components/logistics/functions/fn_cratePreset.sqf index 76e5682..6963473 100644 --- a/framework/components/logistics/functions/fn_cratePreset.sqf +++ b/framework/components/logistics/functions/fn_cratePreset.sqf @@ -18,7 +18,7 @@ params ["_name"]; if (isNil "_name") exitWith { ERROR_MSG("No preset defined") }; private _path = format["rsc\loadouts\%1.sqf", _name]; -if !(FILE_EXISTS(_path)) exitWith { ERROR_MSG_1("Unable to find preset: %1", _name); }; +if !(fileExists _path) exitWith { ERROR_MSG_1("Unable to find preset: %1", _name); }; GVAR(crateConfigFile) = _name; private _presets = [call compile preprocessFileLineNumbers _path] call CBA_fnc_hashCreate; diff --git a/framework/components/logistics/functions/fn_crateSpawner.sqf b/framework/components/logistics/functions/fn_crateSpawner.sqf index 1d030a9..8328b7f 100644 --- a/framework/components/logistics/functions/fn_crateSpawner.sqf +++ b/framework/components/logistics/functions/fn_crateSpawner.sqf @@ -38,7 +38,7 @@ private _crateHash = missionNamespace getVariable [QGVAR(crateHash), [] call CBA_fnc_hashCreate]; private _oldAmount = [_crateHash, _key] call CBA_fnc_hashGet; - if (_oldAmount >= (_preset select 0)) exitWith {}; + if (_oldAmount >= _preset select 0) exitWith {}; private _crate = (_preset select 1) createVehicle [0, 0, 0]; private _position = [_target, _crate, _player] call ace_common_fnc_findUnloadPosition; @@ -57,7 +57,7 @@ private _crateHash = missionNamespace getVariable [QGVAR(crateHash), [] call CBA_fnc_hashCreate]; private _oldAmount = [_crateHash, _key, 0] call CBA_fnc_hashGet; - private _color = ["#888888", "#ffffff"] select (_oldAmount < (_preset select 0)); + private _color = ["#888888", "#ffffff"] select (_oldAmount < _preset select 0); _actionData set [1, format ["Create %1 Crate [%2/%3]", _key, _oldAmount, _preset select 0, _color]]; } ] call ace_interact_menu_fnc_createAction; diff --git a/framework/components/logistics/functions/fn_fillCrate.sqf b/framework/components/logistics/functions/fn_fillCrate.sqf index 231fc35..aa1e158 100644 --- a/framework/components/logistics/functions/fn_fillCrate.sqf +++ b/framework/components/logistics/functions/fn_fillCrate.sqf @@ -23,7 +23,7 @@ */ params ["_crate", "_cargoPreset"]; -if (is3DEN) exitWith { +if is3DEN exitWith { private _equipment = [ [ [(_cargoPreset select 4) apply { _x select 0 }, (_cargoPreset select 4) apply { _x select 1 }], diff --git a/framework/components/main/XEH_MODULE.sqf b/framework/components/main/XEH_MODULE.sqf index 564fec8..c3baca5 100644 --- a/framework/components/main/XEH_MODULE.sqf +++ b/framework/components/main/XEH_MODULE.sqf @@ -70,7 +70,7 @@ private _loadKeybinds = { }; private _loadPreInit = { - if (is3DEN) exitWith {}; + if is3DEN exitWith {}; params ["_module"]; private _path = format ["components\%1\XEH_preInit.sqf", _module]; @@ -81,7 +81,7 @@ private _loadPreInit = { }; private _loadPostInit = { - if (is3DEN) exitWith {}; + if is3DEN exitWith {}; params ["_module"]; private _path = format ["components\%1\XEH_postInit.sqf", _module]; @@ -96,7 +96,7 @@ private _loadPostInit = { }; private _loadServerInit = { - if (is3DEN) exitWith {}; + if is3DEN exitWith {}; params ["_module"]; if (!isServer) exitWith {}; @@ -109,14 +109,14 @@ private _loadServerInit = { }; private _loadPlayerInit = { - if (is3DEN) exitWith {}; + if is3DEN exitWith {}; params ["_module"]; private _path = format ["components\%1\XEH_playerInit.sqf", _module]; if (fileExists _path) then { [ - { (missionNamespace getVariable [QGVAR(server_initialized), false]) && { !isNull player } }, + { missionNamespace getVariable [QGVAR(server_initialized), false] && { !isNull player } }, { call compile preprocessFileLineNumbers _this; }, diff --git a/framework/components/main/functions/fn_changelog.sqf b/framework/components/main/functions/fn_changelog.sqf index f427178..adf2388 100644 --- a/framework/components/main/functions/fn_changelog.sqf +++ b/framework/components/main/functions/fn_changelog.sqf @@ -24,13 +24,13 @@ addMissionEventHandler ["Map", { if !(([_lastVersion, _curVersion] call EFUNC(common,versionCompare)) isEqualTo 1 && { _disabled isEqualTo 0 }) exitWith {}; - if (_mapIsOpened && { !isNull ((findDisplay 12) displayCtrl 88800) }) then { + if (_mapIsOpened && { !isNull (findDisplay 12 displayCtrl 88800) }) then { /* Show warning if server version is older than the latest CMF version */ if ([_lastVersion, _curVersion] call EFUNC(common,versionCompare) isEqualTo -1) then { [format ["Version Mismatch! (Machine: %1 (%4) version: %3, serverVersion: %2)", player, _curVersion, _lastVersion, name player], "CMF", [CBA_display_ingame_warnings, true, true]] call CBA_fnc_debug; }; - private _display = (findDisplay 12) createDisplay QGVAR(changelogDisplay); + private _display = findDisplay 12 createDisplay QGVAR(changelogDisplay); waitUntil {!isNull _display}; private _changelog = call compile preprocessFileLineNumbers "components\main\changelog.sqf"; @@ -38,7 +38,7 @@ addMissionEventHandler ["Map", { _changelog = _changelogLines joinString "
"; (_display displayCtrl 100) ctrlSetStructuredText parseText _changelog; - private _height = (count _changelogLines) * 0.038; + private _height = count _changelogLines * 0.038; (_display displayCtrl 100) ctrlSetPositionH _height; (_display displayCtrl 100) ctrlCommit 0; diff --git a/framework/components/main/localize.sqf b/framework/components/main/localize.sqf index 4a83ed5..a398f85 100644 --- a/framework/components/main/localize.sqf +++ b/framework/components/main/localize.sqf @@ -21,7 +21,7 @@ SCRIPT(localize); params [["_stringtable", ""], ["_string", ""]]; /* Check if stringtable exists */ -if !(FILE_EXISTS(_stringtable)) exitWith { +if !(fileExists _stringtable) exitWith { WARNING_1("Failed to find stringtable %1", _stringtable); _string }; diff --git a/framework/components/main/script_component.hpp b/framework/components/main/script_component.hpp index 2e3ec5c..8d1382f 100644 --- a/framework/components/main/script_component.hpp +++ b/framework/components/main/script_component.hpp @@ -1,10 +1,15 @@ #ifndef MODULE #define MODULE main #define MODULE_BEAUTIFIED Main + #define REQUIRED_ADDONS [] + #define REQUIRED_MODULES [] #endif -#define REQUIRED_ADDONS [] -#define REQUIRED_MODULES [] +/* Disable sqf-vm linting errors for include lookups */ +#pragma sls disable file SQFVM-70014 // External Includes Lookup +#pragma sls disable file SQFVM-10004 // External Includes Fail +#pragma sls disable file VV-001 // Unused Private Variable +#pragma sls disable file VV-006 // Node type mismatch #include "script_mod.hpp" @@ -16,4 +21,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN #endif -#include "script_macros.hpp" +#include "script_macros.hpp" \ No newline at end of file diff --git a/framework/components/main/script_macros.hpp b/framework/components/main/script_macros.hpp index c09b9ea..8417bec 100644 --- a/framework/components/main/script_macros.hpp +++ b/framework/components/main/script_macros.hpp @@ -1,5 +1,4 @@ -#include "script_mod.hpp" - +#pragma sls disable SQFVM-10005 #define DOUBLES(var1,var2) var1##_##var2 #define TRIPLES(var1,var2,var3) var1##_##var2##_##var3 #define QUOTE(var1) #var1 @@ -69,12 +68,12 @@ #define PREP_SYS(var1) TRIPLES(DOUBLES(PREFIX,MODULE),fnc,var1) = compile preProcessFileLineNumbers QUOTE(PATHTO_SYS(MODULE,DOUBLES(fn,var1))) -#define PREP_MODULE(var1) if (((count REQUIRED_MODULES) isEqualTo 0) || count (REQUIRED_MODULES - EGVAR(main,components)) isEqualTo 0) then {\ +#define PREP_MODULE(var1) if (count REQUIRED_MODULES isEqualTo 0 || count (REQUIRED_MODULES - EGVAR(main,components)) isEqualTo 0) then {\ PREP_SYS(var1)\ } else {\ FUNC(var1) = { ERROR_2("%1 missing required modules: %2.", QFUNC(var1), REQUIRED_MODULES - EGVAR(main,components)) }\ } -#define PREP_ADDON(var1) if (((count REQUIRED_ADDONS) isEqualTo 0) || REQUIRED_ADDONS findIf {!isClass(configFile >> "CfgPatches" >> _x)} isEqualTo -1) then {\ +#define PREP_ADDON(var1) if (count REQUIRED_ADDONS isEqualTo 0 || REQUIRED_ADDONS findIf {!isClass(configFile >> "CfgPatches" >> _x)} isEqualTo -1) then {\ PREP_MODULE(var1)\ } else {\ FUNC(var1) = {ERROR_1("%1 missing a required addon.",QFUNC(var1))}\ @@ -91,7 +90,7 @@ #define SCRIPT(NAME) scriptName 'components\MODULE\NAME' #define ESCRIPT(var1, NAME) scriptName 'var1\MODULE\NAME' -#define IS_META_SYS(VAR,TYPE) (if (isNil {VAR}) then {false} else {(VAR) isEqualType TYPE}) +#define IS_META_SYS(VAR,TYPE) (if isNil {VAR} then {false} else {VAR isEqualType TYPE}) #define IS_ARRAY(VAR) IS_META_SYS(VAR,[]) #define IS_HASHMAP(VAR) IS_META_SYS(VAR,createhashMap) #define IS_BOOL(VAR) IS_META_SYS(VAR,false) @@ -371,3 +370,5 @@ Macros: TRACE_n() #define TRACE_8(MESSAGE,A,B,C,D,E,F,G,H) /* disabled */ #define TRACE_9(MESSAGE,A,B,C,D,E,F,G,H,I) /* disabled */ #endif + +#pragma sls enable SQFVM-10005 \ No newline at end of file diff --git a/framework/components/main/script_mod.hpp b/framework/components/main/script_mod.hpp index f62f536..6e4c2f6 100644 --- a/framework/components/main/script_mod.hpp +++ b/framework/components/main/script_mod.hpp @@ -5,7 +5,7 @@ #include "script_version.hpp" #define VERSION MAJOR.MINOR -#define VERSION_STR (str MAJOR)+"."+(str MINOR)+"."+(str PATCHLVL)+"."+(str BUILD) +#define VERSION_STR str MAJOR + "." + str MINOR + "." + str PATCHLVL + "." + str BUILD #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD #define REQUIRED_VERSION 2.08 diff --git a/framework/components/map/functions/fn_coverMap.sqf b/framework/components/map/functions/fn_coverMap.sqf index 317ed95..d842f71 100644 --- a/framework/components/map/functions/fn_coverMap.sqf +++ b/framework/components/map/functions/fn_coverMap.sqf @@ -23,14 +23,14 @@ */ if (!hasInterface || !local player) exitWith {}; -#define mapAdjustment ((worldSize * 2) + 10000) +#define mapAdjustment worldSize * 2 + 10000 #define SCALE(var1) (sqrt ((_size select 0) * (_size select 1)) * 0.000089663) * var1 params ["_position", "_size", "_topBar"]; -if (is3DEN) exitWith { +if is3DEN exitWith { for "_y" from 1 to 9001 do { - _marker = QGVAR(markerID_) + str(_y); + _marker = QGVAR(markerID_) + str _y; if (markerShape _marker isEqualTo "") exitWith {}; }; @@ -44,7 +44,7 @@ private "_marker"; { for "_y" from 1 to 9001 do { - _marker = QGVAR(markerID_) + str(_y); + _marker = QGVAR(markerID_) + str _y; if (markerShape _marker isEqualTo "") exitWith {}; }; createMarkerLocal [_marker, [(_position select 0) + (_x select 0 select 0), (_position select 1) + (_x select 0 select 1)]]; @@ -67,21 +67,21 @@ private "_marker"; [[0, 0], [(_size select 0) / 2, (_size select 1) / 2], ["ColorBlack", "Border"]] ]; -private _x1 = (_position select 0) - ((_size select 0) / 2); -private _x2 = (_position select 0) + ((_size select 0) / 2); -_x1 = _x1 + (100 - (_x1 % 100)); -_x2 = _x2 - (_x2 % 100); +private _x1 = (_position select 0) - (_size select 0) / 2; +private _x2 = (_position select 0) + (_size select 0) / 2; +_x1 = _x1 + (100 - _x1 % 100); +_x2 = _x2 - _x2 % 100; -private _y1 = (_position select 1) - ((_size select 1) / 2); -private _y2 = (_position select 1) + ((_size select 1) / 2); -_y1 = _y1 + (100 - (_y1 % 100)); -_y2 = _y2 - (_y2 % 100); +private _y1 = (_position select 1) - (_size select 1) / 2; +private _y2 = (_position select 1) + (_size select 1) / 2; +_y1 = _y1 + (100 - _y1 % 100); +_y2 = _y2 - _y2 % 100; /* Draw Latitude Grid Numbers */ for "_i" from _x1 to _x2 step 100 do { private _symbol = str (_i / 100); - for "-" from 0 to 2 - (count _symbol) do { + for "-" from 0 to 2 - count _symbol do { _symbol = "0" + _symbol; }; @@ -93,7 +93,7 @@ for "_i" from _x1 to _x2 step 100 do { _textWidth = _textWidth + ((_symbol select [_i, _i + 1] call FUNC(mapFont)) select 1) * _scale; }; - if ((_i % 1000) isNotEqualTo 0) then { + if (_i % 1000 isNotEqualTo 0) then { _scale = SCALE(2.5); _symbol = _symbol select [count _symbol - 1, count _symbol]; _textWidth = 0; @@ -101,13 +101,13 @@ for "_i" from _x1 to _x2 step 100 do { }; [ - [_i - (_textWidth / 2), ((_position select 1) + (22 * _scale) + (_size select 1) / 2) + _yOffset], + [_i - _textWidth / 2, ((_position select 1) + 22 * _scale + (_size select 1) / 2) + _yOffset], [0, _scale], [_symbol, "ColorBlack", 1] ] call FUNC(writeText); [ - [_i - (_textWidth / 2), ((_position select 1) - (22 * _scale) - (_size select 1) / 2) - _yOffset], + [_i - _textWidth / 2, ((_position select 1) - 22 * _scale - (_size select 1) / 2) - _yOffset], [0, _scale], [_symbol, "ColorBlack", 1] ] call FUNC(writeText); @@ -117,7 +117,7 @@ for "_i" from _x1 to _x2 step 100 do { for "_i" from _y1 to _y2 step 100 do { private _symbol = str (_i / 100); - for "-" from 0 to 2 - (count _symbol) do { + for "-" from 0 to 2 - count _symbol do { _symbol = "0" + _symbol; }; @@ -127,20 +127,20 @@ for "_i" from _y1 to _y2 step 100 do { _textWidth = _textWidth + ((_symbol select [_i, _i + 1] call FUNC(mapFont)) select 1) * _scale; }; - if ((_i % 1000) isNotEqualTo 0) then { + if (_i % 1000 isNotEqualTo 0) then { _scale = SCALE(2.5); _symbol = _symbol select [count _symbol - 1, count _symbol]; _textWidth = 0; }; [ - [((_position select 0) + (22 * _scale) + (_size select 0) / 2) , _i], + [((_position select 0) + 22 * _scale + (_size select 0) / 2) , _i], [0, _scale], [_symbol, "ColorBlack", 1] ] call FUNC(writeText); [ - [((_position select 0) - (22 * _scale) - (_size select 0) / 2) - _textWidth, _i], + [((_position select 0) - 22 * _scale - (_size select 0) / 2) - _textWidth, _i], [0, _scale], [_symbol, "ColorBlack", 1] ] call FUNC(writeText); @@ -165,7 +165,7 @@ if (isNil "_topBar" || { count _topBar != 3 }) then { if (_forEachIndex isEqualTo 1) then { _scale = SCALE(9); _textWidth = ([_x, _scale] call FUNC(textWidth)); - _textPos = _x1 + (((_x2 - _x1) / 2) - (_textWidth / 2)); + _textPos = _x1 + ((_x2 - _x1) / 2 - _textWidth / 2); }; if (_forEachIndex isEqualTo 2) then { diff --git a/framework/components/map/functions/fn_drawBorder.sqf b/framework/components/map/functions/fn_drawBorder.sqf index c3ef70b..ba97c0d 100644 --- a/framework/components/map/functions/fn_drawBorder.sqf +++ b/framework/components/map/functions/fn_drawBorder.sqf @@ -68,7 +68,7 @@ if (!isNil "_textArray") then { private _lineDir = ((_posArray select _from) getDir (_posArray select _to)); private _textDir = -(_lineDir - 90); private _textWidth = [_text, _scale] call FUNC(textWidth); - private _textPos = (_posArray select _from) getPos [(((_posArray select _from) distance (_posArray select _to)) / 2) - (_textWidth / 2), _lineDir]; + private _textPos = (_posArray select _from) getPos [((_posArray select _from) distance (_posArray select _to)) / 2 - _textWidth / 2, _lineDir]; [ _textPos getPos [_textOffset, _textDir + 90], diff --git a/framework/components/map/functions/fn_hideRespawns.sqf b/framework/components/map/functions/fn_hideRespawns.sqf index a16b08d..ad1f581 100644 --- a/framework/components/map/functions/fn_hideRespawns.sqf +++ b/framework/components/map/functions/fn_hideRespawns.sqf @@ -18,9 +18,9 @@ SCRIPT(hideRespawnMarker); [{ !isNull findDisplay 12 }, { findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", { - if !(SETTING(hideRespawnMarkers)) exitWith {}; + if !SETTING(hideRespawnMarkers) exitWith {}; - if (visibleMap) then { + if visibleMap then { { if (markerShape _x isEqualTo "ICON" && { markerType _x isEqualTo "respawn_inf" }) then { _x setMarkerAlphaLocal 0; diff --git a/framework/components/map/functions/fn_mapTexture.sqf b/framework/components/map/functions/fn_mapTexture.sqf index 049f88e..58bdd27 100644 --- a/framework/components/map/functions/fn_mapTexture.sqf +++ b/framework/components/map/functions/fn_mapTexture.sqf @@ -17,11 +17,11 @@ SCRIPT(mapSwitchTextures); /* Check if it's enabled */ -if !(SETTING(switchMapTextures)) exitWith {}; +if !SETTING(switchMapTextures) exitWith {}; -if ( isDedicated ) exitWith {}; +if isDedicated exitWith {}; [{ !isNull findDisplay 12 }, { /* Press the switch textures button */ - ctrlActivate ( ( findDisplay 12 ) displayCtrl 107 ); + ctrlActivate (findDisplay 12 displayCtrl 107); }] call CBA_fnc_waitUntilAndExecute; \ No newline at end of file diff --git a/framework/components/map/functions/fn_resizeMarkers.sqf b/framework/components/map/functions/fn_resizeMarkers.sqf index 4c66b2e..db24745 100644 --- a/framework/components/map/functions/fn_resizeMarkers.sqf +++ b/framework/components/map/functions/fn_resizeMarkers.sqf @@ -20,9 +20,9 @@ if (!hasInterface) exitWith {}; [{ !isNull findDisplay 12 }, { findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", { - if !(SETTING(consistentMarkers)) exitWith {}; + if !SETTING(consistentMarkers) exitWith {}; - if (visibleMap) then { + if visibleMap then { private _scale = 0.05 / ctrlMapScale (_this select 0); { if (markerShape _x isNotEqualTo "ICON" ) then { continue }; @@ -33,12 +33,12 @@ if (!hasInterface) exitWith {}; }; private _worldModifier = worldSize / 12800; - private _sX = ((((missionNamespace getVariable _m) select 0) * _scale) / _worldModifier) max 0.35; - private _sY = ((((missionNamespace getVariable _m) select 1) * _scale) / _worldModifier) max 0.35; + private _sX = (((missionNamespace getVariable _m) select 0) * _scale) / _worldModifier max 0.35; + private _sY = (((missionNamespace getVariable _m) select 1) * _scale) / _worldModifier max 0.35; private _markerSizeFinal = [_sX, _sY]; /* Check if marker is currently moused over (will reset scale if marker is moused over) */ - (ctrlMapMouseOver (findDisplay 12 displayCtrl 51)) params ["_mouseOverType", "_marker"]; + ctrlMapMouseOver (findDisplay 12 displayCtrl 51) params ["_mouseOverType", "_marker"]; if (_mouseOverType isEqualTo "marker") then { if (_marker isEqualTo _x) then { _markerSizeFinal = missionNamespace getVariable [_m, [1,1]]; @@ -62,7 +62,7 @@ if (!hasInterface) exitWith {}; addMissionEventHandler ["Map", { params ["_mapIsOpened"]; - if !(SETTING(consistentMarkers)) exitWith {}; + if !SETTING(consistentMarkers) exitWith {}; if (!_mapIsOpened) then { private _m = format [QGVAR(marker_size_%1), _x]; diff --git a/framework/components/menu/functions/fn_afk.sqf b/framework/components/menu/functions/fn_afk.sqf index 2d1754b..f2be989 100644 --- a/framework/components/menu/functions/fn_afk.sqf +++ b/framework/components/menu/functions/fn_afk.sqf @@ -19,9 +19,9 @@ private _action = ([QGVAR(safestart_menu), "Toggle AFK Mode", "", { if (!GVAR(isAFK)) then { - private _attachUnitIndex = (units group cmf_player) findIf { _x isNotEqualTo cmf_player && { (cmf_player distance _x) < 10 } }; + private _attachUnitIndex = units group cmf_player findIf { _x isNotEqualTo cmf_player && { cmf_player distance _x < 10 } }; if (_attachUnitIndex isEqualTo -1) exitWith { hintSilent "You must be within 5m of a group member to go AFK" }; - private _attachUnit = (units group cmf_player) select _attachUnitIndex; + private _attachUnit = units group cmf_player select _attachUnitIndex; private _relPos = _attachUnit worldToModelVisual getPos cmf_player; GVAR(afkData) = [_attachUnit, _relPos]; diff --git a/framework/components/menu/functions/fn_bugs.sqf b/framework/components/menu/functions/fn_bugs.sqf index 79c022f..41c0cb1 100644 --- a/framework/components/menu/functions/fn_bugs.sqf +++ b/framework/components/menu/functions/fn_bugs.sqf @@ -31,14 +31,14 @@ private _action = ([QGVAR(bug_menu), "Bug Fixes", "components\menu\data\icon_ace private _playerIds = _players apply { owner _x }; private _playernames = _players apply { name _x }; [LSTRING(select_player_displayname), [["LIST", [LSTRING(players), LSTRING(select_player_tooltip)], [_playerIds, _playernames, 0, 3]]], _onConfirm] call zen_dialog_fnc_create; - }, { (!isNull (getAssignedCuratorLogic player)) || ((call BIS_fnc_admin) > 0) }] call ace_interact_menu_fnc_createAction); + }, { !isNull (getAssignedCuratorLogic player) || call BIS_fnc_admin > 0 }] call ace_interact_menu_fnc_createAction); _actions pushBack [_action, [], _target]; /* Suicide action */ private _action = ([QGVAR(suicide), "Suicide", "a3\ui_f_curator\data\cfgmarkers\kia_ca.paa", { _target spawn { private _result = ["Are you sure?", "Confirm", true, true] call BIS_fnc_guiMessage; - if (_result) then { + if _result then { player setDamage 1; }; }; diff --git a/framework/components/menu/functions/fn_diagnostics.sqf b/framework/components/menu/functions/fn_diagnostics.sqf index 93a9eac..535b5d0 100644 --- a/framework/components/menu/functions/fn_diagnostics.sqf +++ b/framework/components/menu/functions/fn_diagnostics.sqf @@ -17,10 +17,12 @@ params ["_target"]; private _action = ([QGVAR(diag_menu), "Diagnostics", "z\ace\addons\medical_gui\data\categories\advanced_treatment.paa", {}, { true }, { + params ["_target", "_player"]; private _actions = []; /* Client */ private _action = ([QGVAR(client), "Client", "a3\ui_f\data\gui\rsc\rscdisplaymultiplayersetup\disabledai_ca.paa", {}, { true }, { + params ["_target", "_player"]; private _actions = []; /* FPS */ @@ -32,25 +34,25 @@ private _action = ([QGVAR(diag_menu), "Diagnostics", "z\ace\addons\medical_gui\d _actions pushBack [_action, [], _target]; /* Spawned scripts */ - private _action = ([QGVAR(fps), "Spawned Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { + _action = ([QGVAR(fps), "Spawned Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { (_this select 3) set [1, format ["Spawn Scripts: %1", diag_activeScripts select 0]] }] call ace_interact_menu_fnc_createAction); _actions pushBack [_action, [], _target]; /* execVM scripts */ - private _action = ([QGVAR(fps), "ExecVM Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { + _action = ([QGVAR(fps), "ExecVM Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { (_this select 3) set [1, format ["ExecVM Scripts: %1", diag_activeScripts select 1]] }] call ace_interact_menu_fnc_createAction); _actions pushBack [_action, [], _target]; - /* exec scripts */ - private _action = ([QGVAR(fps), "Exec Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { + /* execute scripts */ + _action = ([QGVAR(fps), "Exec Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { (_this select 3) set [1, format ["Exec Scripts: %1", diag_activeScripts select 2]] }] call ace_interact_menu_fnc_createAction); _actions pushBack [_action, [], _target]; /* execFSM scripts */ - private _action = ([QGVAR(fps), "ExecFSM Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { + _action = ([QGVAR(fps), "ExecFSM Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { (_this select 3) set [1, format ["ExecFSM Scripts: %1", diag_activeScripts select 3]] }] call ace_interact_menu_fnc_createAction); _actions pushBack [_action, [], _target]; @@ -60,7 +62,8 @@ private _action = ([QGVAR(diag_menu), "Diagnostics", "z\ace\addons\medical_gui\d _actions pushBack [_action, [], _target]; /* Server */ - private _action = ([QGVAR(server), "Server", "a3\3den\data\displays\display3den\statusbar\server_ca.paa", {}, { !isServer }, { + _action = ([QGVAR(server), "Server", "a3\3den\data\displays\display3den\statusbar\server_ca.paa", {}, { !isServer }, { + params ["_target", "_player"]; private _actions = []; /* FPS */ @@ -70,25 +73,25 @@ private _action = ([QGVAR(diag_menu), "Diagnostics", "z\ace\addons\medical_gui\d _actions pushBack [_action, [], _target]; /* Spawned scripts */ - private _action = ([QGVAR(fps), "Spawned Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { + _action = ([QGVAR(fps), "Spawned Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { (_this select 3) set [1, format ["Spawn Scripts: %1", (missionNamespace getVariable [QEGVAR(diagnostic,serverScripts), ["?","?","?","?"]]) select 0]] }] call ace_interact_menu_fnc_createAction); _actions pushBack [_action, [], _target]; /* execVM scripts */ - private _action = ([QGVAR(fps), "ExecVM Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { + _action = ([QGVAR(fps), "ExecVM Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { (_this select 3) set [1, format ["ExecVM Scripts: %1", (missionNamespace getVariable [QEGVAR(diagnostic,serverScripts), ["?","?","?","?"]]) select 1]] }] call ace_interact_menu_fnc_createAction); _actions pushBack [_action, [], _target]; - /* exec scripts */ - private _action = ([QGVAR(fps), "Exec Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { + /* execute scripts */ + _action = ([QGVAR(fps), "Exec Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { (_this select 3) set [1, format ["Exec Scripts: %1", (missionNamespace getVariable [QEGVAR(diagnostic,serverScripts), ["?","?","?","?"]]) select 2]] }] call ace_interact_menu_fnc_createAction); _actions pushBack [_action, [], _target]; /* execFSM scripts */ - private _action = ([QGVAR(fps), "ExecFSM Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { + _action = ([QGVAR(fps), "ExecFSM Scripts:", "a3\3den\data\cfgwaypoints\scripted_ca.paa", { }, { true }, { }, [], "", 4, [false, false, false, true, false], { (_this select 3) set [1, format ["ExecFSM Scripts: %1", (missionNamespace getVariable [QEGVAR(diagnostic,serverScripts), ["?","?","?","?"]]) select 3]] }] call ace_interact_menu_fnc_createAction); _actions pushBack [_action, [], _target]; @@ -98,7 +101,7 @@ private _action = ([QGVAR(diag_menu), "Diagnostics", "z\ace\addons\medical_gui\d _actions pushBack [_action, [], _target]; /* Error Count */ - private _action = ([QGVAR(fps), "Errors: 0", ["a3\ui_f\data\igui\cfg\simpletasks\types\documents_ca.paa", (EGVAR(common,notificationColors) get "ERROR") call BIS_fnc_colorRGBtoHTML], { + _action = ([QGVAR(fps), "Errors: 0", ["a3\ui_f\data\igui\cfg\simpletasks\types\documents_ca.paa", (EGVAR(common,notificationColors) get "ERROR") call BIS_fnc_colorRGBtoHTML], { ([] call BIS_fnc_displayMission) createDisplay "CMF_RscLog"; }, { true }, { }, [], "", 4, [false, false, false, true, false], { (_this select 3) set [1, format ["Errors: %1", count EGVAR(diagnostic,errorOut)]] diff --git a/framework/components/menu/functions/fn_hideHUD.sqf b/framework/components/menu/functions/fn_hideHUD.sqf index 1caf8c8..76bdb37 100644 --- a/framework/components/menu/functions/fn_hideHUD.sqf +++ b/framework/components/menu/functions/fn_hideHUD.sqf @@ -15,7 +15,7 @@ * Public: No */ -if (is3DEN) exitWith {}; +if is3DEN exitWith {}; private _action = [ QGVAR(toggleHUD), @@ -34,7 +34,7 @@ private _action = [ /* Toggle the HUD */ private _staminaBarContainer = uiNamespace getVariable ["ace_advanced_fatigue_staminaBarContainer", controlNull]; - if (GVAR(hud_show)) then { + if GVAR(hud_show) then { GVAR(hud_show) = false; diff --git a/framework/components/menu/functions/fn_safestart.sqf b/framework/components/menu/functions/fn_safestart.sqf index 69dacde..2c09124 100644 --- a/framework/components/menu/functions/fn_safestart.sqf +++ b/framework/components/menu/functions/fn_safestart.sqf @@ -29,9 +29,9 @@ private _action = ([QGVAR(safestart_menu), }] remoteExec ["spawn", 0]; }, { - is3DENPreview || (!(missionNamespace getVariable [QEGVAR(gameplay,safestart_Countdown), false]) && - { !isNull (getAssignedCuratorLogic player) }) || ((call BIS_fnc_admin) > 0 && - { !(missionNamespace getVariable [QEGVAR(gameplay,safestart_Countdown), false]) }) + is3DENPreview || !(missionNamespace getVariable [QEGVAR(gameplay,safestart_Countdown), false] && + { !isNull (getAssignedCuratorLogic player) }) || call BIS_fnc_admin > 0 && + { !(missionNamespace getVariable [QEGVAR(gameplay,safestart_Countdown), false]) } } ] call ace_interact_menu_fnc_createAction); diff --git a/framework/components/menu/initKeybinds.sqf b/framework/components/menu/initKeybinds.sqf index dde8776..49ef906 100644 --- a/framework/components/menu/initKeybinds.sqf +++ b/framework/components/menu/initKeybinds.sqf @@ -13,7 +13,7 @@ /* Toggle the HUD */ private _staminaBarContainer = uiNamespace getVariable ["ace_advanced_fatigue_staminaBarContainer", controlNull]; - if (GVAR(hud_show)) then { + if GVAR(hud_show) then { GVAR(hud_show) = false; diff --git a/framework/components/organization/XEH_postInit.sqf b/framework/components/organization/XEH_postInit.sqf index 9ef9d1a..9c77771 100644 --- a/framework/components/organization/XEH_postInit.sqf +++ b/framework/components/organization/XEH_postInit.sqf @@ -5,7 +5,7 @@ GVAR(phoneticAlphabet) = ["Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whisky", "Xray", "Yankee", "Zulu"]; /* Add groupVehicles */ -if (isServer) then { +if isServer then { /* Create groups hash for dynamic group system */ GVAR(groups) = [[ [west, [] call CBA_fnc_hashCreate], @@ -53,7 +53,7 @@ if (isServer) then { [_group, _vehicle] call FUNC(groupAssignVehicle); - if (_children) then { + if _children then { { [_x, _vehicle] call FUNC(groupAssignVehicle); } forEach (_groupData select 3); diff --git a/framework/components/organization/functions/fn_3denUnitSpawner.sqf b/framework/components/organization/functions/fn_3denUnitSpawner.sqf index 2e44b71..f159153 100644 --- a/framework/components/organization/functions/fn_3denUnitSpawner.sqf +++ b/framework/components/organization/functions/fn_3denUnitSpawner.sqf @@ -42,7 +42,7 @@ private _spawnScript = {_this spawn { private _groupOffset = _groupOffset + _unitGroupOffset; private _unit = objNull; - if (_isLeader) then { + if _isLeader then { _unit = create3DENEntity ["Object", _class, [_unitOffset, _groupOffset, 0]]; _unitGroup = group _unit; } else { diff --git a/framework/components/organization/functions/fn_ToE.sqf b/framework/components/organization/functions/fn_ToE.sqf index 8ad540e..8ca873b 100644 --- a/framework/components/organization/functions/fn_ToE.sqf +++ b/framework/components/organization/functions/fn_ToE.sqf @@ -65,7 +65,7 @@ }; if (_groupVehicle isNotEqualTo _vehicle) then { - private _vehicleName = [configFile >> "CfgVehicles" >> (typeof _groupVehicle)] call BIS_fnc_displayName; + private _vehicleName = [configFile >> "CfgVehicles" >> typeof _groupVehicle] call BIS_fnc_displayName; _formattedString = _formattedString + _indent + format [" %1
", _vehicleName]; _vehicle = _groupVehicle; }; @@ -74,13 +74,13 @@ if (isPlayer _x) then { private _roleDescription = "None"; if (roleDescription _x != "") then { - _roleDescription = ((roleDescription _x) splitString "@") select 0; + _roleDescription = (roleDescription _x splitString "@") select 0; }; _formattedString = _formattedString + _indent + format [" %1, %2
", name _x, _roleDescription]; } else { private _role = [_x] call EFUNC(kosherAI,getRole); - private _roleDescription = (createHashMapFromArray [ + private _roleDescription = createHashMapFromArray [ ["CRW", "Crewman"], ["RPIL", "Pilot"], ["WPIL", "Pilot"], @@ -90,7 +90,7 @@ ["MG", "Machinegunner"], ["MAR", "Marksman"], ["SL", "Leader"] - ]) getOrDefault [_role, "Rifleman"]; + ] getOrDefault [_role, "Rifleman"]; _formattedString = _formattedString + _indent + format [" [AI] %1, %2
", name _x, _roleDescription]; }; diff --git a/framework/components/organization/functions/fn_groupAssignVehicle.sqf b/framework/components/organization/functions/fn_groupAssignVehicle.sqf index 516a682..f4a4b04 100644 --- a/framework/components/organization/functions/fn_groupAssignVehicle.sqf +++ b/framework/components/organization/functions/fn_groupAssignVehicle.sqf @@ -35,7 +35,7 @@ if (_group isEqualType []) exitWith { /* Check if group already exists and then assign vehicle */ private _groupsHash = [GVAR(groups), _side, [] call CBA_fnc_hashCreate] call CBA_fnc_hashGet; private _candidates = [_groupsHash, _level, []] call CBA_fnc_hashGet; - _candidates = _candidates select { (count units _x) > 0 }; + _candidates = _candidates select { count units _x > 0 }; if (_type isNotEqualTo "") then { _candidates = _candidates select { (([_x] call FUNC(groupGetData)) select 1) isEqualTo _type }; @@ -51,7 +51,7 @@ if (_group isEqualType []) exitWith { [_testGroup, _vehicle] call FUNC(groupAssignVehicle); - if (_children) then { + if _children then { { [_x, _vehicle] call FUNC(groupAssignVehicle); } forEach (_testGroupData select 3); diff --git a/framework/components/organization/functions/fn_groupGetIndex.sqf b/framework/components/organization/functions/fn_groupGetIndex.sqf index 7a2a9cc..f02e065 100644 --- a/framework/components/organization/functions/fn_groupGetIndex.sqf +++ b/framework/components/organization/functions/fn_groupGetIndex.sqf @@ -28,9 +28,9 @@ private _siblings = [_groupsHash, _level, []] call CBA_fnc_hashGet; */ private _parentData = [_parent] call FUNC(groupGetData); _parentData params ["", "", "", "_siblings"]; -_siblings = _siblings select { (count units _x) > 0 }; +_siblings = _siblings select { count units _x > 0 }; -if (_filter) then { +if _filter then { _siblings = _siblings select { (([_x] call FUNC(groupGetData)) select 1) isEqualTo _type }; }; diff --git a/framework/components/organization/functions/fn_groupIsRegistered.sqf b/framework/components/organization/functions/fn_groupIsRegistered.sqf index 87e8e18..0ac5539 100644 --- a/framework/components/organization/functions/fn_groupIsRegistered.sqf +++ b/framework/components/organization/functions/fn_groupIsRegistered.sqf @@ -16,4 +16,4 @@ */ params ["_group"]; -(([_group] call FUNC(groupGetData)) select 0) > -1 \ No newline at end of file +[_group] call FUNC(groupGetData) select 0 > -1 \ No newline at end of file diff --git a/framework/components/organization/functions/fn_groupSetName.sqf b/framework/components/organization/functions/fn_groupSetName.sqf index ec9142a..7c825e6 100644 --- a/framework/components/organization/functions/fn_groupSetName.sqf +++ b/framework/components/organization/functions/fn_groupSetName.sqf @@ -40,7 +40,7 @@ if (!isNil "_names") then { [[_groupID, _colors select 0, _colors select 1], ace_map_gestures_fnc_addGroupColorMapping] remoteExec ["call", 0, true]; /* Handle 3DEN */ - if (is3DEN) then { + if is3DEN then { _group set3DENAttribute ["groupID", _names select 2]; { private _roleName = _x get3DENAttribute "description"; diff --git a/framework/components/organization/functions/fn_groupSetup.sqf b/framework/components/organization/functions/fn_groupSetup.sqf index 726b2f3..6456151 100644 --- a/framework/components/organization/functions/fn_groupSetup.sqf +++ b/framework/components/organization/functions/fn_groupSetup.sqf @@ -37,37 +37,37 @@ if (scriptDone GVAR(groupSetupScript)) then { private _isPlayerGroup = { params ["_group"]; - if (is3DEN) exitWith { - ((units _group) findIf { (_x get3DENAttribute "ControlMP") select 0 }) > -1 + if is3DEN exitWith { + units _group findIf { (_x get3DENAttribute "ControlMP") select 0 } > -1 }; - ((units _group) findIf { isPlayer _x }) > -1 + units _group findIf { isPlayer _x } > -1 }; private _groupData = [_group] call FUNC(groupGetData); /* private _isEmpty = (count units _group) isEqualTo 0; */ private _hierArchyOptions = _groupData param [5, [false, false]]; - if (((_groupData select 0) isEqualTo -1) /* || _isEmpty */) then { continue }; + if ((_groupData select 0) isEqualTo -1 /* || _isEmpty */) then { continue }; private _groupsHash = [GVAR(groups), side _group, [] call CBA_fnc_hashCreate] call CBA_fnc_hashGet; private _typeOrbat = [GVAR(orbat), (_groupData select 1)] call CBA_fnc_hashGet; private _levelOrbat = [_typeOrbat select 0, (_groupData select 0)] call CBA_fnc_hashGet; /* Assign children */ - if (([_levelOrbat select 1, _groupData select 1, 0] call CBA_fnc_hashGet) > 0) then { + if ([_levelOrbat select 1, _groupData select 1, 0] call CBA_fnc_hashGet > 0) then { private _subLevels = [_groupsHash, (_groupData select 0) - 1, []] call CBA_fnc_hashGet; private _i = 0; - while { _i < count _subLevels && { ([_levelOrbat select 1, _groupData select 1, 0] call CBA_fnc_hashGet) > count (_groupData select 3) } } do { + while { _i < count _subLevels && { [_levelOrbat select 1, _groupData select 1, 0] call CBA_fnc_hashGet > count (_groupData select 3) } } do { private _subGroup = _subLevels select _i; private _subGroupData = [_subGroup] call FUNC(groupGetData); _subGroupHierArchyOptions = _subGroupData param [5, [false, false]]; if ( - (!(_hierArchyOptions param [0, false]) && { !(_subGroupHierArchyOptions param [0, false]) }) || - ((_hierArchyOptions param [0, false]) && { [_subGroup] call _isPlayerGroup }) && - { (_subGroupHierArchyOptions param [0, false]) && { [_group] call _isPlayerGroup } } + !(_hierArchyOptions param [0, false]) && { !(_subGroupHierArchyOptions param [0, false]) } || + (_hierArchyOptions param [0, false] && { [_subGroup] call _isPlayerGroup }) && + { _subGroupHierArchyOptions param [0, false] && { [_group] call _isPlayerGroup } } ) then { if ((_subGroupData select 1) isEqualTo (_groupData select 1) && { isNull (_subGroupData select 2) /* && { (count units _subGroup) > 0 } */ }) then { (_groupData select 3) pushBack _subGroup; @@ -96,9 +96,9 @@ if (scriptDone GVAR(groupSetupScript)) then { private _typeCount = { (([_x] call FUNC(groupGetData)) select 1) isEqualTo (_groupData select 1) } count (_surGroupData select 3); if ( - (!(_hierArchyOptions param [1, false]) && { !(_surGroupHierArchyOptions param [0, false]) }) || - ((_hierArchyOptions param [1, false]) && { [_surGroup] call _isPlayerGroup }) && - { (_surGroupHierArchyOptions param [0, false]) && { [_group] call _isPlayerGroup } } + !(_hierArchyOptions param [1, false]) && { !(_surGroupHierArchyOptions param [0, false]) } || + (_hierArchyOptions param [1, false] && { [_surGroup] call _isPlayerGroup }) && + { _surGroupHierArchyOptions param [0, false] && { [_group] call _isPlayerGroup } } ) then { if (_typeAmount > _typeCount /* && { (count units _surGroup) > 0 } */) then { (_surGroupData select 3) pushBack _group; @@ -110,7 +110,7 @@ if (scriptDone GVAR(groupSetupScript)) then { if (!isNull (_groupData select 2)) exitWith {}; - if (isNil "_smallestCount" || { _typeCount < (_smallestCount select 0) }) then { + if (isNil "_smallestCount" || { _typeCount < _smallestCount select 0 }) then { _smallestCount = [_typeCount, _surGroup]; }; } forEach _surLevels; @@ -120,7 +120,7 @@ if (scriptDone GVAR(groupSetupScript)) then { private _surGroup = (_smallestCount select 1); private _surGroupData = [_surGroup] call FUNC(groupGetData); - if (true /* (count units _surGroup) > 0 */) then { + if true /* (count units _surGroup) > 0 */ then { (_surGroupData select 3) pushBack _group; _groupData set [2, _surGroup]; [_surGroup, _surGroupData] call FUNC(groupSetData); diff --git a/framework/components/organization/functions/fn_groupUnregister.sqf b/framework/components/organization/functions/fn_groupUnregister.sqf index 6427844..4a4538a 100644 --- a/framework/components/organization/functions/fn_groupUnregister.sqf +++ b/framework/components/organization/functions/fn_groupUnregister.sqf @@ -31,7 +31,7 @@ publicVariable QGVAR(groups); { private _childData = [_x] call FUNC(groupGetData); - if ((_childData select 0) > -1) then { + if (_childData select 0 > -1) then { _childData set [2, grpNull]; _x setVariable [QGVAR(groupData), _childData, true]; }; @@ -39,7 +39,7 @@ publicVariable QGVAR(groups); /* Unregister parents */ private _parentData = [(_groupData select 2)] call FUNC(groupGetData); -if ((_parentData select 0) > -1) then { +if (_parentData select 0 > -1) then { (_parentData select 3) deleteAt ((_parentData select 3) find _group); [(_groupData select 2), _parentData] call FUNC(groupSetData); }; diff --git a/framework/components/organization/functions/fn_roster.sqf b/framework/components/organization/functions/fn_roster.sqf index bac4d2c..2b67862 100644 --- a/framework/components/organization/functions/fn_roster.sqf +++ b/framework/components/organization/functions/fn_roster.sqf @@ -42,7 +42,7 @@ { private _groups = [_groupHash, _x, []] call CBA_fnc_hashGet; - if ((_groups findIf { (units _x findIf { isPlayer _x }) > -1 }) > -1) exitWith { + if (_groups findIf { units _x findIf { isPlayer _x } > -1 } > -1) exitWith { _topLevelGroups = _groups; }; } forEach _levels; @@ -75,7 +75,7 @@ if (isPlayer _x) then { private _roleDescription = "None"; if (roleDescription _x != "") then { - _roleDescription = ((roleDescription _x) splitString "@") select 0; + _roleDescription = (roleDescription _x splitString "@") select 0; }; _formattedString = _formattedString + _indent + format [" %1, %2
", name _x, _roleDescription]; @@ -97,7 +97,7 @@ }, "DESCEND"] call BIS_fnc_sortBy; { - if (((units _x) findIf { isPlayer _x }) > -1) then { + if (units _x findIf { isPlayer _x } > -1) then { _formattedString = _formattedString + ([_x, _indent] call FUNC(ToE_recursiveCheck)); } } forEach _children; @@ -108,7 +108,7 @@ { private _group = _x; - if (((units _group) findIf { isPlayer _x }) > -1) then { + if (units _group findIf { isPlayer _x } > -1) then { private _groupNames = _group getVariable [QGVAR(groupName), ["UNKNOWN", "UNKNOWN"]]; private _formattedString = "
"; diff --git a/framework/components/organization/functions/fn_warno.sqf b/framework/components/organization/functions/fn_warno.sqf index 677cb2a..c5cc9c4 100644 --- a/framework/components/organization/functions/fn_warno.sqf +++ b/framework/components/organization/functions/fn_warno.sqf @@ -55,7 +55,7 @@ if (!fileExists "WARNO.sqf") exitWith {}; _warno = _warno apply { _parsed = [_x, true] call EFUNC(common,parseMarkdown); _parsed = [_parsed, [_parsed, 5] call BIS_fnc_trimString] select (_parsed select [0, 5] isEqualTo "
"); - [_parsed, [_parsed, 0, (count _parsed) - 5] call BIS_fnc_trimString] select (_parsed select [(count _parsed) - 5, 5] isEqualTo "
") + [_parsed, [_parsed, 0, count _parsed - 5] call BIS_fnc_trimString] select (_parsed select [count _parsed - 5, 5] isEqualTo "
") }; player createDiaryRecord ["Diary", ["Command / Signal", (_warno select 4)/* + "

" + _organization */]]; diff --git a/framework/components/organization/shacktacInit.sqf b/framework/components/organization/shacktacInit.sqf index 6a675ab..b2ec42c 100644 --- a/framework/components/organization/shacktacInit.sqf +++ b/framework/components/organization/shacktacInit.sqf @@ -1,16 +1,18 @@ +#pragma sls disable VV-001 +#pragma sls disable VV-006 STHud_Namelist = { params ["_canvas"]; /* Create new column for name positions */ private _uiXDist = ((STHud_Namepos select 6) select 0) - ((STHud_Namepos select 0) select 0); - for "_i" from (count STHud_Namepos) - 6 to (count STHud_Namepos) - 1 do { + for "_i" from count STHud_Namepos - 6 to count STHud_Namepos - 1 do { private _prevColX = (STHud_Namepos select _i) select 0; private _prevColY = (STHud_Namepos select _i) select 1; STHud_Namepos pushBack [_prevColX + _uiXDist, _prevColY]; }; /* Create new column for selection positions */ - for "_i" from (count STHud_Selectpos) - 6 to (count STHud_Selectpos) - 1 do { + for "_i" from count STHud_Selectpos - 6 to count STHud_Selectpos - 1 do { private _prevColX = (STHud_Selectpos select _i) select 0; private _prevColY = (STHud_Selectpos select _i) select 1; STHud_Selectpos pushBack [_prevColX + _uiXDist, _prevColY]; @@ -23,36 +25,36 @@ STHud_Namelist = { private _parentData = [(_groupData select 2)] call cmf_organization_fnc_groupGetData; /* Add parent if is less than level 2 */ - if ( !isNull (_groupData select 2) && { (_parentData select 0) < 2 }) then { - _allUnits append (units (_groupData select 2)); + if ( !isNull (_groupData select 2) && { _parentData select 0 < 2 }) then { + _allUnits append units (_groupData select 2); /* Add children of parent */ { - private _childData = [_x] call cmf_organization_fnc_groupGetData; + // private _childData = [_x] call cmf_organization_fnc_groupGetData; - _allUnits append (units _x); + _allUnits append units _x; } forEach (_parentData select 3); } else { /* Add own group */ - _allUnits append (units player); + _allUnits append units player; }; /* Add children */ { private _childData = [_x] call cmf_organization_fnc_groupGetData; - if ((_childData select 0) <= 0) then { - _allUnits append (units _x); + if (_childData select 0 <= 0) then { + _allUnits append units _x; }; } forEach (_groupData select 3); } else { - _allUnits append (units player); + _allUnits append units player; }; private _units = [] call CBA_fnc_hashCreate; private _unitsCount = 0; { - if (alive(_x) || {!isNil {_x getVariable "sth_name"}}) then { + if (alive _x || {!isNil {_x getVariable "sth_name"}}) then { _oldUnits = [_units, group _x, []] call CBA_fnc_hashGet; _oldUnits pushBack [_x, _x call STHud_Colour_Text]; _units = [_units, group _x, _oldUnits] call CBA_fnc_hashSet; @@ -64,17 +66,18 @@ STHud_Namelist = { // Could expand this to check if the player is a driver, gunner, or commander, but I don't recall what exactly is needed to check to catch multiple turrets etc while excluding FFV. if (STHud_ShowBearingInVehicle && {vehicle player != player}) then { - private _viewVec = positionCameratoWorld [0,0,0] vectorFromTo (positionCameraToWorld [0,0,50]); + private _viewVec = positionCameratoWorld [0,0,0] vectorFromTo positionCameraToWorld [0,0,50]; private _bearing = ((_viewVec select 0) atan2 (_viewVec select 1) + 360) % 360; private _bearingBase = (str round _bearing); - private _bearingPretty = ""; - + + private "_bearingPretty"; switch (count _bearingBase) do { - case 1: {_bearingPretty = "00" + _bearingBase}; - case 2: {_bearingPretty = "0" + _bearingBase}; - case 3: {_bearingPretty = _bearingBase}; + case 1: { _bearingPretty = "00" + _bearingBase }; + case 2: { _bearingPretty = "0" + _bearingBase }; + case 3: { _bearingPretty = _bearingBase }; + default { _bearingPretty = "" }; }; private _bearingColour = [[1,1,1,.9], "STUI_Unconscious_Fade_HUD_Bearing"] call STHud_UnconsciousColourFade; @@ -98,11 +101,11 @@ STHud_Namelist = { private _group = _x; private _groupUnits = [_units, _group, []] call CBA_fnc_hashGet; private _groupName = (_group getVariable ["cmf_organization_groupName", [groupId _group]]) select 0; - private _groupData = [_group] call cmf_organization_fnc_groupGetData; + // private _groupData = [_group] call cmf_organization_fnc_groupGetData; _groupUnits = [_groupUnits, [], { - if ((leader group (_x select 0)) isEqualTo (_x select 0)) exitWith { 0 }; - if ((assignedTeam leader group (_x select 0)) isEqualTo (assignedTeam (_x select 0))) exitWith { 1 }; + if (leader group (_x select 0) isEqualTo (_x select 0)) exitWith { 0 }; + if (assignedTeam leader group (_x select 0) isEqualTo assignedTeam (_x select 0)) exitWith { 1 }; switch (_x select 1) do { case [1,1,1,1]: { 2 }; @@ -115,14 +118,14 @@ STHud_Namelist = { }] call BIS_fnc_sortBy; /* Don't display parent group above squadlevel*/ - if ((_playerGroupData select 0) > 1 && { _group isEqualTo (_playerGroupData select 2) }) then { + if (_playerGroupData select 0 > 1 && { _group isEqualTo (_playerGroupData select 2) }) then { continue; }; /* Draw group on new column */ - if ((_playerGroupData select 0) < 2) then { - if (_unitIndex != 0 && { (_unitIndex % 6) isNotEqualTo 0 }) then { - _unitIndex = _unitIndex + (6 - (_unitIndex % 6)); + if (_playerGroupData select 0 < 2) then { + if (_unitIndex != 0 && { _unitIndex % 6 isNotEqualTo 0 }) then { + _unitIndex = _unitIndex + (6 - _unitIndex % 6); }; }; @@ -134,7 +137,7 @@ STHud_Namelist = { }; /* Add Group name */ - if (_unitIndex > (count STHud_Namepos) - 1) exitWith {}; + if (_unitIndex > count STHud_Namepos - 1) exitWith {}; _canvas drawIcon [ "#(argb,1,1,1)color(0,0,0,0)", _groupColor, STHud_Namepos select _unitIndex, @@ -146,21 +149,21 @@ STHud_Namelist = { { _x params ["_unit", "_colour"]; - if (_unitIndex > (count STHud_Namepos) - 1) exitWith {}; + if (_unitIndex > count STHud_Namepos - 1) exitWith {}; - private _isUnitSelected = if ([player] call STHUD_IsGroupLeader) then {_unit in (groupSelectedUnits player)} else {false}; // Check if they're leader, if not, ignore. - private _selIndicator = ""; - if (_isUnitSelected) then { _selIndicator = "> " }; // Tried this on the left and right. Being on the left seems to make it 'pop' more. + private _isUnitSelected = if ([player] call STHUD_IsGroupLeader) then {_unit in groupSelectedUnits player} else {false}; // Check if they're leader, if not, ignore. + private ["_selIndicator"]; + if _isUnitSelected then { _selIndicator = "> " }; // Tried this on the left and right. Being on the left seems to make it 'pop' more. private _icon = [_unit, false] call STHud_Icon; private _finalName = ([_unit, _fullName] call STHud_GetName); - if (STHud_NoSquadBarMode) then {_finalName = _selIndicator + _finalName;}; + if STHud_NoSquadBarMode then {_finalName = _selIndicator + _finalName;}; if (count (groupSelectedUnits player) > 0 && STHud_NoSquadBarMode && { _unit in units player }) then { private _tempName = vehicleVarName _unit; _unit setVehicleVarName ""; - private _strName = str(_x); + private _strName = str _x; _unit setVehicleVarName _tempName; private _pl = _strName find ":"; private _numStr = _strName select [_pl +1,2]; @@ -209,7 +212,7 @@ STHud_Namelist = { "#(argb,1,1,1)color(0,0,0,0)", _groupNameColour, STHud_GroupNamePos, 16, 16, 0, - group(player) getVariable ["STMF_GroupID", ""], STHud_TextShadow, 0.035, STHud_Font, "Right" + group player getVariable ["STMF_GroupID", ""], STHud_TextShadow, 0.035, STHud_Font, "Right" ]; }; }; @@ -217,17 +220,17 @@ STHud_Namelist = { /* Set icon dynamically */ STHud_IsAttendant = { params ["_type", "_unit"]; - (getNumber(configFile >> "CfgVehicles" >> _type >> "attendant") isEqualTo 1) || (_unit getVariable ["ace_medical_medicClass", 0] > 0); + getNumber(configFile >> "CfgVehicles" >> _type >> "attendant") isEqualTo 1 || _unit getVariable ["ace_medical_medicClass", 0] > 0; }; STHud_IsEngineer = { params ["_type", "_unit"]; - (getNumber(configFile >> "CfgVehicles" >> _type >> "engineer") isEqualTo 1) || (_unit getVariable ["ACE_IsEngineer", 0] > 0); + getNumber(configFile >> "CfgVehicles" >> _type >> "engineer") isEqualTo 1 || _unit getVariable ["ACE_IsEngineer", 0] > 0; }; STHud_IsEOD = { params ["_type", "_unit"]; - (getNumber(configFile >> "CfgVehicles" >> _type >> "canDeactivateMines") isEqualTo 1) || (_unit getVariable ["ACE_IsEOD", 0] > 0); + getNumber(configFile >> "CfgVehicles" >> _type >> "canDeactivateMines") isEqualTo 1 || _unit getVariable ["ACE_IsEOD", 0] > 0; }; STHud_Icon = { @@ -237,8 +240,8 @@ STHud_Icon = { //we only want to change the role icon next to their name on the HUD if (vehicle _unit != _unit && !_disableVehicleIcons) exitWith { //selecting this specific _unit from vehicle crew array and determining role - private _crewInfo = ((fullCrew (vehicle _unit)) select {_x select 0 isEqualTo _unit}) select 0; - _crewInfo params ["", "_role", "_index", "_turretPath", "_isTurret"]; + private _crewInfo = (fullCrew (vehicle _unit) select {_x select 0 isEqualTo _unit}) select 0; + _crewInfo params ["", "_role", "", "", "_isTurret"]; if (_role isEqualTo "cargo") exitWith { "a3\ui_f\data\igui\cfg\commandbar\imagecargo_ca.paa" }; @@ -258,7 +261,7 @@ STHud_Icon = { }; //gunners and sometimes copilots - if (_role isEqualTo "gunner" || (_role isEqualTo "turret" && !_isTurret)) exitWith { + if (_role isEqualTo "gunner" || _role isEqualTo "turret" && !_isTurret) exitWith { "a3\ui_f\data\igui\cfg\commandbar\imagegunner_ca.paa" }; @@ -267,50 +270,50 @@ STHud_Icon = { }; }; - if (leader(_unit) isEqualTo _unit) exitWith { + if (leader _unit isEqualTo _unit) exitWith { "\A3\ui_f\data\map\vehicleicons\iconManLeader_ca.paa"; }; - private _type = typeof(_unit); - private _isatd = player getVariable ("isatd_"+_type); + private _type = typeof _unit; + private _isatd = player getVariable "isatd_" + _type; _isatd = [_type, _unit] call STHud_IsAttendant; player setVariable ["isatd_" + _type, _isatd]; - if (_isatd) exitWith { + if _isatd exitWith { "\A3\ui_f\data\map\vehicleicons\iconManMedic_ca.paa"; }; - private _type = typeof(_unit); - private _iseng = player getVariable ("iseng_"+_type); + private _type = typeof _unit; + private _iseng = player getVariable "iseng_" + _type; _iseng = [_type, _unit] call STHud_IsEngineer; player setVariable ["iseng_" + _type, _iseng]; - if (_iseng) exitWith { + if _iseng exitWith { "\A3\ui_f\data\map\vehicleicons\iconManEngineer_ca.paa"; }; - private _type = typeof(_unit); - private _isEOD = player getVariable ("isEOD_"+_type); + private _type = typeof _unit; + private _isEOD = player getVariable "isEOD_" + _type; _isEOD = [_type, _unit] call STHud_IsEOD; player setVariable ["isEOD_" + _type, _isEOD]; - if (_isEOD) exitWith { + if _isEOD exitWith { "\A3\ui_f\data\map\vehicleicons\iconManExplosive_ca.paa"; }; - private _prim = primaryWeapon(_unit); - private _ismg = player getVariable ("ismg_" + _prim); + private _prim = primaryWeapon _unit; + private _ismg = player getVariable "ismg_" + _prim; if (isNil {_ismg}) then { _ismg = _prim call STHud_IsMG; player setVariable ["ismg_" + _prim, _ismg]; }; - if (_ismg) exitWith { + if _ismg exitWith { "\A3\ui_f\data\map\vehicleicons\iconManMG_ca.paa"; }; private _BadArr = ["UK3CB_BAF_L16_Tripod", "UK3CB_BAF_L111A1", "UK3CB_BAF_L134A1", "UK3CB_BAF_M6", "UK3CB_BAF_Tripod"]; - private _sec = secondaryWeapon(_unit); - private _isat = player getVariable ("isat_"+_sec); + private _sec = secondaryWeapon _unit; + private _isat = player getVariable "isat_"+_sec; if (isNil {_isat}) then { - if ((_BadArr find _sec) <= 0) then { + if (_BadArr find _sec <= 0) then { _isat = _sec call STHud_IsAT; }; player setVariable ["isat_"+_sec, _isat]; diff --git a/framework/components/player/XEH_postInit.sqf b/framework/components/player/XEH_postInit.sqf index 70c6cd0..c38db0b 100644 --- a/framework/components/player/XEH_postInit.sqf +++ b/framework/components/player/XEH_postInit.sqf @@ -14,7 +14,7 @@ if (_unit != player) exitWith { }; - if (_active) then { + if _active then { if (!isNil "acre_api_fnc_setGlobalVolume") then { private _acreGlobalVolume = [] call acre_api_fnc_getGlobalVolume; if (isNil "_acreGlobalVolume") then { _acreGlobalVolume = 1 }; diff --git a/framework/components/player/functions/fn_drinking.sqf b/framework/components/player/functions/fn_drinking.sqf index 02eb06c..ee69f1f 100644 --- a/framework/components/player/functions/fn_drinking.sqf +++ b/framework/components/player/functions/fn_drinking.sqf @@ -29,8 +29,8 @@ SCRIPT(drinking); private _itemData = [[GVAR(drinking_hydrationItems)] call CBA_fnc_hashCreate, _item] call CBA_fnc_hashGet; private _objClass = _itemData select 0; private _replacementItem = getText (configFile >> "CfgWeapons" >> _item >> "acex_field_rations_replacementItem"); - private _animation = (getArray (configFile >> "CfgWeapons" >> _item >> "acex_field_rations_consumeAnims")) select _stanceIndex; - private _sound = (getArray (configFile >> "CfgWeapons" >> _item >> "acex_field_rations_consumeSounds")) select _stanceIndex; + private _animation = getArray (configFile >> "CfgWeapons" >> _item >> "acex_field_rations_consumeAnims") select _stanceIndex; + private _sound = getArray (configFile >> "CfgWeapons" >> _item >> "acex_field_rations_consumeSounds") select _stanceIndex; /* Play animation */ [player, _animation, 1] call ace_common_fnc_doAnimation; @@ -106,7 +106,7 @@ SCRIPT(drinking); }; private _condition = { - (((items player) findIf {_x in ([[GVAR(drinking_hydrationItems)] call CBA_fnc_hashCreate] call CBA_fnc_hashKeys)}) != -1) + items player findIf {_x in ([[GVAR(drinking_hydrationItems)] call CBA_fnc_hashCreate] call CBA_fnc_hashKeys)} != -1 && { isNull objectParent player && { !visibleMap } } }; @@ -117,14 +117,14 @@ SCRIPT(drinking); private _actions = []; private _hydrationItems = []; { - if ((_x in ([[GVAR(drinking_hydrationItems)] call CBA_fnc_hashCreate] call CBA_fnc_hashKeys)) && { !(_x in _hydrationItems) }) then { + if (_x in ([[GVAR(drinking_hydrationItems)] call CBA_fnc_hashCreate] call CBA_fnc_hashKeys) && { !(_x in _hydrationItems) }) then { private _displayName = getText (configFile >> "CfgWeapons" >> _x >> "displayName"); private _icon = getText (configFile >> "CfgWeapons" >> _x >> "picture"); private _action = [format [QGVAR(drinking_)+"%1", _x], format[LSTRING(drink_from), _displayName], _icon, { _this spawn GVAR(drinking_fnc_consume) }, { true }, {}, _x] call ace_interact_menu_fnc_createAction; _actions pushBack [_action, [], _target]; _hydrationItems pushBack _x; }; - } forEach (items player); + } forEach items player; _actions; }; diff --git a/framework/components/player/functions/fn_hearing.sqf b/framework/components/player/functions/fn_hearing.sqf index ea9aabc..08a8b29 100644 --- a/framework/components/player/functions/fn_hearing.sqf +++ b/framework/components/player/functions/fn_hearing.sqf @@ -17,7 +17,7 @@ SCRIPT(hearing); /* Check if it is enabled */ -if !(SETTING(hearing)) exitWith {}; +if !SETTING(hearing) exitWith {}; /* Code for putting in the earplugs */ GVAR(hearing_fnc_codein) = { @@ -36,7 +36,7 @@ GVAR(hearing_fnc_codeout) = { }; private _actionIn = [QGVAR(hearing_insertEarplugs), "Insert earplugs", "", GVAR(hearing_fnc_codein), - { "ACE_EarPlugs" in (items cmf_player) && { !(cmf_player getVariable [QGVAR(hearing_earplugsIn), false]) } }] call ace_interact_menu_fnc_createAction; + { "ACE_EarPlugs" in items cmf_player && { !(cmf_player getVariable [QGVAR(hearing_earplugsIn), false]) } }] call ace_interact_menu_fnc_createAction; private _actionOut = [QGVAR(hearing_takeOutEarplugs), "Take out earplugs", "", GVAR(hearing_fnc_codeout), { (cmf_player getVariable [QGVAR(hearing_earplugsIn), false]) }] call ace_interact_menu_fnc_createAction; diff --git a/framework/components/player/functions/fn_restrictLauncher.sqf b/framework/components/player/functions/fn_restrictLauncher.sqf index b4599ca..185a7e8 100644 --- a/framework/components/player/functions/fn_restrictLauncher.sqf +++ b/framework/components/player/functions/fn_restrictLauncher.sqf @@ -23,7 +23,7 @@ cmf_player addEventHandler ["Respawn", { /* Create function to check if user has any launchers in loadout */ private _allowedLauncher = toString { - if !(SETTING(restrictLauncher)) exitWith { false }; + if !SETTING(restrictLauncher) exitWith { false }; private _ret = true; private _loadoutFile = cmf_player getVariable [QEGVAR(kosherArsenal,loadout), ""]; @@ -31,7 +31,7 @@ cmf_player addEventHandler ["Respawn", { if (cmf_player getVariable [QGVAR(restrictLauncher_unitDisable), false]) exitWith { false }; if (missionNamespace getVariable [QGVAR(restrictLauncher_disable), false]) exitWith { false }; - if ((currentWeapon cmf_player != secondaryWeapon cmf_player) || currentWeapon cmf_player isEqualTo "") exitWith { false }; + if (currentWeapon cmf_player != secondaryWeapon cmf_player || currentWeapon cmf_player isEqualTo "") exitWith { false }; private _whitelist = [_role, cmf_player, true] call compile(preprocessFileLineNumbers _loadoutFile); diff --git a/framework/components/respawn/XEH_postInit.sqf b/framework/components/respawn/XEH_postInit.sqf index df65bac..9fd72ca 100644 --- a/framework/components/respawn/XEH_postInit.sqf +++ b/framework/components/respawn/XEH_postInit.sqf @@ -6,12 +6,12 @@ GVAR(rallypoints) = []; { !isNull (findDisplay 49) }, { disableSerialization; - private _ctrl = (findDisplay 49) ctrlCreate ["RscText", -1]; + private _ctrl = findDisplay 49 ctrlCreate ["RscText", -1]; _ctrl ctrlSetTextColor [1, 0.3, 0.3, 1]; - _ctrl ctrlSetFontHeight (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); + _ctrl ctrlSetFontHeight (((safezoneW / safezoneH min 1.2) / 1.2) / 25) * 1; _ctrl ctrlSetPosition [ - ( safeZoneX + ( safeZoneWAbs / 2 )) - ( 0.5 / 2 ), + ( safeZoneX + safeZoneWAbs / 2 ) - 0.5 / 2 , (( safeZoneY + safeZoneH ) - 0.1) - 0.1, 0.5, 0.1 @@ -55,7 +55,7 @@ cmf_player addEventHandler ["Take", { /* Bring disconnected player back */ private _disconUnits = missionNameSpace getVariable [QGVAR(disconUnits), createHashMap]; -private _disconUnit = _disconUnits get (getPlayerUID cmf_player); +private _disconUnit = _disconUnits get getPlayerUID cmf_player; if (!isNil "_disconUnit" && { !ESETTING(gameplay,safestart) || missionNamespace getVariable [QEGVAR(gameplay,safestart_disable), false] }) then { GVAR(player_rejip) = true; @@ -73,9 +73,9 @@ if (!isNil "_disconUnit" && { !ESETTING(gameplay,safestart) || missionNamespace /* Attempt to set the same stance as the squad leader */ switch (unitPos leader (_this select 1)) do { - case ("UP"): { cmf_player playAction "PlayerStand" }; - case ("MIDDLE"): { cmf_player playAction "PlayerCrouch" }; - case ("DOWN"): { cmf_player playAction "PlayerProne" }; + case "UP": { cmf_player playAction "PlayerStand" }; + case "MIDDLE": { cmf_player playAction "PlayerCrouch" }; + case "DOWN": { cmf_player playAction "PlayerProne" }; }; /* Set respawns */ @@ -88,7 +88,7 @@ if (!isNil "_disconUnit" && { !ESETTING(gameplay,safestart) || missionNamespace if (vehicle leader (_this select 1) != leader (_this select 1)) then { cmf_player moveInCargo vehicle leader (_this select 1); - if (!isNull objectParent cmf_player && { (objectParent cmf_player) isKindOf "Helicopter" }) then { + if (!isNull objectParent cmf_player && { objectParent cmf_player isKindOf "Helicopter" }) then { private _groundPos = getposATL cmf_player; _groundPos set [2, 0]; cmf_player setPosATL _groundPos; diff --git a/framework/components/respawn/functions/fn_limit.sqf b/framework/components/respawn/functions/fn_limit.sqf index 0828de9..b865eb7 100644 --- a/framework/components/respawn/functions/fn_limit.sqf +++ b/framework/components/respawn/functions/fn_limit.sqf @@ -38,7 +38,7 @@ if (call _condition) then { }; /* Put player in a new group and initialize spectator for him */ - [player] joinSilent (createGroup west); + [player] joinSilent createGroup west; [true, true, true] call ace_spectator_fnc_setSpectator; } else { /* Decrement the respawn counter */ @@ -53,7 +53,7 @@ if (!hasInterface) exitwith {}; /* Get the respawns left for all players in mission and create 3D widget displaying the remaining respawns for zeuses */ [{!isnull (getAssignedCuratorLogic player)}, { - if (player in (call bis_fnc_listcuratorplayers)) then { + if (player in call bis_fnc_listcuratorplayers) then { addMissionEventHandler ["Draw3D", { if (isNull curatorCamera || !EGVAR(curator,zeusInfoShow)) exitWith {}; { diff --git a/framework/components/respawn/functions/fn_rallypoint.sqf b/framework/components/respawn/functions/fn_rallypoint.sqf index 766002c..6729c4b 100644 --- a/framework/components/respawn/functions/fn_rallypoint.sqf +++ b/framework/components/respawn/functions/fn_rallypoint.sqf @@ -28,21 +28,21 @@ private _rallypointPlaceCode = { /* Detect mouse input */ GVAR(rallypoint_placeLoop) = true; GVAR(rallypoint_place) = false; - (findDisplay 46) displayAddEventHandler ["mouseButtonDown", { - switch ((_this select 1)) do { - case (0): { GVAR(rallypoint_place) = true }; - case (1): { GVAR(rallypoint_place) = false }; + findDisplay 46 displayAddEventHandler ["mouseButtonDown", { + switch (_this select 1) do { + case 0: { GVAR(rallypoint_place) = true }; + case 1: { GVAR(rallypoint_place) = false }; }; GVAR(rallypoint_placeLoop) = false; - (findDisplay 46) displayRemoveEventHandler ["mouseButtonDown", _thisEventHandler]; + findDisplay 46 displayRemoveEventHandler ["mouseButtonDown", _thisEventHandler]; }]; /* Block LMB from firing */ player addAction ["", { player removeAction (_this select 2)}, "", 0, false, true, "DefaultAction"]; /* Placement loop */ - private _obj = SETTING(rallypointObject) createVehicleLocal (getPos player); - _obj setPosASL (getPosASL player); + private _obj = SETTING(rallypointObject) createVehicleLocal getPos player; + _obj setPosASL getPosASL player; while { GVAR(rallypoint_placeLoop) } do { /* Get X and Y Coordinate */ private _intersections = lineIntersectsSurfaces [eyePos player, AGLToASL (screenToWorld[0.5, 0.5]), player, _obj, true, 1]; @@ -55,7 +55,7 @@ private _rallypointPlaceCode = { private _dir = player getDir _pos; private _distance = player distance2D _pos; private _height = (_pos select 2) + 0.1; - private _pos = (getPos player) getPos [(_distance - 0.1) min 3, _dir]; + private _pos = getPos player getPos [(_distance - 0.1) min 3, _dir]; /* Get height correction */ private _height = ((lineIntersectsSurfaces [[_pos select 0, _pos select 1, _height], [(_pos select 0), (_pos select 1), 0], _obj] select 0) select 0) select 2; @@ -84,13 +84,13 @@ private _rallypointPlaceCode = { call ace_interaction_fnc_hideMouseHint; /* place rallypoint if not cancelled */ - if (GVAR(rallypoint_place)) then { + if GVAR(rallypoint_place) then { /* Get old rallypoint */ private _oldRallyParams = player getVariable [QGVAR(rallypoint_lastRally), [objNull, [objNull, -1]]]; _oldRallyParams params ["_oldObject", "_oldRespawn"]; /* Check if enemies are close to rally */ - private _units = (nearestObjects [_obj, ["Man"], SETTING(rallypointKillRadius)]) apply { [side _x, side player] call BIS_fnc_sideIsFriendly }; + private _units = nearestObjects [_obj, ["Man"], SETTING(rallypointKillRadius)] apply { [side _x, side player] call BIS_fnc_sideIsFriendly }; if (false in _units) exitWith { hint format[LSTRING(rally_too_close_message), SETTING(rallypointKillRadius)]; deleteVehicle _obj; @@ -147,16 +147,16 @@ private _rallypointFailedCode = { /* Create Place action */ private _rallypointPlaceAction = [QGVAR(rallypoint_place), LSTRING(place_rallypoint), "components\respawn\data\icon_ace_rallypoint_place_ca.paa", _rallypointPlaceCode, { - ((isNull objectParent player) && { (player getVariable [QGVAR(rallypoint_canCreate), true]) && !(missionNamespace getVariable [QGVAR(rallypoint_disabled), false]) }) - && { (player getVariable [QGVAR(showRallypoint), false]) + (isNull objectParent player && { player getVariable [QGVAR(rallypoint_canCreate), true] && !(missionNamespace getVariable [QGVAR(rallypoint_disabled), false]) }) + && { player getVariable [QGVAR(showRallypoint), false] && !visibleMap } }] call ace_interact_menu_fnc_createAction; /* Create Unable to place action */ private _rallypointFailedAction = [QGVAR(rallypoint_disabled), LSTRING(place_rallypoint), "components\respawn\data\icon_ace_rallypoint_disabled_ca.paa", _rallypointFailedCode, { - (((isNull objectParent player) && { !(player getVariable [QGVAR(rallypoint_canCreate), true]) }) - || (missionNamespace getVariable [QGVAR(rallypoint_disabled), false])) - && { (player getVariable [QGVAR(showRallypoint), false]) + (isNull objectParent player && { !(player getVariable [QGVAR(rallypoint_canCreate), true]) } + || missionNamespace getVariable [QGVAR(rallypoint_disabled), false]) + && { player getVariable [QGVAR(showRallypoint), false] && !visibleMap } }] call ace_interact_menu_fnc_createAction; @@ -167,8 +167,8 @@ if (count _units isEqualTo 0) exitWith { { /* If the unit is a string check player role against it */ - if (IS_STRING(_x)) then { - if (([player, _x] call EFUNC(organization,isRole)) && { !(player getVariable [QGVAR(rallypoint), false]) }) then { + if IS_STRING(_x) then { + if ([player, _x] call EFUNC(organization,isRole) && { !(player getVariable [QGVAR(rallypoint), false]) }) then { waitUntil { alive player && { !isNull player } }; [typeOf player, 1, ["ACE_SelfActions"], _rallypointPlaceAction] call ace_interact_menu_fnc_addActionToClass; [typeOf player, 1, ["ACE_SelfActions"], _rallypointFailedAction] call ace_interact_menu_fnc_addActionToClass; @@ -181,7 +181,7 @@ if (count _units isEqualTo 0) exitWith { }; /* If the unit is a object apply to object */ - if (IS_OBJECT(_x)) then { + if IS_OBJECT(_x) then { if !(_x getVariable [QGVAR(rallypoint), false]) then { waitUntil { alive _x && { !isNull _x } }; /* Add interactions where unit is local */ @@ -225,8 +225,8 @@ private _action = [QGVAR(other), "Set as rallypoint", "components\respawn\data\i player setVariable [QGVAR(rallypoint_canCreate), true, true]; }, [], SETTING(rallypointCooldown)] call CBA_fnc_waitAndExecute; }, { - ((isNull objectParent cmf_player) && { (cmf_player getVariable [QGVAR(rallypoint_canCreate), true]) && !(missionNamespace getVariable [QGVAR(rallypoint_disabled), false]) }) - && { (cmf_player getVariable [QGVAR(showRallypoint), false]) + (isNull objectParent cmf_player && { cmf_player getVariable [QGVAR(rallypoint_canCreate), true] && !(missionNamespace getVariable [QGVAR(rallypoint_disabled), false]) }) + && { cmf_player getVariable [QGVAR(showRallypoint), false] && !visibleMap } }] call ace_interact_menu_fnc_createAction; @@ -237,17 +237,17 @@ private _action = [QGVAR(other), "Set as rallypoint", "components\respawn\data\i /* Add button to ping SL to create rallypoint */ [{ - !isNull ((findDisplay 12) displayCtrl 88800) + !isNull (findDisplay 12 displayCtrl 88800) }, { waitUntil { !isNull findDisplay 12 }; - waitUntil { !isNull ((findDisplay 12) displayCtrl 88800) }; + waitUntil { !isNull (findDisplay 12 displayCtrl 88800) }; /* Find rally-capable units in group */ - private _rallyUnits = (units group player) select { (_x getVariable [QGVAR(rallypoint), false]) && { (alive _x) && { (lifeState _x != "UNCONCIOUS") } } }; + private _rallyUnits = units group player select { _x getVariable [QGVAR(rallypoint), false] && { alive _x && { lifeState _x != "UNCONCIOUS" } } }; /* Create button */ - private _ctrlGroup = (findDisplay 12) displayCtrl 88800; - private _ctrlButton = (findDisplay 12) ctrlCreate ["RscGearShortcutButton", -1, _ctrlGroup]; + private _ctrlGroup = findDisplay 12 displayCtrl 88800; + private _ctrlButton = findDisplay 12 ctrlCreate ["RscGearShortcutButton", -1, _ctrlGroup]; _ctrlButton ctrlSetPosition [0,0.386,0.378,0.044]; _ctrlButton ctrlCommit 0; _ctrlButton ctrlSetBackgroundColor [0.101961,0.101961,0.101961,0.8]; @@ -266,7 +266,7 @@ private _action = [QGVAR(other), "Set as rallypoint", "components\respawn\data\i /* Ping rally-capable units in group */ _ctrlButton ctrlAddEventHandler ["ButtonClick", { /* Find rally-capable units in group */ - private _rallyUnits = (units group player) select { _x getVariable [QGVAR(rallypoint), false] && { alive _x } }; + private _rallyUnits = units group player select { _x getVariable [QGVAR(rallypoint), false] && { alive _x } }; /* Show ping for rallypoint-capable units */ { @@ -282,9 +282,9 @@ private _action = [QGVAR(other), "Set as rallypoint", "components\respawn\data\i addMissionEventHandler ["Map", { params ["_mapIsOpened", "_mapIsForced"]; - if (_mapIsOpened && { !isNull ((findDisplay 12) displayCtrl 88800) }) then { + if (_mapIsOpened && { !isNull (findDisplay 12 displayCtrl 88800) }) then { GVAR(rallypoint_PFH) = [{ - private _rallyUnits = (units group player) select { (_x getVariable [QGVAR(rallypoint), false]) && { (alive _x) && { (lifeState _x != "UNCONCIOUS") } } }; + private _rallyUnits = units group player select { _x getVariable [QGVAR(rallypoint), false] && { alive _x && { lifeState _x != "UNCONCIOUS" } } }; _ctrlButton ctrlEnable (count _rallyUnits > 0); if (count _rallyUnits > 0) then { diff --git a/framework/components/respawn/functions/fn_respawnButtonPFH.sqf b/framework/components/respawn/functions/fn_respawnButtonPFH.sqf index 01e5615..5d81241 100644 --- a/framework/components/respawn/functions/fn_respawnButtonPFH.sqf +++ b/framework/components/respawn/functions/fn_respawnButtonPFH.sqf @@ -17,15 +17,15 @@ disableSerialization; if (isNull (findDisplay 49)) exitWith {}; -if (!ctrlShown ((findDisplay 49) displayCtrl 1010)) exitWith {}; +if (!ctrlShown (findDisplay 49 displayCtrl 1010)) exitWith {}; -if (ctrlShown ((findDisplay 49) displayCtrl 1010) && isNull (uiNamespace getVariable [QGVAR(ctrlCounter), controlNull])) then { - private _ctrl = (findDisplay 49) ctrlCreate ["RscText", -1]; +if (ctrlShown (findDisplay 49 displayCtrl 1010) && isNull (uiNamespace getVariable [QGVAR(ctrlCounter), controlNull])) then { + private _ctrl = findDisplay 49 ctrlCreate ["RscText", -1]; _ctrl ctrlSetTextColor [1, 0.3, 0.3, 1]; - _ctrl ctrlSetFontHeight (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1); + _ctrl ctrlSetFontHeight (((safezoneW / safezoneH min 1.2) / 1.2) / 25) * 1; _ctrl ctrlSetPosition [ - ( safeZoneX + ( safeZoneWAbs / 2 )) - ( 0.5 / 2 ), + ( safeZoneX + safeZoneWAbs / 2 ) - 0.5 / 2 , (( safeZoneY + safeZoneH ) - 0.1) - 0.1, 0.5, 0.1 @@ -37,4 +37,4 @@ if (ctrlShown ((findDisplay 49) displayCtrl 1010) && isNull (uiNamespace getVari uiNamespace setVariable [QGVAR(ctrlCounter), _ctrl]; }; -((findDisplay 49) displayCtrl 1010) ctrlEnable GVAR(respawnState); \ No newline at end of file +(findDisplay 49 displayCtrl 1010) ctrlEnable GVAR(respawnState); \ No newline at end of file diff --git a/framework/components/respawn/functions/fn_setLimit.sqf b/framework/components/respawn/functions/fn_setLimit.sqf index 9037e8c..e7979cc 100644 --- a/framework/components/respawn/functions/fn_setLimit.sqf +++ b/framework/components/respawn/functions/fn_setLimit.sqf @@ -26,7 +26,7 @@ _obj setVariable[QGVAR(deaths), 0, true]; if (!local _obj) exitWith {}; /* Close spectator if players is spectating */ -if (_obj in (call ace_spectator_fnc_players)) then { +if (_obj in call ace_spectator_fnc_players) then { [false] call ace_spectator_fnc_setSpectator; }; diff --git a/framework/components/respawn/functions/fn_unconciousEH.sqf b/framework/components/respawn/functions/fn_unconciousEH.sqf index 0fcf0f3..925ad67 100644 --- a/framework/components/respawn/functions/fn_unconciousEH.sqf +++ b/framework/components/respawn/functions/fn_unconciousEH.sqf @@ -20,7 +20,7 @@ params ["_unit", "_state"]; if !(_unit isEqualTo player) exitWith {}; -if (_state) then { +if _state then { if (!isNil GVAR(countdownHandler)) exitWith {}; GVAR(respawnTimer) = SETTING(unconciousTimer); call FUNC(countdown); diff --git a/framework/components/vehicles/XEH_postInit.sqf b/framework/components/vehicles/XEH_postInit.sqf index 310a6c4..0eeef0a 100644 --- a/framework/components/vehicles/XEH_postInit.sqf +++ b/framework/components/vehicles/XEH_postInit.sqf @@ -28,7 +28,7 @@ private _fnc_initEH = { // Disable engine when damage is 0.8 _vehicle addEventHandler ["Engine", { params ["_vehicle", "_engineState"]; - if (!_engineState || (_vehicle gethit "engine") < 0.8) exitWith {}; + if (!_engineState || _vehicle gethit "engine" < 0.8) exitWith {}; _vehicle engineOn false; }]; @@ -44,7 +44,7 @@ private _fnc_initEH = { call FUNC(gunEffectEH); /* Add Fuel canisters to vehicle cargo */ -if (isServer) then { +if isServer then { ["AllVehicles", "init", { params ["_vehicle"]; diff --git a/framework/components/vehicles/functions/fn_clearVehicleCargo.sqf b/framework/components/vehicles/functions/fn_clearVehicleCargo.sqf index 4a99f3e..1d14312 100644 --- a/framework/components/vehicles/functions/fn_clearVehicleCargo.sqf +++ b/framework/components/vehicles/functions/fn_clearVehicleCargo.sqf @@ -32,7 +32,7 @@ if (!isServer) exitWith {}; clearWeaponCargoGlobal _vehicle; clearBackpackCargoGlobal _vehicle; - [{ (itemCargo _this) isNotEqualTo [] }, {}, _vehicle, 2, { + [{ itemCargo _this isNotEqualTo [] }, {}, _vehicle, 2, { _this addItemCargoGlobal ["ACE_rope12", 1]; }] call CBA_fnc_waitUntilAndExecute; diff --git a/framework/components/vehicles/functions/fn_damageEH.sqf b/framework/components/vehicles/functions/fn_damageEH.sqf index f1b6cf3..3de0871 100644 --- a/framework/components/vehicles/functions/fn_damageEH.sqf +++ b/framework/components/vehicles/functions/fn_damageEH.sqf @@ -46,8 +46,8 @@ if (isNil "_projectileType") then { /* Get the vehicle selectionNames */ private _vehicleSelections = [GVAR(vehicleCache), typeOf _veh, []] call CBA_fnc_hashGet; if (_vehicleSelections isEqualTo []) then { - private _engineName = getText (configFile >> "cfgVehicles" >> (typeOf _veh) >> "HitPoints" >> "HitEngine" >> "name"); - private _fuelName = getText (configFile >> "cfgVehicles" >> (typeOf _veh) >> "HitPoints" >> "HitFuel" >> "name"); + private _engineName = getText (configFile >> "cfgVehicles" >> typeOf _veh >> "HitPoints" >> "HitEngine" >> "name"); + private _fuelName = getText (configFile >> "cfgVehicles" >> typeOf _veh >> "HitPoints" >> "HitFuel" >> "name"); _vehicleSelections = [_engineName, _fuelName]; @@ -57,11 +57,11 @@ if (_vehicleSelections isEqualTo []) then { /* Check if the damage is enough to kill the vehicle, and if it is take over the damage handling */ //LOG_2("%1 in %2 || %1 isEqualTo """"", _selection, str _vehicleSelections); -if (_damage > 0.8 && { (_selection in _vehicleSelections) || _selection isEqualTo "" }) then { +if (_damage > 0.8 && { _selection in _vehicleSelections || _selection isEqualTo "" }) then { LOG_2("Registered damage on selection: %1 = %2", _selection, str _damage); /* If the projectile type was explosive play cool visual and audiable effects */ - if ((_projectileType isEqualTo 1)) then { + if (_projectileType isEqualTo 1) then { [_veh, _projectile, _hitPoint] spawn { params["_veh", "_projectile", "_hitPoint"]; { @@ -91,7 +91,7 @@ if (_damage > 0.8 && { (_selection in _vehicleSelections) || _selection isEqualT /* Allow fueltank to start leaking */ if (_selection isEqualTo "fuel") then { - if (_veh getHit "fuel" >= 0.9 && { _veh getVariable [QGVAR(isBurning), false] && { (random 1) < (0.5 * (fuel _veh)) } }) then { + if (_veh getHit "fuel" >= 0.9 && { _veh getVariable [QGVAR(isBurning), false] && { random 1 < 0.5 * fuel _veh } }) then { private "_key"; for "_y" from 0 to 9001 do { _key = QGVAR(vehicleFire_) + str _y; @@ -102,10 +102,10 @@ if (_damage > 0.8 && { (_selection in _vehicleSelections) || _selection isEqualT private _radius = (_boundingRect select 2) / 2; private _burnTime = 600 * fuel _veh; - ["ace_fire_addFireSource", [_veh, _radius, 10 * (fuel _veh), _key, { (_this select 0) > time }, [_burnTime]]] call CBA_fnc_serverEvent; + ["ace_fire_addFireSource", [_veh, _radius, 10 * fuel _veh, _key, { _this select 0 > time }, [_burnTime]]] call CBA_fnc_serverEvent; _veh setVariable [QGVAR(isBurning), true, true]; - [{time > (_this select 0)}, { (_this select 1) setVariable [QGVAR(isBurning), false, true] }, [_burnTime, _veh]] call CBA_fnc_waitUntilAndExecute; + [{time > _this select 0}, { (_this select 1) setVariable [QGVAR(isBurning), false, true] }, [_burnTime, _veh]] call CBA_fnc_waitUntilAndExecute; }; } else { _damage = 0.8; diff --git a/framework/components/vehicles/functions/fn_fuelLeakEH.sqf b/framework/components/vehicles/functions/fn_fuelLeakEH.sqf index 593f431..0cacbe8 100644 --- a/framework/components/vehicles/functions/fn_fuelLeakEH.sqf +++ b/framework/components/vehicles/functions/fn_fuelLeakEH.sqf @@ -20,7 +20,7 @@ params ["_veh"]; if (!isServer) exitWith { }; while { alive _veh } do { - waitUntil { (_veh getHitPointDamage "HitFuel") >= 0.9 }; + waitUntil { _veh getHitPointDamage "HitFuel" >= 0.9 }; private _fuelPos = getPosATL _veh; _fuelPos set [2, 0]; @@ -60,7 +60,7 @@ while { alive _veh } do { if (random 100 < 10) exitWith { terminate _expHandler; private _boundingRect = boundingBoxReal _fuel; - private _radius = ((((_boundingRect select 1) select 1) - ((_boundingRect select 0) select 0)) / 2) * (getObjectScale _fuel); + private _radius = ((((_boundingRect select 1) select 1) - ((_boundingRect select 0) select 0)) / 2) * getObjectScale _fuel; private _burnEnd = time + 300; @@ -71,12 +71,12 @@ while { alive _veh } do { if !(_key in _aceKeys) exitWith {}; }; - ["ace_fire_addFireSource", [_fuel, _radius, 10 * (getObjectScale _fuel), _key, { (_this select 0) > time }, [_burnEnd]]] call CBA_fnc_serverEvent; + ["ace_fire_addFireSource", [_fuel, _radius, 10 * getObjectScale _fuel, _key, { _this select 0 > time }, [_burnEnd]]] call CBA_fnc_serverEvent; /* Light crew on fire */ { private _burning = [_x] call ace_fire_fnc_isBurning; - if !(_burning) then { + if !_burning then { [QGVAR(burn), [_x, 4]] call CBA_fnc_globalEvent; }; diff --git a/framework/components/vehicles/functions/fn_getSurfaceParams.sqf b/framework/components/vehicles/functions/fn_getSurfaceParams.sqf index 7f7bd0c..957dec3 100644 --- a/framework/components/vehicles/functions/fn_getSurfaceParams.sqf +++ b/framework/components/vehicles/functions/fn_getSurfaceParams.sqf @@ -22,62 +22,62 @@ params["_surface"]; private _surfaceClass = -1; private _return = [-1, -1]; -switch (_surface) do { - case ("VRsurface"): { _surfaceClass = "VRsurface" }; - case ("DryGrass"): { _surfaceClass = "grass" }; - case ("WetGrass"): { _surfaceClass = "grass" }; - case ("softsand"): { _surfaceClass = "softsand" }; - case ("desert"): { _surfaceClass = "hardsand" }; - case ("harddirt"): { _surfaceClass = "harddirt" }; - case ("softmud"): { _surfaceClass = "softmud" }; - case ("forest"): { _surfaceClass = "forest" }; - case ("marsh"): { _surfaceClass = "marsh" }; - case ("Gravel"): { _surfaceClass = "gravel" }; - case ("Stony"): { _surfaceClass = "stony" }; - case ("LowQualityRoad"): { _surfaceClass = -1 }; - case ("HighQualityRoad"): { _surfaceClass = -1 }; - case ("Icy"): { _surfaceClass = "icy" }; - case ("SlipperySnow"): { _surfaceClass = "slipperySnow" }; - case ("ThickSoftSnow"): { _surfaceClass = "thickSoftSnow" }; +switch _surface do { + case "VRsurface": { _surfaceClass = "VRsurface" }; + case "DryGrass": { _surfaceClass = "grass" }; + case "WetGrass": { _surfaceClass = "grass" }; + case "softsand": { _surfaceClass = "softsand" }; + case "desert": { _surfaceClass = "hardsand" }; + case "harddirt": { _surfaceClass = "harddirt" }; + case "softmud": { _surfaceClass = "softmud" }; + case "forest": { _surfaceClass = "forest" }; + case "marsh": { _surfaceClass = "marsh" }; + case "Gravel": { _surfaceClass = "gravel" }; + case "Stony": { _surfaceClass = "stony" }; + case "LowQualityRoad": { _surfaceClass = -1 }; + case "HighQualityRoad": { _surfaceClass = -1 }; + case "Icy": { _surfaceClass = "icy" }; + case "SlipperySnow": { _surfaceClass = "slipperySnow" }; + case "ThickSoftSnow": { _surfaceClass = "thickSoftSnow" }; }; if (_surfaceClass isEqualTo -1) then { - if ((_surface find "rass") != -1) exitWith { _surfaceClass = "drygrass" }; - if ((_surface find "ield") != -1) exitWith { _surfaceClass = "drygrass" }; - if ((_surface find "tubble") != -1) exitWith { _surfaceClass = "drygrass" }; - if ((_surface find "eed") != -1) exitWith { _surfaceClass = "drygrass" }; - if ((_surface find "level") != -1) exitWith { _surfaceClass = "drygrass" }; - if ((_surface find "ole") != -1) exitWith { _surfaceClass = "drygrass" }; - if ((_surface find "rava") != -1) exitWith { _surfaceClass = "drygrass" }; - if ((_surface find "heat") != -1) exitWith { _surfaceClass = "drygrass" }; + if (_surface find "rass" != -1) exitWith { _surfaceClass = "drygrass" }; + if (_surface find "ield" != -1) exitWith { _surfaceClass = "drygrass" }; + if (_surface find "tubble" != -1) exitWith { _surfaceClass = "drygrass" }; + if (_surface find "eed" != -1) exitWith { _surfaceClass = "drygrass" }; + if (_surface find "level" != -1) exitWith { _surfaceClass = "drygrass" }; + if (_surface find "ole" != -1) exitWith { _surfaceClass = "drygrass" }; + if (_surface find "rava" != -1) exitWith { _surfaceClass = "drygrass" }; + if (_surface find "heat" != -1) exitWith { _surfaceClass = "drygrass" }; - if ((_surface find "irt") != -1) exitWith { _surfaceClass = "harddirt" }; - if ((_surface find "terk") != -1) exitWith { _surfaceClass = "harddirt" }; - if ((_surface find "hiekka") != -1) exitWith { _surfaceClass = "harddirt" }; + if (_surface find "irt" != -1) exitWith { _surfaceClass = "harddirt" }; + if (_surface find "terk" != -1) exitWith { _surfaceClass = "harddirt" }; + if (_surface find "hiekka" != -1) exitWith { _surfaceClass = "harddirt" }; - if ((_surface find "orest") != -1) exitWith { _surfaceClass = "forest" }; - if ((_surface find "horn") != -1) exitWith { _surfaceClass = "forest" }; - if ((_surface find "histles") != -1) exitWith { _surfaceClass = "forest" }; - if ((_surface find "eather") != -1) exitWith { _surfaceClass = "forest" }; - if ((_surface find "ood") != -1) exitWith { _surfaceClass = "forest" }; + if (_surface find "orest" != -1) exitWith { _surfaceClass = "forest" }; + if (_surface find "horn" != -1) exitWith { _surfaceClass = "forest" }; + if (_surface find "histles" != -1) exitWith { _surfaceClass = "forest" }; + if (_surface find "eather" != -1) exitWith { _surfaceClass = "forest" }; + if (_surface find "ood" != -1) exitWith { _surfaceClass = "forest" }; - if ((_surface find "each") != -1) exitWith { _surfaceClass = "softsand" }; - if ((_surface find "olopoust")!= -1) exitWith { _surfaceClass = "softsand" }; - if ((_surface find "and") != -1) exitWith { _surfaceClass = "softsand" }; + if (_surface find "each" != -1) exitWith { _surfaceClass = "softsand" }; + if (_surface find "olopoust"!= -1) exitWith { _surfaceClass = "softsand" }; + if (_surface find "and" != -1) exitWith { _surfaceClass = "softsand" }; - if ((_surface find "Dead") != -1) exitWith { _surfaceClass = "hardsand" }; - if ((_surface find "esert") != -1) exitWith { _surfaceClass = "hardsand" }; - if ((_surface find "terk") != -1) exitWith { _surfaceClass = "hardsand" }; + if (_surface find "Dead" != -1) exitWith { _surfaceClass = "hardsand" }; + if (_surface find "esert" != -1) exitWith { _surfaceClass = "hardsand" }; + if (_surface find "terk" != -1) exitWith { _surfaceClass = "hardsand" }; - if ((_surface find "mud") != -1) exitWith { _surfaceClass = "softmud" }; - if ((_surface find "olcano") != -1) exitWith { _surfaceClass = "softmud" }; - if ((_surface find "lina") != -1) exitWith { _surfaceClass = "softmud" }; + if (_surface find "mud" != -1) exitWith { _surfaceClass = "softmud" }; + if (_surface find "olcano" != -1) exitWith { _surfaceClass = "softmud" }; + if (_surface find "lina" != -1) exitWith { _surfaceClass = "softmud" }; - if ((_surface find "ock") != -1) exitWith { _surfaceClass = "stony" }; - if ((_surface find "tony") != -1) exitWith { _surfaceClass = "stony" }; - if ((_surface find "tone") != -1) exitWith { _surfaceClass = "stony" }; - if ((_surface find "liff") != -1) exitWith { _surfaceClass = "stony" }; - if ((_surface find "efault") != -1) exitWith { _surfaceClass = "stony" }; + if (_surface find "ock" != -1) exitWith { _surfaceClass = "stony" }; + if (_surface find "tony" != -1) exitWith { _surfaceClass = "stony" }; + if (_surface find "tone" != -1) exitWith { _surfaceClass = "stony" }; + if (_surface find "liff" != -1) exitWith { _surfaceClass = "stony" }; + if (_surface find "efault" != -1) exitWith { _surfaceClass = "stony" }; }; if (_surfaceClass isEqualType "") then { diff --git a/framework/components/vehicles/functions/fn_localEffect.sqf b/framework/components/vehicles/functions/fn_localEffect.sqf index 07e7a3c..47eedec 100644 --- a/framework/components/vehicles/functions/fn_localEffect.sqf +++ b/framework/components/vehicles/functions/fn_localEffect.sqf @@ -19,7 +19,7 @@ SCRIPT(localEffect); // @TODO: Change hearing here /* Play sound effects */ -if (SETTING(audiable)) then { +if SETTING(audiable) then { cmf_player setVariable ["defaultVolume", soundVolume]; 0 fadeSound 0.2; playsound "ACE_Combat_Deafness_Medium_NoRing"; @@ -32,7 +32,7 @@ if (SETTING(audiable)) then { }; /* Show visual effects */ -if (SETTING(visual)) then { +if SETTING(visual) then { addCamShake [5,2,9]; private _visualEffect = ppEffectCreate ["RadialBlur", 10000]; cutText ["", "BLACK OUT", 0.001]; diff --git a/framework/components/vehicles/functions/fn_offroadPFH.sqf b/framework/components/vehicles/functions/fn_offroadPFH.sqf index 9ba3b54..d19cc13 100644 --- a/framework/components/vehicles/functions/fn_offroadPFH.sqf +++ b/framework/components/vehicles/functions/fn_offroadPFH.sqf @@ -19,17 +19,17 @@ SCRIPT(offroading); if (isNull objectParent cmf_player) exitWith {}; private _veh = objectParent cmf_player; -if ((driver _veh) isNotEqualTo cmf_player) exitWith {}; +if (driver _veh isNotEqualTo cmf_player) exitWith {}; private _mass = getmass _veh; private _size = boundingBox _veh; -private _hitPoints = (getAllHitPointsDamage _veh) select 1; +private _hitPoints = getAllHitPointsDamage _veh select 1; private _wheelIndex = []; /* Get the wheel indexes of the vehicle */ -for "_i" from 1 to (count _hitPoints) do { - if !(((_hitPoints select (_i - 1)) find "wheel") isEqualTo -1) then { - _wheelIndex pushBack (_i - 1); +for "_i" from 1 to count _hitPoints do { + if !(((_hitPoints select _i - 1) find "wheel") isEqualTo -1) then { + _wheelIndex pushBack _i - 1; }; }; @@ -37,18 +37,18 @@ if (count _wheelIndex isEqualTo 0) exitWith {}; private _ix = ((_size select 1) select 0); private _iy = ((_size select 1) select 1); -private _i2 = _mass * (1 / (count _wheelIndex)) * (sqrt(_ix*_ix + _iy*_iy)) * 10 * 0.25; +private _i2 = _mass * (1 / count _wheelIndex) * sqrt(_ix*_ix + _iy*_iy) * 10 * 0.25; private _i3 = 0 - _i2; /* Get the wheel mass of the vehicle */ -private _cfgbin = ([ ["bin\config.bin"], configFile >> "CfgVehicles">> (typeOf _veh) >> "wheels" >> "LF" >> "mass" ] call BIS_fnc_loadClass); +private _cfgbin = ([ ["bin\config.bin"], configFile >> "CfgVehicles">> typeOf _veh >> "wheels" >> "LF" >> "mass" ] call BIS_fnc_loadClass); if (isNull _cfgbin) then { - _cfgbin = ([ ["bin\config.bin"], configFile >> "CfgVehicles">> (typeOf _veh) >> "wheels" >> "L1" >> "mass" ] call BIS_fnc_loadClass); + _cfgbin = ([ ["bin\config.bin"], configFile >> "CfgVehicles">> typeOf _veh >> "wheels" >> "L1" >> "mass" ] call BIS_fnc_loadClass); }; private _wheelmass = call compile (format['getNumber (%1)', ([_cfgbin, "", true] call BIS_fnc_configPath)]); /* Check if vehicle is off road */ -if !(((speed _veh) > 1) && { !(isOnRoad getPos _veh) && { (isTouchingGround _veh) } }) exitWith { }; +if !(speed _veh > 1 && { !(isOnRoad getPos _veh) && { (isTouchingGround _veh) } }) exitWith { }; /* Get the parameters for the current surface type */ private _curSurface = surfaceType getPos _veh; @@ -61,7 +61,7 @@ if ((_surfaceParams select 1) isEqualTo -1) exitWith { }; /* Apply bumps */ -if (SETTING(offroadBumps)) then { +if SETTING(offroadBumps) then { if (time < GVAR(offroad_bump_delay)) exitWith {}; /* Apply the bump settings */ @@ -71,16 +71,16 @@ if (SETTING(offroadBumps)) then { _veh addTorque (_veh vectorModelToWorld [_i1, _i2, 0]); LOG_1("Bump applied to: %1", _veh); - private _delay = OFFROAD_BUMPSPEED / (abs (speed _veh)); + private _delay = OFFROAD_BUMPSPEED / abs (speed _veh); GVAR(offroad_bump_delay) = time + _delay; }; /* Apply damage */ -if (SETTING(offroadDamage)) then { +if SETTING(offroadDamage) then { if (time < GVAR(offroad_damage_delay)) exitWith {}; if (speed _veh < OFFROAD_DAMAGESPEED) exitWith { - private _delay = OFFROAD_DAMAGESPEED * 5 / (abs (speed _veh)); + private _delay = OFFROAD_DAMAGESPEED * 5 / abs (speed _veh); GVAR(offroad_damage_delay) = time + _delay; }; @@ -91,7 +91,7 @@ if (SETTING(offroadDamage)) then { _veh sethitIndex [_wheel, (_veh getHitIndex _wheel) + _damageSeverity]; LOG_1("Damage applied to: %1", _veh); - private _delay = OFFROAD_DAMAGESPEED * 5 / (abs (speed _veh)); + private _delay = OFFROAD_DAMAGESPEED * 5 / abs (speed _veh); GVAR(offroad_damage_delay) = time + _delay; playSound3D ["A3\Sounds_F\vehicles2\soft\shared\collisions\Vehicle_Soft_Collision_Medium_08.wss", _veh, false, _veh, 8 * _damageSeverity]; }; \ No newline at end of file diff --git a/framework/rsc/loadouts/!ai_arsenal_template.sqf b/framework/rsc/loadouts/!ai_arsenal_template.sqf index 08dca6c..453e4e6 100644 --- a/framework/rsc/loadouts/!ai_arsenal_template.sqf +++ b/framework/rsc/loadouts/!ai_arsenal_template.sqf @@ -1,3 +1,4 @@ +#pragma sls disable VV-001 /* * Author: [Author] * [Description] diff --git a/framework/rsc/loadouts/!arsenal_template.sqf b/framework/rsc/loadouts/!arsenal_template.sqf index 9cda5bd..2641a81 100644 --- a/framework/rsc/loadouts/!arsenal_template.sqf +++ b/framework/rsc/loadouts/!arsenal_template.sqf @@ -1,3 +1,4 @@ +#pragma sls disable VV-001 /* * Author: [Author] * [Description] diff --git a/framework/rsc/loadouts/!logistics_template.sqf b/framework/rsc/loadouts/!logistics_template.sqf index 62c18ff..77e7063 100644 --- a/framework/rsc/loadouts/!logistics_template.sqf +++ b/framework/rsc/loadouts/!logistics_template.sqf @@ -1,3 +1,4 @@ +#pragma sls disable VV-001 /* * Author: [Author] * [Description] diff --git a/framework/rsc/organization/orbat.sqf b/framework/rsc/organization/orbat.sqf index d5e7e1d..61856dc 100644 --- a/framework/rsc/organization/orbat.sqf +++ b/framework/rsc/organization/orbat.sqf @@ -12,11 +12,11 @@ _fireteamNaming = { private "_index"; if (!isNull _parent) then { private _parentData = [_parent] call FUNC(groupGetData); - private _siblings = (_parentData select 3) select { (count units _x) > 0 }; - _index = _siblings find (_group); + private _siblings = (_parentData select 3) select { count units _x > 0 }; + _index = _siblings find _group; } else { private _siblings = ([_groupsHash, _level, []] call CBA_fnc_hashGet) select { (([_x] call FUNC(groupGetData)) select 1) isEqualTo _type }; - _siblings = _siblings select { (count units _x) > 0 }; + _siblings = _siblings select { count units _x > 0 }; _index = _siblings find _group; }; @@ -31,11 +31,11 @@ _fireteamNaming = { if (isNil "_names") then { private _siblings = ([_groupsHash, (_parentData select 0), []] call CBA_fnc_hashGet) select { (([_x] call FUNC(groupGetData)) select 1) isEqualTo (_parentData select 1) }; - _siblings = _siblings select { (count units _x) > 0 }; + _siblings = _siblings select { count units _x > 0 }; private _index = _siblings find _parent; - if ((_parentData select 0) isEqualTo (_level + 1)) then { - private _name = [GVAR(phoneticAlphabet) select _index, "ZULU"] select ((count GVAR(phoneticAlphabet)) < _index); + if ((_parentData select 0) isEqualTo _level + 1) then { + private _name = [GVAR(phoneticAlphabet) select _index, "ZULU"] select count GVAR(phoneticAlphabet) < _index; _names = [_name select [0, 1], _name]; } else { _names = [_index, _index]; @@ -43,7 +43,7 @@ _fireteamNaming = { }; - if ((_parentData select 0) isEqualTo (_level + 1)) then { + if ((_parentData select 0) isEqualTo _level + 1) then { _parentIDs pushBack (_names select 1); } else { _parentIDs pushBack ((_names select 0) select [0, 1]); @@ -52,7 +52,7 @@ _fireteamNaming = { }; reverse _parentIDs; - private _squadName = _parentIDs deleteAt ((count _parentIDs) - 1); + private _squadName = _parentIDs deleteAt count _parentIDs - 1; if (isNil "_squadName") then { _squadName = ""; }; @@ -78,9 +78,9 @@ private _squadNaming = { private _groupsHash = [GVAR(groups), side _group, [] call CBA_fnc_hashCreate] call CBA_fnc_hashGet; private _siblings = ([_groupsHash, _level, []] call CBA_fnc_hashGet) select { (([_x] call FUNC(groupGetData)) select 1) isEqualTo _type }; // @TODO: Try to get siblings from parent first - _siblings = _siblings select { (count units _x) > 0 }; + _siblings = _siblings select { count units _x > 0 }; private _index = _siblings find _group; - private _name = [GVAR(phoneticAlphabet) select _index, "ZULU"] select ((count GVAR(phoneticAlphabet)) < _index); + private _name = [GVAR(phoneticAlphabet) select _index, "ZULU"] select (count GVAR(phoneticAlphabet) < _index); private _parentIDs = []; while { !isNull _parent } do { @@ -92,7 +92,7 @@ private _squadNaming = { if (isNil "_names") then { private _siblings = ([_groupsHash, (_parentData select 0), []] call CBA_fnc_hashGet) select { (([_x] call FUNC(groupGetData)) select 1) isEqualTo (_parentData select 1) }; - _siblings = _siblings select { (count units _x) > 0 }; + _siblings = _siblings select { count units _x > 0 }; private _index = _siblings find _parent; _names = [_index]; }; @@ -121,7 +121,7 @@ private _platoonNaming = { private _groupsHash = [GVAR(groups), side _group, [] call CBA_fnc_hashCreate] call CBA_fnc_hashGet; private _siblings = ([_groupsHash, _level, []] call CBA_fnc_hashGet) select { (([_x] call FUNC(groupGetData)) select 1) isEqualTo _type }; - _siblings = _siblings select { (count units _x) > 0 }; + _siblings = _siblings select { count units _x > 0 }; private _index = _siblings find _group; private _parentIDs = []; @@ -134,7 +134,7 @@ private _platoonNaming = { if (isNil "_names") then { private _siblings = ([_groupsHash, (_parentData select 0), []] call CBA_fnc_hashGet) select { (([_x] call FUNC(groupGetData)) select 1) isEqualTo (_parentData select 1) }; - _siblings = _siblings select { (count units _x) > 0 }; + _siblings = _siblings select { count units _x > 0 }; private _index = _siblings find _parent; _names = [_index]; }; @@ -142,7 +142,7 @@ private _platoonNaming = { _parentIDs pushBack ((_names select 0) select [0, 1]); _parent = _parentData select 2; }; - _parentIDs pushBack (_index + 1); + _parentIDs pushBack _index + 1; // reverse _parentIDs; private _subFix = ["", "st", "nd", "rd"] param [_index + 1, "th"]; @@ -156,9 +156,9 @@ private _companyNaming = { private _groupsHash = [GVAR(groups), side _group, [] call CBA_fnc_hashCreate] call CBA_fnc_hashGet; private _siblings = ([_groupsHash, _level, []] call CBA_fnc_hashGet) select { (([_x] call FUNC(groupGetData)) select 1) isEqualTo _type }; - _siblings = _siblings select { (count units _x) > 0 }; + _siblings = _siblings select { count units _x > 0 }; private _index = _siblings find _group; - private _name = [GVAR(phoneticAlphabet) select _index, "ZULU"] select ((count GVAR(phoneticAlphabet)) < _index); + private _name = [GVAR(phoneticAlphabet) select _index, "ZULU"] select (count GVAR(phoneticAlphabet) < _index); private _parentIDs = []; while { !isNull _parent } do { @@ -170,7 +170,7 @@ private _companyNaming = { if (isNil "_names") then { private _siblings = ([_groupsHash, (_parentData select 0), []] call CBA_fnc_hashGet) select { (([_x] call FUNC(groupGetData)) select 1) isEqualTo (_parentData select 1) }; - _siblings = _siblings select { (count units _x) > 0 }; + _siblings = _siblings select { count units _x > 0 }; private _index = _siblings find _parent; _names = [_index]; }; @@ -192,11 +192,11 @@ _vehicleSquadNaming = { private "_index"; if (!isNull _parent) then { private _parentData = [_parent] call FUNC(groupGetData); - private _siblings = (_parentData select 3) select { (count units _x) > 0 }; - _index = _siblings find (_group); + private _siblings = (_parentData select 3) select { count units _x > 0 }; + _index = _siblings find _group; } else { private _siblings = ([_groupsHash, _level, []] call CBA_fnc_hashGet) select { (([_x] call FUNC(groupGetData)) select 1) isEqualTo _type }; - _siblings = _siblings select { (count units _x) > 0 }; + _siblings = _siblings select { count units _x > 0 }; _index = _siblings find _group; }; @@ -211,11 +211,11 @@ _vehicleSquadNaming = { if (isNil "_names") then { private _siblings = ([_groupsHash, (_parentData select 0), []] call CBA_fnc_hashGet) select { (([_x] call FUNC(groupGetData)) select 1) isEqualTo (_parentData select 1) }; - _siblings = _siblings select { (count units _x) > 0 }; + _siblings = _siblings select { count units _x > 0 }; private _index = _siblings find _parent; - if ((_parentData select 0) isEqualTo (_level + 1)) then { - private _name = [GVAR(phoneticAlphabet) select _index, "ZULU"] select ((count GVAR(phoneticAlphabet)) < _index); + if ((_parentData select 0) isEqualTo _level + 1) then { + private _name = [GVAR(phoneticAlphabet) select _index, "ZULU"] select (count GVAR(phoneticAlphabet) < _index); _names = [_name select [0, 1], _name]; } else { _names = [_index, _index]; @@ -223,7 +223,7 @@ _vehicleSquadNaming = { }; - if ((_parentData select 0) isEqualTo (_level + 1)) then { + if ((_parentData select 0) isEqualTo _level + 1) then { _parentIDs pushBack (_names select 1); } else { _parentIDs pushBack ((_names select 0) select [0, 1]); @@ -232,7 +232,7 @@ _vehicleSquadNaming = { }; reverse _parentIDs; - private _squadName = _parentIDs deleteAt ((count _parentIDs) - 1); + private _squadName = _parentIDs deleteAt count _parentIDs - 1; if (isNil "_squadName") then { _squadName = ""; }; @@ -259,7 +259,7 @@ private _specialNaming = { private _groupsHash = [GVAR(groups), side _group, [] call CBA_fnc_hashCreate] call CBA_fnc_hashGet; private _siblings = ([_groupsHash, _level, []] call CBA_fnc_hashGet) select { (([_x] call FUNC(groupGetData)) select 1) isEqualTo _type }; - _siblings = _siblings select { (count units _x) > 0 }; + _siblings = _siblings select { count units _x > 0 }; private _index = _siblings find _group; private _parentIDs = []; @@ -272,7 +272,7 @@ private _specialNaming = { if (isNil "_names") then { private _siblings = [_groupsHash, (_parentData select 0), []] call CBA_fnc_hashGet; - _siblings = _siblings select { (count units _x) > 0 }; + _siblings = _siblings select { count units _x > 0 }; private _index = _siblings find _parent; _names = [_index]; }; @@ -282,7 +282,7 @@ private _specialNaming = { }; /* Get name and color */ - private _special = switch (_type) do { + private _special = switch _type do { case "RECON": { ["ROMEO", [[1, 1, 0.2, 0.7], [1, 1, 0.2, 0.95]]] }; case "MORTAR": { ["MORTAR", [[1, 1, 0.2, 0.7], [1, 1, 0.2, 0.95]]] }; case "LOGI": { ["LOGI", [[1, 1, 0.2, 0.7], [1, 1, 0.2, 0.95]]] }; diff --git a/framework/rsc/ui/RscDefines.hpp b/framework/rsc/ui/RscDefines.hpp index 93cbd20..8577c1e 100644 --- a/framework/rsc/ui/RscDefines.hpp +++ b/framework/rsc/ui/RscDefines.hpp @@ -46,8 +46,6 @@ #define ST_DOWN 0x04 #define ST_UP 0x08 #define ST_VCENTER 0x0C -#define ST_GROUP_BOX 96 -#define ST_GROUP_BOX2 112 #define ST_ROUNDED_CORNER ST_GROUP_BOX + ST_CENTER #define ST_ROUNDED_CORNER2 ST_GROUP_BOX2 + ST_CENTER diff --git a/framework/rsc/ui/RscLog.hpp b/framework/rsc/ui/RscLog.hpp index 2374712..607d70d 100644 --- a/framework/rsc/ui/RscLog.hpp +++ b/framework/rsc/ui/RscLog.hpp @@ -5,7 +5,7 @@ class CMF_RscLog { idd = -1; movingEnable = "true"; - onLoad = QUOTE(_this call FUNC(initDisplayLog)) + onLoad = QUOTE(_this call FUNC(initDisplayLog)); class ControlsBackground { //class BackgroundDisable: ctrlStaticBackgroundDisable {}; //class BackgroundDisableTiles: ctrlStaticBackgroundDisableTiles {}; diff --git a/tools/.vscode/settings.json b/tools/.vscode/settings.json index 4cfde39..e2fed70 100644 --- a/tools/.vscode/settings.json +++ b/tools/.vscode/settings.json @@ -2,5 +2,6 @@ "files.exclude": { "**/release": true, "**/site": true - } + }, + "python.pythonPath": "C:\\Python312\\python.exe" } \ No newline at end of file