Skip to content

Commit

Permalink
Merge pull request #333 from R3voA3/commands-formatting
Browse files Browse the repository at this point in the history
updated command casing and added sqf lint settings
  • Loading branch information
R3voA3 authored Sep 4, 2024
2 parents 9a9d92b + b28f320 commit 20a8c06
Show file tree
Hide file tree
Showing 56 changed files with 190 additions and 171 deletions.
21 changes: 20 additions & 1 deletion .hemtt/project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,27 @@ workshop = [
]

mission = "3denEnhanced.VR" # Mission to launch directly into the editor with
executable = "arma3_x64"

# parameters = [
# ]

executable = "arma3_x64"
executable = "arma3_x64"
[lints.sqf.command_case]
severity = "Error"
options.ignore = [
"AGLtoASL",
"ASLtoAGL",
"groupID"
]

[lints.sqf.banned_commands]
options.banned = [
"execVM",
"opfor",
"blufor",
"resistance",
"and",
"or",
"not"
]
2 changes: 1 addition & 1 deletion addons/main/GUI/RscDebugConsole.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class RscDebugConsole: RscControlsGroupNoScrollbars
{
idc = -1;
//Dynamically reposition it if Connor's functions viewer is available as well.
onLoad = "_this # 0 ctrlSetText ('ENH_' + localize 'STR_A3_RSCDEBUGCONSOLE_BUTTONFUNCTIONS'); if (isClass (configFile >> 'RscDisplayDebugPublic' >> 'Controls' >> 'DebugConsole' >> 'controls' >> 'CAU_xFuncViewer')) then {_this # 0 ctrlSetPosition [7.5 * (((safezoneW / safezoneH) min 1.2) / 40), 21.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)]; _this # 0 ctrlCommit 0;}";
onLoad = "_this # 0 ctrlSetText ('ENH_' + localize 'STR_A3_RSCDEBUGCONSOLE_BUTTONFUNCTIONS'); if (isClass (configFile >> 'RscDisplayDebugPublic' >> 'Controls' >> 'DebugConsole' >> 'controls' >> 'CAU_xFuncViewer')) then {_this # 0 ctrlSetPosition [7.5 * (((safeZoneW / safeZoneH) min 1.2) / 40), 21.6 * ((((safeZoneW / safeZoneH) min 1.2) / 1.2) / 25)]; _this # 0 ctrlCommit 0;}";
x = QUOTE(7.5 * GUI_GRID_W);
onButtonClick = "ctrlParent (_this # 0) createDisplay 'ENH_FunctionsViewer'";
};
Expand Down
76 changes: 38 additions & 38 deletions addons/main/GUI/functionsViewer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,34 @@ class ENH_FunctionsViewer
class Header: ctrlStaticTitle
{
text = "$STR_ENH_MAIN_FUNCTIONSVIEWER_HEADER";
x = QUOTE(safezoneX);
y = QUOTE(safezoneY);
w = QUOTE(safezoneW);
x = QUOTE(safeZoneX);
y = QUOTE(safeZoneY);
w = QUOTE(safeZoneW);
h = QUOTE(CTRL_DEFAULT_H);
colorBackground[] = {COLOR_ACTIVE_RGBA};
moving = 0;
};
class Background: ctrlStaticBackground
{
x = QUOTE(safezoneX);
y = QUOTE(safezoneY + CTRL_DEFAULT_H);
w = QUOTE(safezoneW);
h = QUOTE(safezoneH - CTRL_DEFAULT_H);
x = QUOTE(safeZoneX);
y = QUOTE(safeZoneY + CTRL_DEFAULT_H);
w = QUOTE(safeZoneW);
h = QUOTE(safeZoneH - CTRL_DEFAULT_H);
};
class NumFunctions: ctrlStatic
{
idc = IDC_FUNCTIONSVIEWER_NUMFUNCTIONS;
tooltip = "$STR_ENH_MAIN_FUNCTIONSVIEWER_NUMFUNCTIONS_TOOLTIP";
x = QUOTE(safezoneX + GRID_W);
y = QUOTE(safezoneY + safezoneH - 6 * GRID_H);
x = QUOTE(safeZoneX + GRID_W);
y = QUOTE(safeZoneY + safeZoneH - 6 * GRID_H);
w = QUOTE(10 * GRID_W);
h = QUOTE(CTRL_DEFAULT_H);
};
class Footer: ctrlStaticFooter
{
x = QUOTE(safezoneX);
y = QUOTE(safezoneY + safezoneH - 7 * GRID_H);
w = QUOTE(safezoneW);
x = QUOTE(safeZoneX);
y = QUOTE(safeZoneY + safeZoneH - 7 * GRID_H);
w = QUOTE(safeZoneW);
h = QUOTE(CTRL_DEFAULT_H + 2 * GRID_H);
};
};
Expand All @@ -45,9 +45,9 @@ class ENH_FunctionsViewer
class MenuStrip: ctrlMenuStrip
{
idc = IDC_FUNCTIONSVIEWER_MENU;
x = QUOTE(safezoneX);
y = QUOTE(safezoneY + CTRL_DEFAULT_H);
w = QUOTE(safezoneW);
x = QUOTE(safeZoneX);
y = QUOTE(safeZoneY + CTRL_DEFAULT_H);
w = QUOTE(safeZoneW);
h = QUOTE(CTRL_DEFAULT_H);
class Items
{
Expand Down Expand Up @@ -203,10 +203,10 @@ class ENH_FunctionsViewer
{
idc = IDC_FUNCTIONSVIEWER_LIST;
idcSearch = 1400;
x = QUOTE(safezoneX + GRID_W);
y = QUOTE(safezoneY + 2 * CTRL_DEFAULT_H + GRID_H);
x = QUOTE(safeZoneX + GRID_W);
y = QUOTE(safeZoneY + 2 * CTRL_DEFAULT_H + GRID_H);
w = QUOTE(SIDEBAR_W);
h = QUOTE(safezoneH - 3 * CTRL_DEFAULT_H - 3 * GRID_H);
h = QUOTE(safeZoneH - 3 * CTRL_DEFAULT_H - 3 * GRID_H);
colorLines[] = {1, 1, 1, 1};
borderSize = 0;
colorBorder[] = {0, 0, 0, 0};
Expand All @@ -215,16 +215,16 @@ class ENH_FunctionsViewer
{
idc = IDC_FUNCTIONSVIEWER_SEARCH;
tooltip = __EVAL(format ["%1+%2", toUpper localize "STR_DIK_CONTROL", "F"]);
x = QUOTE(safezoneX + 12 * GRID_W);
y = QUOTE(safezoneY + safezoneH - 6 * GRID_H);
x = QUOTE(safeZoneX + 12 * GRID_W);
y = QUOTE(safeZoneY + safeZoneH - 6 * GRID_H);
w = QUOTE(53 * GRID_W);
h = QUOTE(CTRL_DEFAULT_H);
};
class ButtonSearch: ctrlButtonSearch
{
idc = IDC_FUNCTIONSVIEWER_BUTTONSEARCH;
x = QUOTE(safezoneX + 65 * GRID_W);
y = QUOTE(safezoneY + safezoneH - 6 * GRID_H);
x = QUOTE(safeZoneX + 65 * GRID_W);
y = QUOTE(safeZoneY + safeZoneH - 6 * GRID_H);
w = QUOTE(5 * GRID_W);
h = QUOTE(CTRL_DEFAULT_H);
};
Expand All @@ -233,57 +233,57 @@ class ENH_FunctionsViewer
idc = IDC_FUNCTIONSVIEWER_NAME;
tooltip = "$STR_ENH_MAIN_FUNCTIONSVIEWER_FUNCTIONNAME_TOOLTIP";
canModify = 0;
x = QUOTE(safezoneX + 72 * GRID_W);
y = QUOTE(safezoneY + 2 * CTRL_DEFAULT_H + GRID_H);
x = QUOTE(safeZoneX + 72 * GRID_W);
y = QUOTE(safeZoneY + 2 * CTRL_DEFAULT_H + GRID_H);
w = QUOTE(70 * GRID_W);
h = QUOTE(CTRL_DEFAULT_H);
};
class Path: Name
{
idc = IDC_FUNCTIONSVIEWER_PATH;
tooltip = "$STR_ENH_MAIN_FUNCTIONSVIEWER_FUNCTIONPATH_TOOLTIP";
x = QUOTE(safezoneX + 143 * GRID_W);
w = QUOTE(safezoneW - (143 + 1) * GRID_W);
x = QUOTE(safeZoneX + 143 * GRID_W);
w = QUOTE(safeZoneW - (143 + 1) * GRID_W);
};
class SearchCode: ctrlEdit
{
idc = IDC_FUNCTIONSVIEWER_SEARCHCODE;
tooltip = __EVAL(toUpper format ["%1+%2+%3", localize "STR_DIK_CONTROL", localize "STR_VK_SHIFT", "F"]);
x = QUOTE(safezoneX + 72 * GRID_W);
y = QUOTE(safezoneY + safezoneH - 6 * GRID_H);
x = QUOTE(safeZoneX + 72 * GRID_W);
y = QUOTE(safeZoneY + safeZoneH - 6 * GRID_H);
w = QUOTE(40 * GRID_W);
h = QUOTE(CTRL_DEFAULT_H);
onKeyUp = "_this call ENH_fnc_functionsViewer_searchKey";
};
class SearchText: ctrlStatic
{
idc = IDC_FUNCTIONSVIEWER_SEARCHTEXT;
x = QUOTE(safezoneX + 113 * GRID_W);
y = QUOTE(safezoneY + safezoneH - 6 * GRID_H);
x = QUOTE(safeZoneX + 113 * GRID_W);
y = QUOTE(safeZoneY + safeZoneH - 6 * GRID_H);
w = QUOTE(30 * GRID_W);
h = QUOTE(CTRL_DEFAULT_H);
};
class SearchButtonUp: ctrlButtonPictureKeepAspect
{
text = "\a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\arrow_up_ca.paa";
x = QUOTE(safezoneX + 135 * GRID_W);
y = QUOTE(safezoneY + safezoneH - 6 * GRID_H);
x = QUOTE(safeZoneX + 135 * GRID_W);
y = QUOTE(safeZoneY + safeZoneH - 6 * GRID_H);
w = QUOTE(5 * GRID_W);
h = QUOTE(CTRL_DEFAULT_H);
onButtonClick = "[_this # 0, -1] call ENH_fnc_FunctionsViewer_IncrementKey";
};
class SearchButtonDown: SearchButtonUp
{
text = "\a3\ui_f\data\gui\rsc\rscdisplaymultiplayer\arrow_down_ca.paa";
x = QUOTE(safezoneX + 129 * GRID_W);
x = QUOTE(safeZoneX + 129 * GRID_W);
onButtonClick = "[_this # 0, 1] call ENH_fnc_functionsViewer_incrementKey";
};
class Preview: ctrlControlsGroup
{
idc = IDC_FUNCTIONSVIEWER_GROUP;
x = QUOTE(safezoneX + 72 * GRID_W);
y = QUOTE(safezoneY + 3 * CTRL_DEFAULT_H + 2 * GRID_H);
w = QUOTE(safezoneW - 73 * GRID_W);
x = QUOTE(safeZoneX + 72 * GRID_W);
y = QUOTE(safeZoneY + 3 * CTRL_DEFAULT_H + 2 * GRID_H);
w = QUOTE(safeZoneW - 73 * GRID_W);
h = QUOTE(safeZoneH - 4 * CTRL_DEFAULT_H - 4 * GRID_H);
class Controls
{
Expand Down Expand Up @@ -314,8 +314,8 @@ class ENH_FunctionsViewer
};
class Close: ctrlButtonClose
{
x = QUOTE(safezoneX + safezoneW - 26 * GRID_W);
y = QUOTE(safezoneY + safezoneH - 6 * GRID_H);
x = QUOTE(safeZoneX + safeZoneW - 26 * GRID_W);
y = QUOTE(safeZoneY + safeZoneH - 6 * GRID_H);
w = QUOTE(25 * GRID_W);
h = QUOTE(CTRL_DEFAULT_H);
};
Expand Down
2 changes: 1 addition & 1 deletion addons/main/GUI/placementTools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ENH_PlacementToolsGroup: ctrlControlsGroup
idc = IDC_PLACEMENTTOOLS;
onLoad = "[ctrlParent (_this#0), 'onLoad'] call ENH_fnc_placementTools";
onUnload = "[ctrlParent (_this#0), 'onUnload'] call ENH_fnc_placementTools";
x = QUOTE(safezoneX + 2 * GRID_W);
x = QUOTE(safeZoneX + 2 * GRID_W);
y = QUOTE(WINDOW_TOPAbs + 2 * CTRL_DEFAULT_H + 3 * GRID_H);
w = QUOTE(58 * GRID_W);
h = QUOTE(WINDOW_HAbs - 5 * CTRL_DEFAULT_H);
Expand Down
2 changes: 1 addition & 1 deletion addons/main/attributesMission/establishingShot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ENH_EstablishingShot
property = "ENH_establisingShot";
control = "ENH_EstablishingShot";
expression = "if (!is3DEN && !((_value # 0) isEqualTo [0, 0, 0]) && hasInterface) then {_value spawn BIS_fnc_establishingShot}";
defaultValue = "[[0, 0, 0], getText (configfile >> 'CfgWorlds' >> worldName >> 'description'), 500, 200, 60, 0]";
defaultValue = "[[0, 0, 0], getText (configFile >> 'CfgWorlds' >> worldName >> 'description'), 500, 200, 60, 0]";
};
};
};
10 changes: 5 additions & 5 deletions addons/main/display3DEN/display3DEN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class Display3DEN
{
class ENH_Footer: ctrlStaticFooter
{
y = QUOTE(safezoneH - (28 + 7) * GRID_H);
y = QUOTE(safeZoneH - (28 + 7) * GRID_H);
w = QUOTE(60 * GRID_W);
h = QUOTE(7 * GRID_H);
};
Expand Down Expand Up @@ -230,7 +230,7 @@ class Display3DEN
x = QUOTE(0);
y = QUOTE(7 * GRID_H);
w = QUOTE(60 * GRID_W);
h = QUOTE(safezoneH - (28 + 21) * GRID_H);
h = QUOTE(safeZoneH - (28 + 21) * GRID_H);
borderSize = 0;
colorBorder[] = {0, 0, 0, 0};
multiselectEnabled = 1;
Expand All @@ -240,7 +240,7 @@ class Display3DEN
idc = IDC_DISPLAY3DEN_FAVORITES_BUTTON_DELETE;
text = "$STR_DISP_DELETE";
x = QUOTE(GRID_W);
y = QUOTE(safezoneH - (28 + 6) * GRID_H);
y = QUOTE(safeZoneH - (28 + 6) * GRID_H);
w = QUOTE(58 * GRID_W);
h = QUOTE(CTRL_DEFAULT_H);
};
Expand Down Expand Up @@ -297,15 +297,15 @@ class Display3DEN
x = QUOTE(0);
y = QUOTE(7 * GRID_H);
w = QUOTE(60 * GRID_W);
h = QUOTE(safezoneH - 35 * GRID_H);
h = QUOTE(safeZoneH - 35 * GRID_H);
onTreeDblClick = "['select', _this] call bis_fnc_3DENListLocations; ['view'] call ENH_fnc_locationList_enhanced";
disableKeyboardSearch = 1;
expandOnDoubleclick = 0;
idcSearch = 800;
};
class EditPanel: ctrlControlsGroupNoScrollbars
{
y = QUOTE(safezoneH - 29 * GRID_H);
y = QUOTE(safeZoneH - 29 * GRID_H);
w = QUOTE(60 * GRID_W);
h = QUOTE(7 * GRID_H);
class Controls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ _ctrlFilter lnbAddRow ["", localize "STR_ENH_MAIN_TOOLS_3DENSHORTCUTS_ACTION", l
_ctrlButtonSearch ctrlAddEventHandler ["ButtonClick",
{
params ["_ctrlButton"];
ctrlparent _ctrlButton displayCtrl IDC_SHORTCUTS_SEARCH ctrlSetText "";
ctrlParent _ctrlButton displayCtrl IDC_SHORTCUTS_SEARCH ctrlSetText "";
_ctrlButton ctrlSetText TEXTURE_SEARCH_START;
}];

_ctrlSearch ctrlAddEventHandler ["EditChanged",
{
params ["_ctrlSearch", "_newText"];
ctrlparent _ctrlSearch displayCtrl IDC_SHORTCUTS_BUTTONSEARCH ctrlSetText TEXTURE_SEARCH_END;
[ctrlparent _ctrlSearch displayCtrl IDC_SHORTCUTS_CONTENT, _newText] call ENH_fnc_3DENShortcuts_fillList;
ctrlParent _ctrlSearch displayCtrl IDC_SHORTCUTS_BUTTONSEARCH ctrlSetText TEXTURE_SEARCH_END;
[ctrlParent _ctrlSearch displayCtrl IDC_SHORTCUTS_CONTENT, _newText] call ENH_fnc_3DENShortcuts_fillList;
}];

//Focus search so user can search right away
Expand Down
2 changes: 1 addition & 1 deletion addons/main/functions/GUI/CFGS/fn_CFGS_changeFilter.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
params ["_ctrlFilter", "_selectedIndex"];
[_ctrlFilter lbData _selectedIndex] call ENH_fnc_CFGS_getCfgSentences;

(ctrlparent _ctrlFilter) displayCtrl IDC_SENTENCESBROWSER_SEARCH ctrlSetText "";
(ctrlParent _ctrlFilter) displayCtrl IDC_SENTENCESBROWSER_SEARCH ctrlSetText "";
2 changes: 1 addition & 1 deletion addons/main/functions/GUI/CFGS/fn_CFGS_handleFavorites.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ else
{
private _ctrlHighlight = [((_this select 0) displayCtrl 1000), 5] call BIS_fnc_highlightControl;
sleep 2;
ctrldelete _ctrlHighlight;
ctrlDelete _ctrlHighlight;
};
}
else
Expand Down
4 changes: 2 additions & 2 deletions addons/main/functions/GUI/CFGS/fn_CFGS_playOrCopy.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ else
_data = (str _data) + endl + endl + "Example:" + endl + endl + format ["playSound3D ['%1', player];", _data select 4] + endl + endl +
"[['SPEAKER', " + str _text + ", 0]] " + "spawn BIS_fnc_EXP_camp_playSubtitles;";

uinamespace setVariable ["Display3DENCopy_data", ["", _data]];
(uiNamespace getVariable "ENH_CFGS_Display") createdisplay "Display3DENCopy";
uiNamespace setVariable ["Display3DENCopy_data", ["", _data]];
(uiNamespace getVariable "ENH_CFGS_Display") createDisplay "Display3DENCopy";
};
2 changes: 1 addition & 1 deletion addons/main/functions/GUI/ESE/fn_ESE_export.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ switch (_mode) do
_export = _export regexReplace ["(,)([^ ])", "$1 $2"];
_export = trim _export;

uinamespace setVariable ["display3DENCopy_data", ["Export to Arsenal (LOCALIZE)", _export]];
uiNamespace setVariable ["display3DENCopy_data", ["Export to Arsenal (LOCALIZE)", _export]];
(uiNamespace getVariable ["ENH_Display_ESE", displayNull]) createDisplay "display3denCopy";

nil
4 changes: 2 additions & 2 deletions addons/main/functions/GUI/ESE/fn_ESE_getConfigValues.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ if (count _input > 0) then {
_category,
_specificType,
getText (_x >> "descriptionShort") regexReplace ["<br[\W ]*\/>", "\n"],
_class //Properly cased configname for displaying
_class //Properly cased configName for displaying
]
]
]
}
}
};

[TYPES_WHITELIST, _itemsHashMap, _addons]
[TYPES_WHITELIST, _itemsHashMap, _addons]
2 changes: 1 addition & 1 deletion addons/main/functions/GUI/ESE/fn_ESE_handleTemplates.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ switch (_mode) do
{
_x params ["_name", "_description", "_data", ["_date", systemTime]];
[_lbTemplates, _name, _data, "", "", _description, [_date] call ENH_fnc_systemTimeFormatted] call ENH_fnc_ESE_lbAdd;
} foreach (profileNamespace getVariable ["ENH_VIM_Templates", []]);
} forEach (profileNamespace getVariable ["ENH_VIM_Templates", []]);
};
};
2 changes: 1 addition & 1 deletion addons/main/functions/GUI/RPTViewer/fn_RPTViewer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "\x\enh\addons\main\script_component.hpp"
#define LINES (uiNamespace getVariable ["ENH_RPTViewer_Lines", 100])

if !(isClass (configfile >> "CfgPatches" >> "PY3_Pythia")) exitWith
if !(isClass (configFile >> "CfgPatches" >> "PY3_Pythia")) exitWith
{
["ENH_GetPythiaMod_Warning", 1, 10] call BIS_fnc_3DENNotification;
};
Expand Down
6 changes: 3 additions & 3 deletions addons/main/functions/GUI/SAM/fn_SAM.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,16 @@ switch _mode do

//Store templates in profilenamespace and save it.
profileNamespace setVariable ["ENH_SAM_Templates", _templates];
saveprofileNamespace;
saveProfileNamespace;
};
case "getScenarioAttributes":
{
private _attributeValues = [];
private _sections = [configfile >> "Cfg3DEN" >> "Mission", 0, false] call BIS_fnc_returnChildren;
private _sections = [configFile >> "Cfg3DEN" >> "Mission", 0, false] call BIS_fnc_returnChildren;

{
private _section = configName _x;
private _children = [configfile >> "Cfg3DEN" >> "Mission" >> _section >> "AttributeCategories", 2, false] call BIS_fnc_returnChildren;
private _children = [configFile >> "Cfg3DEN" >> "Mission" >> _section >> "AttributeCategories", 2, false] call BIS_fnc_returnChildren;
{
private _attributeDisplayName = getText (_x >> "displayName");
private _attributeName = getText (_x >> "property");//By default get _attributeValue by propertyName
Expand Down
Loading

0 comments on commit 20a8c06

Please sign in to comment.