diff --git a/addons/common/Cfg3DEN.hpp b/addons/common/Cfg3DEN.hpp index e82a7b55b..883508cb3 100644 --- a/addons/common/Cfg3DEN.hpp +++ b/addons/common/Cfg3DEN.hpp @@ -15,8 +15,7 @@ class Cfg3DEN { for '_y' from 1900 to 2050 do {\ _ctrlYear lbSetValue [ARR_2(_ctrlYear lbAdd str _y,_y)];\ };\ - _ctrlYear lbSetCurSel 53;\ - ); + _ctrlYear lbSetCurSel 53;); }; }; }; @@ -32,8 +31,7 @@ class Cfg3DEN { _this setGroupID [ARR_1(_value)];\ } else {\ [ARR_2(_this,_value)] call CBA_fnc_setCallsign;\ - };\ - ); + };); }; }; }; diff --git a/addons/diagnostic/gui.hpp b/addons/diagnostic/gui.hpp index ff7f0d8fc..c72bfa8e4 100644 --- a/addons/diagnostic/gui.hpp +++ b/addons/diagnostic/gui.hpp @@ -14,8 +14,8 @@ class RscTitles { idc = -1; font = "RobotoCondensedBold"; sizeEx = QUOTE(0.55 * GUI_GRID_CENTER_H); - x = QUOTE( 0 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X); - y = QUOTE( 5 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y); + x = QUOTE(0 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X); + y = QUOTE(5 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y); w = QUOTE(40 * GUI_GRID_CENTER_W); h = QUOTE(10 * GUI_GRID_CENTER_H); colorBackground[] = {1,0.2,0,0.8}; diff --git a/addons/events/config.cpp b/addons/events/config.cpp index 7feefddd8..f1c36854a 100644 --- a/addons/events/config.cpp +++ b/addons/events/config.cpp @@ -18,6 +18,7 @@ class CfgPatches { #include "CfgFunctions.hpp" class RscDisplayChat { +#pragma hemtt suppress pw3_padded_arg line onKeyDown = QUOTE(\ if ((_this select 1) in [ARR_2(DIK_RETURN,DIK_NUMPADENTER)]) then {\ [ARR_2('GVAR(chatMessageSent)',[ARR_2(ctrlText ((_this select 0) displayctrl 101),_this select 0)])] call CBA_fnc_localEvent;\ diff --git a/addons/optics/RscInGameUI.hpp b/addons/optics/RscInGameUI.hpp index 71d02eb0d..c5fbd29ef 100644 --- a/addons/optics/RscInGameUI.hpp +++ b/addons/optics/RscInGameUI.hpp @@ -10,7 +10,7 @@ class RscInGameUI { }; class CBA_ScriptedOptic: RscWeaponZeroing { - onLoad = QUOTE([ARR_2(_this select 0, true)] call FUNC(loadScriptedOptic)); + onLoad = QUOTE([ARR_2(_this select 0,true)] call FUNC(loadScriptedOptic)); controls[] = {"CA_FOVMode","ScopeBlack","Reticle","BodyNight","BodyDay","TrippleHeadLeft","TrippleHeadRight","CA_Zeroing","Magnification","ActiveDisplayHelper"}; // Idea by Taosenai. This control can be used to determine whether the scope or the collimator is used. diff --git a/addons/settings/gui.hpp b/addons/settings/gui.hpp index a5eb4aef7..39f34fce6 100644 --- a/addons/settings/gui.hpp +++ b/addons/settings/gui.hpp @@ -653,8 +653,7 @@ class RscDisplayEmpty; class GVAR(MainMenuHelper): RscDisplayEmpty { onLoad = QUOTE(\ (_this select 0) call FUNC(openSettingsMenu);\ - (_this select 0) closeDisplay 0;\ - ); + (_this select 0) closeDisplay 0;); }; class GVAR(export) { diff --git a/addons/ui/RscTitles.hpp b/addons/ui/RscTitles.hpp index 981195282..5074d10b1 100644 --- a/addons/ui/RscTitles.hpp +++ b/addons/ui/RscTitles.hpp @@ -1,6 +1,6 @@ class RscTitles { class GVAR(ProgressBar) { - onLoad = QUOTE(with uiNameSpace do { GVAR(ProgressBar) = _this select 0 }; ); + onLoad = QUOTE(with uiNameSpace do { GVAR(ProgressBar) = _this select 0 };); idd = -1; duration = 1e+11; fadeIn = 0; @@ -21,10 +21,10 @@ class RscTitles { style = ST_CENTER; sizeEx = QUOTE(1 * GUI_GRID_CENTER_H); colorBackground[] = {0,0,0,0.5}; - x = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),X))), 0)]); - y = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),Y))), 0)]); - w = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),W))), 0)]); - h = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),H))), 0)]); + x = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),X))),0)]); + y = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),Y))),0)]); + w = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),W))),0)]); + h = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),H))),0)]); }; class TitleText: TitleBackground { @@ -38,10 +38,10 @@ class RscTitles { colorFrame[] = {0,0,0,0.5}; colorBar[] = GUI_BCG_COLOR; texture = "#(argb,8,8,3)color(1,1,1,0.7)"; - x = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),X))), 0)]); - y = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),Y))), 0)]); - w = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),W))), 0)]); - h = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),H))), 0)]); + x = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),X))),0)]); + y = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),Y))),0)]); + w = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),W))),0)]); + h = QUOTE(profileNamespace getVariable [ARR_2(QUOTE(QUOTE(TRIPLES(IGUI,GVAR(grid),H))),0)]); }; class Script: RscMapControl { diff --git a/addons/ui/flexiMenu/data/menu_arma2.hpp b/addons/ui/flexiMenu/data/menu_arma2.hpp index 289b768b7..e3229b228 100644 --- a/addons/ui/flexiMenu/data/menu_arma2.hpp +++ b/addons/ui/flexiMenu/data/menu_arma2.hpp @@ -1,4 +1,5 @@ //#include "..\..\script_component.hpp" +#pragma hemtt suppress pw3_padded_arg file #define _DefaultAspectRatio 3 / 4 #define _SX (safeZoneX+safeZoneW / 2) // screen centre x diff --git a/addons/ui/flexiMenu/data/menu_buttonList.hpp b/addons/ui/flexiMenu/data/menu_buttonList.hpp index edaa63592..2f1beb1c2 100644 --- a/addons/ui/flexiMenu/data/menu_buttonList.hpp +++ b/addons/ui/flexiMenu/data/menu_buttonList.hpp @@ -1,4 +1,5 @@ //#include "..\..\script_component.hpp" +#pragma hemtt suppress pw3_padded_arg file #define _imagePath(TOKEN) QUOTE(PATHTOF(flexiMenu)\data\buttonList\TOKEN.paa) #define _SX (safeZoneX + safeZoneW / 2) // screen centre x diff --git a/addons/ui/flexiMenu/data/menu_iconRow.hpp b/addons/ui/flexiMenu/data/menu_iconRow.hpp index 85b12be22..f377e0075 100644 --- a/addons/ui/flexiMenu/data/menu_iconRow.hpp +++ b/addons/ui/flexiMenu/data/menu_iconRow.hpp @@ -1,4 +1,5 @@ //#include "..\..\script_component.hpp" +#pragma hemtt suppress pw3_padded_arg file #define _imagePath(TOKEN) QUOTE(PATHTOF(flexiMenu)\data\arma2\TOKEN.paa) #define _SX (safeZoneX + safeZoneW / 2) // screen centre x diff --git a/addons/ui/flexiMenu/data/menu_popup.hpp b/addons/ui/flexiMenu/data/menu_popup.hpp index b1295ffbc..2369f9b1c 100644 --- a/addons/ui/flexiMenu/data/menu_popup.hpp +++ b/addons/ui/flexiMenu/data/menu_popup.hpp @@ -1,4 +1,5 @@ // #include "..\..\script_component.hpp" +#pragma hemtt suppress pw3_padded_arg file #define _imagePath(TOKEN) QUOTE(PATHTOF(flexiMenu)\data\popup\TOKEN.paa) #define _SX (safeZoneX + safeZoneW / 2) //screen centre x diff --git a/addons/ui/flexiMenu/data/menu_rose.hpp b/addons/ui/flexiMenu/data/menu_rose.hpp index 7cd947d62..8a8558c44 100644 --- a/addons/ui/flexiMenu/data/menu_rose.hpp +++ b/addons/ui/flexiMenu/data/menu_rose.hpp @@ -1,5 +1,6 @@ //#define DEBUG_MODE_FULL //#include "..\..\script_component.hpp" +#pragma hemtt suppress pw3_padded_arg file #define _DefaultAspectRatio 3 / 4 #define _SX (safeZoneX + safeZoneW / 2) //screen centre x diff --git a/tools/make.py b/tools/make.py index e373247a0..fc0e81fe5 100644 --- a/tools/make.py +++ b/tools/make.py @@ -473,6 +473,21 @@ def cleanup_optionals(mod): print_error("Cleaning Optionals Failed") raise +# mikro tools (before 2023?) don't understand #pragma +def toggle_config_pragmas(do_restore=False): + token_from = "//#pragma-backup-make.py " if do_restore else "#pragma " + token_to = "#pragma " if do_restore else "//#pragma-backup-make.py " + print_green(f"Checking configs for {token_from}") + for root, _dirs, files in os.walk(module_root): + for file in files: + if file.endswith(".cpp") or file.endswith(".hpp"): + with open(os.path.join(root, file), "r", encoding="utf-8") as f: + content = f.read() + if (not token_from in content): continue + print(f"- Replacing {token_from} in {os.path.join(root, file)}") + content = re.sub(token_from, token_to, content) + with open(os.path.join(root, file), "w", encoding="utf-8") as f: + f.write(content) def purge(dir, pattern, friendlyPattern="files"): print_green("Deleting {} files from directory: {}".format(friendlyPattern,dir)) @@ -1105,6 +1120,9 @@ def main(argv): optional_files = [] copy_optionals_for_building(optionals_modules,optional_files) + # hide #pragma from pboProject's sensitive eyes + toggle_config_pragmas(False) + # Get list of subdirs in make root. dirs = next(os.walk(module_root))[1] @@ -1446,6 +1464,8 @@ def main(argv): copy_important_files(module_root_parent,os.path.join(release_dir, project)) if (os.path.isdir(optionals_root)): cleanup_optionals(optionals_modules) + #restore #pragma + toggle_config_pragmas(True) if not version_update: restore_version_files()