diff --git a/.hemtt/project.toml b/.hemtt/project.toml index 39060b6e9..9585b5761 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -16,14 +16,11 @@ include = [ [version] git_hash = 0 +# Unused in HEMTT v1.11 or higher, kept for backwards compatibility [asc] enabled = true exclude = [ - "/initsettings.sqf", - "/initkeybinds.sqf", - "/xeh_prep.sqf", - "/backwards_comp.sqf", - "settings/gui_createcategory.sqf", + ".inc.sqf", "diagnostic/fnc_isdebugconsoleallowed.sqf", "xeh/fnc_initdisplay.sqf", "xeh/fnc_startloadingscreen.sqf", diff --git a/addons/accessory/XEH_PREP.sqf b/addons/accessory/XEH_PREP.hpp similarity index 100% rename from addons/accessory/XEH_PREP.sqf rename to addons/accessory/XEH_PREP.hpp diff --git a/addons/accessory/XEH_preInit.sqf b/addons/accessory/XEH_preInit.sqf index 07b57c31f..68e45359e 100644 --- a/addons/accessory/XEH_preInit.sqf +++ b/addons/accessory/XEH_preInit.sqf @@ -2,7 +2,7 @@ if (!hasInterface) exitWith {}; -#include "XEH_PREP.sqf" +#include "XEH_PREP.hpp" GVAR(usageHash) = createHashMap; diff --git a/addons/accessory/XEH_preStart.sqf b/addons/accessory/XEH_preStart.sqf index 43f1adee3..022888575 100644 --- a/addons/accessory/XEH_preStart.sqf +++ b/addons/accessory/XEH_preStart.sqf @@ -1,3 +1,3 @@ #include "script_component.hpp" -#include "XEH_PREP.sqf" +#include "XEH_PREP.hpp" diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 459b7734a..f75233a19 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -54,7 +54,7 @@ GVAR(addons) = call (uiNamespace getVariable [QGVAR(addons), {[]}]); activateAddons GVAR(addons); // BWC -#include "backwards_comp.sqf" +#include "backwards_comp.inc.sqf" // fix changing direction of remote units not working with zeus ["ModuleCurator_F", "init", { diff --git a/addons/common/backwards_comp.sqf b/addons/common/backwards_comp.inc.sqf similarity index 100% rename from addons/common/backwards_comp.sqf rename to addons/common/backwards_comp.inc.sqf diff --git a/addons/diagnostic/XEH_PREP.sqf b/addons/diagnostic/XEH_PREP.hpp similarity index 100% rename from addons/diagnostic/XEH_PREP.sqf rename to addons/diagnostic/XEH_PREP.hpp diff --git a/addons/diagnostic/XEH_preInit.sqf b/addons/diagnostic/XEH_preInit.sqf index 8bd5965d8..f72820637 100644 --- a/addons/diagnostic/XEH_preInit.sqf +++ b/addons/diagnostic/XEH_preInit.sqf @@ -5,8 +5,8 @@ LOG(MSG_INIT); ADDON = false; -#include "XEH_PREP.sqf" -#include "initSettings.sqf" +#include "XEH_PREP.hpp" +#include "initSettings.inc.sqf" [QGVAR(debug), {_this call CBA_fnc_debug}] call CBA_fnc_addEventHandler; diff --git a/addons/diagnostic/XEH_preStart.sqf b/addons/diagnostic/XEH_preStart.sqf index a0f80b8b1..788d38798 100644 --- a/addons/diagnostic/XEH_preStart.sqf +++ b/addons/diagnostic/XEH_preStart.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" -#include "XEH_PREP.sqf" +#include "XEH_PREP.hpp" PREP(initExtendedDebugConsole); PREP(initTargetDebugConsole); diff --git a/addons/diagnostic/initSettings.sqf b/addons/diagnostic/initSettings.inc.sqf similarity index 100% rename from addons/diagnostic/initSettings.sqf rename to addons/diagnostic/initSettings.inc.sqf diff --git a/addons/disposable/XEH_PREP.sqf b/addons/disposable/XEH_PREP.hpp similarity index 100% rename from addons/disposable/XEH_PREP.sqf rename to addons/disposable/XEH_PREP.hpp diff --git a/addons/disposable/XEH_preInit.sqf b/addons/disposable/XEH_preInit.sqf index 5d982efe8..123957c90 100644 --- a/addons/disposable/XEH_preInit.sqf +++ b/addons/disposable/XEH_preInit.sqf @@ -2,11 +2,11 @@ ADDON = false; -#include "initSettings.sqf" +#include "initSettings.inc.sqf" if (configProperties [configFile >> "CBA_DisposableLaunchers"] isEqualTo []) exitWith {}; -#include "XEH_PREP.sqf" +#include "XEH_PREP.hpp" ["loadout", { params ["_unit"]; diff --git a/addons/disposable/XEH_preStart.sqf b/addons/disposable/XEH_preStart.sqf index 6e8139e83..5ec2b6e9d 100644 --- a/addons/disposable/XEH_preStart.sqf +++ b/addons/disposable/XEH_preStart.sqf @@ -5,4 +5,4 @@ PREP(initDisplayInventory); if (configProperties [configFile >> "CBA_DisposableLaunchers"] isEqualTo []) exitWith {}; -#include "XEH_PREP.sqf" +#include "XEH_PREP.hpp" diff --git a/addons/disposable/initSettings.sqf b/addons/disposable/initSettings.inc.sqf similarity index 100% rename from addons/disposable/initSettings.sqf rename to addons/disposable/initSettings.inc.sqf diff --git a/addons/events/XEH_preInit.sqf b/addons/events/XEH_preInit.sqf index 456f78e24..ddfec7216 100644 --- a/addons/events/XEH_preInit.sqf +++ b/addons/events/XEH_preInit.sqf @@ -27,8 +27,8 @@ if (isServer) then { }; }; -#include "backwards_comp.sqf" -#include "initSettings.sqf" +#include "backwards_comp.inc.sqf" +#include "initSettings.inc.sqf" ADDON = true; diff --git a/addons/events/backwards_comp.sqf b/addons/events/backwards_comp.inc.sqf similarity index 100% rename from addons/events/backwards_comp.sqf rename to addons/events/backwards_comp.inc.sqf diff --git a/addons/events/initSettings.sqf b/addons/events/initSettings.inc.sqf similarity index 100% rename from addons/events/initSettings.sqf rename to addons/events/initSettings.inc.sqf diff --git a/addons/keybinding/XEH_PREP.sqf b/addons/keybinding/XEH_PREP.hpp similarity index 100% rename from addons/keybinding/XEH_PREP.sqf rename to addons/keybinding/XEH_PREP.hpp diff --git a/addons/keybinding/XEH_preInit.sqf b/addons/keybinding/XEH_preInit.sqf index 0b060d509..ac5d3e7aa 100644 --- a/addons/keybinding/XEH_preInit.sqf +++ b/addons/keybinding/XEH_preInit.sqf @@ -3,7 +3,7 @@ SCRIPT(XEH_preInit); if (!hasInterface) exitWith {}; -#include "XEH_PREP.sqf" +#include "XEH_PREP.hpp" ADDON = false; diff --git a/addons/keybinding/XEH_preStart.sqf b/addons/keybinding/XEH_preStart.sqf index 67b38dd71..02c29374e 100644 --- a/addons/keybinding/XEH_preStart.sqf +++ b/addons/keybinding/XEH_preStart.sqf @@ -2,7 +2,7 @@ if (!hasInterface) exitWith {}; -#include "XEH_PREP.sqf" +#include "XEH_PREP.hpp" private _supportedKeys = [ DIK_ESCAPE, diff --git a/addons/network/XEH_preInit.sqf b/addons/network/XEH_preInit.sqf index 9677020c6..06e9e1bf7 100644 --- a/addons/network/XEH_preInit.sqf +++ b/addons/network/XEH_preInit.sqf @@ -2,7 +2,7 @@ ADDON = false; -#include "initSettings.sqf" +#include "initSettings.inc.sqf" // Restore loadouts lost by the naked unit bug [QGVAR(validateLoadout), { diff --git a/addons/network/initSettings.sqf b/addons/network/initSettings.inc.sqf similarity index 100% rename from addons/network/initSettings.sqf rename to addons/network/initSettings.inc.sqf diff --git a/addons/optics/XEH_PREP.sqf b/addons/optics/XEH_PREP.hpp similarity index 100% rename from addons/optics/XEH_PREP.sqf rename to addons/optics/XEH_PREP.hpp diff --git a/addons/optics/XEH_preInit.sqf b/addons/optics/XEH_preInit.sqf index b2a76bbd9..c0297a706 100644 --- a/addons/optics/XEH_preInit.sqf +++ b/addons/optics/XEH_preInit.sqf @@ -2,17 +2,17 @@ ADDON = false; -#include "initSettings.sqf" +#include "initSettings.inc.sqf" if (configProperties [configFile >> "CBA_PIPItems"] isEqualTo [] && { configProperties [configFile >> "CBA_CarryHandleTypes"] isEqualTo [] }) exitWith {}; -#include "XEH_PREP.sqf" +#include "XEH_PREP.hpp" if (!hasInterface) exitWith {}; -#include "initKeybinds.sqf" +#include "initKeybinds.inc.sqf" QGVAR(pauseOpticLayer) cutText ["", "PLAIN"]; diff --git a/addons/optics/XEH_preStart.sqf b/addons/optics/XEH_preStart.sqf index ae827bb36..b67e7a710 100644 --- a/addons/optics/XEH_preStart.sqf +++ b/addons/optics/XEH_preStart.sqf @@ -7,4 +7,4 @@ if (configProperties [configFile >> "CBA_PIPItems"] isEqualTo [] && { configProperties [configFile >> "CBA_CarryHandleTypes"] isEqualTo [] }) exitWith {}; -#include "XEH_PREP.sqf" +#include "XEH_PREP.hpp" diff --git a/addons/optics/initKeybinds.sqf b/addons/optics/initKeybinds.inc.sqf similarity index 100% rename from addons/optics/initKeybinds.sqf rename to addons/optics/initKeybinds.inc.sqf diff --git a/addons/optics/initSettings.sqf b/addons/optics/initSettings.inc.sqf similarity index 100% rename from addons/optics/initSettings.sqf rename to addons/optics/initSettings.inc.sqf diff --git a/addons/settings/XEH_PREP.sqf b/addons/settings/XEH_PREP.hpp similarity index 100% rename from addons/settings/XEH_PREP.sqf rename to addons/settings/XEH_PREP.hpp diff --git a/addons/settings/XEH_preInit.sqf b/addons/settings/XEH_preInit.sqf index 317e4db32..cc231ed6a 100644 --- a/addons/settings/XEH_preInit.sqf +++ b/addons/settings/XEH_preInit.sqf @@ -4,7 +4,7 @@ ADDON = false; // Don't prep functions if already prepped by CBA_fnc_addSetting to avoid log spam. if (isNil QFUNC(init)) then { - #include "XEH_PREP.sqf" + #include "XEH_PREP.hpp" }; //#define DEBUG_MODE_FULL @@ -42,7 +42,7 @@ if (isNil QFUNC(init)) then { #endif // --- init settings namespaces -#include "initSettings.sqf" +#include "initSettings.inc.sqf" // --- event to refresh missionNamespace value if setting has changed and call public event as well as execute setting script [QGVAR(refreshSetting), { diff --git a/addons/settings/XEH_preStart.sqf b/addons/settings/XEH_preStart.sqf index 6e5b51830..311d4b294 100644 --- a/addons/settings/XEH_preStart.sqf +++ b/addons/settings/XEH_preStart.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" -#include "XEH_PREP.sqf" +#include "XEH_PREP.hpp" PREP(initDisplayMain); diff --git a/addons/settings/fnc_addSetting.sqf b/addons/settings/fnc_addSetting.sqf index 11d45398f..b2151fdb8 100644 --- a/addons/settings/fnc_addSetting.sqf +++ b/addons/settings/fnc_addSetting.sqf @@ -47,7 +47,7 @@ Author: // Prep functions if not yet prepped to avoid race condition. if (isNil QFUNC(init)) then { - #include "XEH_PREP.sqf" + #include "XEH_PREP.hpp" }; call FUNC(init) == 0 diff --git a/addons/settings/fnc_gui_addonChanged.sqf b/addons/settings/fnc_gui_addonChanged.sqf index 643f76cfd..ebe402506 100644 --- a/addons/settings/fnc_gui_addonChanged.sqf +++ b/addons/settings/fnc_gui_addonChanged.sqf @@ -21,7 +21,7 @@ uiNamespace setVariable [QGVAR(addonIndex), _index]; private _selectedSource = uiNamespace getVariable QGVAR(source); if !(_display getVariable [_selectedAddon, false]) then { - #include "gui_createCategory.sqf" + #include "gui_createCategory.inc.sqf" _display setVariable [_selectedAddon, true]; }; diff --git a/addons/settings/fnc_init.sqf b/addons/settings/fnc_init.sqf index 3b35a4981..b3972e0bf 100644 --- a/addons/settings/fnc_init.sqf +++ b/addons/settings/fnc_init.sqf @@ -51,7 +51,7 @@ if (canSuspend) exitWith { }; // --- init settings system, makes this function useable in preInit without having to add "CBA_settings" to requiredAddons -#include "initSettings.sqf" +#include "initSettings.inc.sqf" params [ ["_setting", "", [""]], diff --git a/addons/settings/gui_createCategory.sqf b/addons/settings/gui_createCategory.inc.sqf similarity index 100% rename from addons/settings/gui_createCategory.sqf rename to addons/settings/gui_createCategory.inc.sqf diff --git a/addons/settings/initSettings.sqf b/addons/settings/initSettings.inc.sqf similarity index 100% rename from addons/settings/initSettings.sqf rename to addons/settings/initSettings.inc.sqf diff --git a/addons/ui/XEH_preInit.sqf b/addons/ui/XEH_preInit.sqf index cee1d51c1..86fcaae83 100644 --- a/addons/ui/XEH_preInit.sqf +++ b/addons/ui/XEH_preInit.sqf @@ -2,7 +2,7 @@ ADDON = false; -#include "initSettings.sqf" +#include "initSettings.inc.sqf" if (hasInterface) then { call COMPILE_FILE(flexiMenu\init); diff --git a/addons/ui/initSettings.sqf b/addons/ui/initSettings.inc.sqf similarity index 100% rename from addons/ui/initSettings.sqf rename to addons/ui/initSettings.inc.sqf diff --git a/sqfc.json b/sqfc.json index 59e77fb47..6deade7e6 100644 --- a/sqfc.json +++ b/sqfc.json @@ -6,11 +6,7 @@ "P:/" ], "excludeList": [ - "\\initsettings.sqf", - "\\initkeybinds.sqf", - "\\xeh_prep.sqf", - "\\backwards_comp.sqf", - "settings\\gui_createcategory.sqf", + ".inc.sqf", "diagnostic\\fnc_isdebugconsoleallowed.sqf", "xeh\\fnc_initdisplay.sqf", "xeh\\fnc_startloadingscreen.sqf", diff --git a/tools/sqfvmChecker.py b/tools/sqfvmChecker.py index 45144cdad..a1db19a04 100644 --- a/tools/sqfvmChecker.py +++ b/tools/sqfvmChecker.py @@ -7,7 +7,7 @@ addon_base_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) files_to_ignore_lower = [ - x.lower() for x in ["initSettings.sqf", "initKeybinds.sqf", "XEH_PREP.sqf", "backwards_comp.sqf", "gui_createCategory.sqf", "test_settings_comments.sqf", "test_settings_comments_eof.sqf", "test_settings_multiline.sqf", "test_settings_regular.sqf", "test_settings_unicode.sqf"] + x.lower() for x in ["test_settings_comments.sqf", "test_settings_comments_eof.sqf", "test_settings_multiline.sqf", "test_settings_regular.sqf", "test_settings_unicode.sqf"] ] sqfvm_exe = os.path.join(addon_base_path, "sqfvm.exe") virtual_paths = [ @@ -23,7 +23,7 @@ def get_files_to_process(basePath): for root, _dirs, files in os.walk(os.path.join(addon_base_path, "addons")): for file in files: if file.endswith(".sqf") or file == "config.cpp": - if file.lower() in files_to_ignore_lower: + if file.endswith(".inc.sqf") or file.lower() in files_to_ignore_lower: continue skipPreprocessing = False for addonTomlPath in [os.path.join(root, "addon.toml"), os.path.join(os.path.dirname(root), "addon.toml")]: @@ -31,7 +31,7 @@ def get_files_to_process(basePath): with open(addonTomlPath, "rb") as f: tomlFile = tomllib.load(f) try: - skipPreprocessing = not tomlFile.get('rapify')['enabled'] + skipPreprocessing = tomlFile.get('tools')['sqfvm_skipConfigChecks'] except: pass if file == "config.cpp" and skipPreprocessing: @@ -41,7 +41,7 @@ def get_files_to_process(basePath): return arma_files -def process_file(filePath, skipA3Warnings=True): +def process_file(filePath, skipA3Warnings=True, skipPragmaHemtt=True): with open(filePath, "r", encoding="utf-8", errors="ignore") as file: content = file.read() if content.startswith("//pragma SKIP_COMPILE"): @@ -70,10 +70,8 @@ def process_file(filePath, skipA3Warnings=True): if line.startswith("[ERR]"): fileHasError = True if not ( - skipA3Warnings - and line.startswith("[WRN]") - and ("a3/" in line) - and (("Unexpected IFDEF" in line) or ("defined twice" in line)) + (skipA3Warnings and line.startswith("[WRN]") and ("a3/" in line) and (("Unexpected IFDEF" in line) or ("defined twice" in line))) + or (skipPragmaHemtt and line.startswith("[WRN]") and ("Unknown pragma instruction 'hemtt'" in line)) ): print(" {}".format(line)) return fileHasError