Skip to content

Commit

Permalink
Merge pull request #1624 from CBATeam/hemttPadding
Browse files Browse the repository at this point in the history
Configs - Cleanup for hemtt macro padding check
  • Loading branch information
PabstMirror committed Nov 2, 2023
2 parents 099393d + b031ff3 commit 34fc6dc
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 18 deletions.
6 changes: 2 additions & 4 deletions addons/common/Cfg3DEN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;);
};
};
};
Expand All @@ -32,8 +31,7 @@ class Cfg3DEN {
_this setGroupID [ARR_1(_value)];\
} else {\
[ARR_2(_this,_value)] call CBA_fnc_setCallsign;\
};\
);
};);
};
};
};
Expand Down
4 changes: 2 additions & 2 deletions addons/diagnostic/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 1 addition & 0 deletions addons/events/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;\
Expand Down
2 changes: 1 addition & 1 deletion addons/optics/RscInGameUI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions addons/settings/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
18 changes: 9 additions & 9 deletions addons/ui/RscTitles.hpp
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions addons/ui/flexiMenu/data/menu_arma2.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions addons/ui/flexiMenu/data/menu_buttonList.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions addons/ui/flexiMenu/data/menu_iconRow.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions addons/ui/flexiMenu/data/menu_popup.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions addons/ui/flexiMenu/data/menu_rose.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
20 changes: 20 additions & 0 deletions tools/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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]

Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 34fc6dc

Please sign in to comment.