From aa026aee73e54ec2bbff684b2d731ecf75ea6197 Mon Sep 17 00:00:00 2001 From: mharis001 <34453221+mharis001@users.noreply.github.com> Date: Mon, 29 Aug 2022 17:14:40 -0400 Subject: [PATCH] Add SQFC support (#674) --- .gitignore | 2 + addons/ai/CfgEventHandlers.hpp | 6 +- addons/area_markers/CfgEventHandlers.hpp | 6 +- addons/attributes/CfgEventHandlers.hpp | 6 +- addons/camera/CfgEventHandlers.hpp | 6 +- addons/common/CfgEventHandlers.hpp | 6 +- addons/compositions/CfgEventHandlers.hpp | 6 +- addons/context_actions/CfgEventHandlers.hpp | 4 +- addons/context_menu/CfgEventHandlers.hpp | 4 +- addons/cover_map/CfgEventHandlers.hpp | 6 +- addons/custom_modules/CfgEventHandlers.hpp | 4 +- addons/damage/CfgEventHandlers.hpp | 4 +- addons/dialog/CfgEventHandlers.hpp | 4 +- addons/doors/CfgEventHandlers.hpp | 4 +- addons/editor/CfgEventHandlers.hpp | 6 +- addons/editor_previews/CfgEventHandlers.hpp | 6 +- addons/faction_filter/CfgEventHandlers.hpp | 6 +- addons/flashlight/CfgEventHandlers.hpp | 6 +- addons/garage/CfgEventHandlers.hpp | 4 +- addons/inventory/CfgEventHandlers.hpp | 4 +- addons/loadout/CfgEventHandlers.hpp | 4 +- addons/markers_tree/CfgEventHandlers.hpp | 6 +- addons/modules/CfgEventHandlers.hpp | 6 +- addons/placement/CfgEventHandlers.hpp | 6 +- addons/position_logics/CfgEventHandlers.hpp | 4 +- addons/pylons/CfgEventHandlers.hpp | 6 +- addons/remote_control/CfgEventHandlers.hpp | 6 +- addons/tasks/CfgEventHandlers.hpp | 4 +- addons/visibility/CfgEventHandlers.hpp | 6 +- addons/vision/CfgEventHandlers.hpp | 6 +- extras/blank/CfgEventHandlers.hpp | 6 +- include/a3/ui_f/$PBOPREFIX$ | 1 + include/a3/ui_f/hpp/defineResincl.inc | 10 ++ include/a3/ui_f_curator/$PBOPREFIX$ | 1 + include/x/cba/addons/main/$PBOPREFIX$ | 1 + .../cba/addons/main/script_macros_common.hpp | 27 ++-- include/x/cba/addons/xeh/$PBOPREFIX$ | 1 + include/x/cba/addons/xeh/script_xeh.hpp | 106 +++++++++------- optionals/compat_ace/CfgEventHandlers.hpp | 4 +- sqfc.json | 16 +++ tools/make.py | 120 ++++++++++++------ 41 files changed, 262 insertions(+), 185 deletions(-) create mode 100644 include/a3/ui_f/$PBOPREFIX$ create mode 100644 include/a3/ui_f_curator/$PBOPREFIX$ create mode 100644 include/x/cba/addons/main/$PBOPREFIX$ create mode 100644 include/x/cba/addons/xeh/$PBOPREFIX$ create mode 100644 sqfc.json diff --git a/.gitignore b/.gitignore index 6a1f098cf..6309ed310 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ hemtt* !hemtt.toml @zen tools/armake.exe +ArmaScriptCompiler.exe +*.sqfc diff --git a/addons/ai/CfgEventHandlers.hpp b/addons/ai/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/ai/CfgEventHandlers.hpp +++ b/addons/ai/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/area_markers/CfgEventHandlers.hpp b/addons/area_markers/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/area_markers/CfgEventHandlers.hpp +++ b/addons/area_markers/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/attributes/CfgEventHandlers.hpp b/addons/attributes/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/attributes/CfgEventHandlers.hpp +++ b/addons/attributes/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/camera/CfgEventHandlers.hpp b/addons/camera/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/camera/CfgEventHandlers.hpp +++ b/addons/camera/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/common/CfgEventHandlers.hpp b/addons/common/CfgEventHandlers.hpp index e5f9dd9fd..f7f637460 100644 --- a/addons/common/CfgEventHandlers.hpp +++ b/addons/common/CfgEventHandlers.hpp @@ -1,18 +1,18 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/compositions/CfgEventHandlers.hpp b/addons/compositions/CfgEventHandlers.hpp index 43c9bd82b..cb5ec920e 100644 --- a/addons/compositions/CfgEventHandlers.hpp +++ b/addons/compositions/CfgEventHandlers.hpp @@ -1,18 +1,18 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/context_actions/CfgEventHandlers.hpp b/addons/context_actions/CfgEventHandlers.hpp index 93e3311cf..865276cfb 100644 --- a/addons/context_actions/CfgEventHandlers.hpp +++ b/addons/context_actions/CfgEventHandlers.hpp @@ -1,11 +1,11 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; diff --git a/addons/context_menu/CfgEventHandlers.hpp b/addons/context_menu/CfgEventHandlers.hpp index 93e3311cf..865276cfb 100644 --- a/addons/context_menu/CfgEventHandlers.hpp +++ b/addons/context_menu/CfgEventHandlers.hpp @@ -1,11 +1,11 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; diff --git a/addons/cover_map/CfgEventHandlers.hpp b/addons/cover_map/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/cover_map/CfgEventHandlers.hpp +++ b/addons/cover_map/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/custom_modules/CfgEventHandlers.hpp b/addons/custom_modules/CfgEventHandlers.hpp index 93e3311cf..865276cfb 100644 --- a/addons/custom_modules/CfgEventHandlers.hpp +++ b/addons/custom_modules/CfgEventHandlers.hpp @@ -1,11 +1,11 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; diff --git a/addons/damage/CfgEventHandlers.hpp b/addons/damage/CfgEventHandlers.hpp index 93e3311cf..865276cfb 100644 --- a/addons/damage/CfgEventHandlers.hpp +++ b/addons/damage/CfgEventHandlers.hpp @@ -1,11 +1,11 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; diff --git a/addons/dialog/CfgEventHandlers.hpp b/addons/dialog/CfgEventHandlers.hpp index 93e3311cf..865276cfb 100644 --- a/addons/dialog/CfgEventHandlers.hpp +++ b/addons/dialog/CfgEventHandlers.hpp @@ -1,11 +1,11 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; diff --git a/addons/doors/CfgEventHandlers.hpp b/addons/doors/CfgEventHandlers.hpp index 93e3311cf..865276cfb 100644 --- a/addons/doors/CfgEventHandlers.hpp +++ b/addons/doors/CfgEventHandlers.hpp @@ -1,11 +1,11 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; diff --git a/addons/editor/CfgEventHandlers.hpp b/addons/editor/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/editor/CfgEventHandlers.hpp +++ b/addons/editor/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/editor_previews/CfgEventHandlers.hpp b/addons/editor_previews/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/editor_previews/CfgEventHandlers.hpp +++ b/addons/editor_previews/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/faction_filter/CfgEventHandlers.hpp b/addons/faction_filter/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/faction_filter/CfgEventHandlers.hpp +++ b/addons/faction_filter/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/flashlight/CfgEventHandlers.hpp b/addons/flashlight/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/flashlight/CfgEventHandlers.hpp +++ b/addons/flashlight/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/garage/CfgEventHandlers.hpp b/addons/garage/CfgEventHandlers.hpp index 93e3311cf..865276cfb 100644 --- a/addons/garage/CfgEventHandlers.hpp +++ b/addons/garage/CfgEventHandlers.hpp @@ -1,11 +1,11 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; diff --git a/addons/inventory/CfgEventHandlers.hpp b/addons/inventory/CfgEventHandlers.hpp index 93e3311cf..865276cfb 100644 --- a/addons/inventory/CfgEventHandlers.hpp +++ b/addons/inventory/CfgEventHandlers.hpp @@ -1,11 +1,11 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; diff --git a/addons/loadout/CfgEventHandlers.hpp b/addons/loadout/CfgEventHandlers.hpp index 93e3311cf..865276cfb 100644 --- a/addons/loadout/CfgEventHandlers.hpp +++ b/addons/loadout/CfgEventHandlers.hpp @@ -1,11 +1,11 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; diff --git a/addons/markers_tree/CfgEventHandlers.hpp b/addons/markers_tree/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/markers_tree/CfgEventHandlers.hpp +++ b/addons/markers_tree/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/modules/CfgEventHandlers.hpp b/addons/modules/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/modules/CfgEventHandlers.hpp +++ b/addons/modules/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/placement/CfgEventHandlers.hpp b/addons/placement/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/placement/CfgEventHandlers.hpp +++ b/addons/placement/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/position_logics/CfgEventHandlers.hpp b/addons/position_logics/CfgEventHandlers.hpp index 93e3311cf..865276cfb 100644 --- a/addons/position_logics/CfgEventHandlers.hpp +++ b/addons/position_logics/CfgEventHandlers.hpp @@ -1,11 +1,11 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; diff --git a/addons/pylons/CfgEventHandlers.hpp b/addons/pylons/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/pylons/CfgEventHandlers.hpp +++ b/addons/pylons/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/remote_control/CfgEventHandlers.hpp b/addons/remote_control/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/remote_control/CfgEventHandlers.hpp +++ b/addons/remote_control/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/tasks/CfgEventHandlers.hpp b/addons/tasks/CfgEventHandlers.hpp index 93e3311cf..865276cfb 100644 --- a/addons/tasks/CfgEventHandlers.hpp +++ b/addons/tasks/CfgEventHandlers.hpp @@ -1,11 +1,11 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; diff --git a/addons/visibility/CfgEventHandlers.hpp b/addons/visibility/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/visibility/CfgEventHandlers.hpp +++ b/addons/visibility/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/addons/vision/CfgEventHandlers.hpp b/addons/vision/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/addons/vision/CfgEventHandlers.hpp +++ b/addons/vision/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/extras/blank/CfgEventHandlers.hpp b/extras/blank/CfgEventHandlers.hpp index 0d3301d6e..f6503c247 100644 --- a/extras/blank/CfgEventHandlers.hpp +++ b/extras/blank/CfgEventHandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; diff --git a/include/a3/ui_f/$PBOPREFIX$ b/include/a3/ui_f/$PBOPREFIX$ new file mode 100644 index 000000000..93870d7e0 --- /dev/null +++ b/include/a3/ui_f/$PBOPREFIX$ @@ -0,0 +1 @@ +a3\ui_f diff --git a/include/a3/ui_f/hpp/defineResincl.inc b/include/a3/ui_f/hpp/defineResincl.inc index ee8ddd5db..818fd438c 100644 --- a/include/a3/ui_f/hpp/defineResincl.inc +++ b/include/a3/ui_f/hpp/defineResincl.inc @@ -1312,6 +1312,8 @@ enum #define IDC_OPTIONS_SHADOW_VISIBILIT_TEXT 313 #define IDC_OPTIONS_TRAFFIC_VISIBILITY_VALUE 314 #define IDC_OPTIONS_TRAFFIC_VISIBILITY_SLIDER 315 +#define IDC_OPTIONS_PIP_VISIBILITY_VALUE 316 +#define IDC_OPTIONS_PIP_VISIBILITY_SLIDER 317 #define IDC_OPTIONS_PIP_VALUE 334 #define IDC_OPTIONS_SW_VALUE 335 @@ -1433,11 +1435,19 @@ enum #define IDC_OPTIONS_PLAYER_VOICE 112 #define IDC_OPTIONS_VON_VALUE 113 #define IDC_OPTIONS_VON_SLIDER 114 +//samples setting was replaced by audio output device #define IDC_OPTIONS_SAMPLES_VALUE 115 #define IDC_OPTIONS_SAMPLES_SLIDER 116 + +#define IDC_OPTIONS_AUDIO_OUTPUT_REFRESH 115 +#define IDC_OPTIONS_AUDIO_OUTPUT_COMBO 116 + #define IDC_OPTIONS_MIC_SENS_SLIDER 117 #define IDC_OPTIONS_MIC_ADJUST 118 +#define IDC_OPTIONS_MAPDUCKING_VALUE 119 +#define IDC_OPTIONS_MAPDUCKING_SLIDER 120 + // microphone adjustment #define IDC_OPTIONS_MIC_PROGRESS_BAR 1001 #define IDC_OPTIONS_MIC_PROGRESS 1002 diff --git a/include/a3/ui_f_curator/$PBOPREFIX$ b/include/a3/ui_f_curator/$PBOPREFIX$ new file mode 100644 index 000000000..d247b040c --- /dev/null +++ b/include/a3/ui_f_curator/$PBOPREFIX$ @@ -0,0 +1 @@ +a3\ui_f_curator diff --git a/include/x/cba/addons/main/$PBOPREFIX$ b/include/x/cba/addons/main/$PBOPREFIX$ new file mode 100644 index 000000000..2ac604845 --- /dev/null +++ b/include/x/cba/addons/main/$PBOPREFIX$ @@ -0,0 +1 @@ +x\cba\addons\main diff --git a/include/x/cba/addons/main/script_macros_common.hpp b/include/x/cba/addons/main/script_macros_common.hpp index 41a4faea7..be13021c0 100644 --- a/include/x/cba/addons/main/script_macros_common.hpp +++ b/include/x/cba/addons/main/script_macros_common.hpp @@ -197,7 +197,7 @@ Macro: LOG() ------------------------------------------- */ #ifdef DEBUG_MODE_FULL -#define LOG(MESSAGE) LOG_SYS_FILELINENUMBERS('LOG',MESSAGE) +#define LOG(MESSAGE) LOG_SYS('LOG',MESSAGE) #define LOG_1(MESSAGE,ARG1) LOG(FORMAT_1(MESSAGE,ARG1)) #define LOG_2(MESSAGE,ARG1,ARG2) LOG(FORMAT_2(MESSAGE,ARG1,ARG2)) #define LOG_3(MESSAGE,ARG1,ARG2,ARG3) LOG(FORMAT_3(MESSAGE,ARG1,ARG2,ARG3)) @@ -265,7 +265,7 @@ Macro: WARNING() ------------------------------------------- */ #ifdef DEBUG_MODE_NORMAL -#define WARNING(MESSAGE) LOG_SYS_FILELINENUMBERS('WARNING',MESSAGE) +#define WARNING(MESSAGE) LOG_SYS('WARNING',MESSAGE) #define WARNING_1(MESSAGE,ARG1) WARNING(FORMAT_1(MESSAGE,ARG1)) #define WARNING_2(MESSAGE,ARG1,ARG2) WARNING(FORMAT_2(MESSAGE,ARG1,ARG2)) #define WARNING_3(MESSAGE,ARG1,ARG2,ARG3) WARNING(FORMAT_3(MESSAGE,ARG1,ARG2,ARG3)) @@ -304,7 +304,7 @@ Macro: ERROR() Author: Spooner ------------------------------------------- */ -#define ERROR(MESSAGE) LOG_SYS_FILELINENUMBERS('ERROR',MESSAGE) +#define ERROR(MESSAGE) LOG_SYS('ERROR',MESSAGE) #define ERROR_1(MESSAGE,ARG1) ERROR(FORMAT_1(MESSAGE,ARG1)) #define ERROR_2(MESSAGE,ARG1,ARG2) ERROR(FORMAT_2(MESSAGE,ARG1,ARG2)) #define ERROR_3(MESSAGE,ARG1,ARG2,ARG3) ERROR(FORMAT_3(MESSAGE,ARG1,ARG2,ARG3)) @@ -854,6 +854,8 @@ Macro: ISNILS() #define COMPILE_FILE2(var1) COMPILE_FILE2_SYS('var1') #define COMPILE_FILE2_CFG(var1) COMPILE_FILE2_CFG_SYS('var1') +#define COMPILE_SCRIPT(var1) compileScript ['PATHTO_SYS(PREFIX,COMPONENT_F,var1)'] + #define VERSIONING_SYS(var1) class CfgSettings \ { \ @@ -1812,9 +1814,9 @@ Macro: IS_ADMIN_LOGGED /* ------------------------------------------- Macro: FILE_EXISTS - Check if a file exists on machines with interface + Check if a file exists - Reports "false" if the file does not exist and throws an error in RPT. + Reports "false" if the file does not exist. Parameters: FILE - Path to the file @@ -1828,17 +1830,4 @@ Macro: FILE_EXISTS Author: commy2 ------------------------------------------- */ -#define FILE_EXISTS(FILE) (call {\ - private _return = false;\ - isNil {\ - private _control = (uiNamespace getVariable ["RscDisplayMain", displayNull]) ctrlCreate ["RscHTML", -1];\ - if (isNull _control) then {\ - _return = loadFile (FILE) != "";\ - } else {\ - _control htmlLoad (FILE);\ - _return = ctrlHTMLLoaded _control;\ - ctrlDelete _control;\ - };\ - };\ - _return\ -}) +#define FILE_EXISTS(FILE) (fileExists (FILE)) diff --git a/include/x/cba/addons/xeh/$PBOPREFIX$ b/include/x/cba/addons/xeh/$PBOPREFIX$ new file mode 100644 index 000000000..3f514c94c --- /dev/null +++ b/include/x/cba/addons/xeh/$PBOPREFIX$ @@ -0,0 +1 @@ +x\cba\addons\xeh diff --git a/include/x/cba/addons/xeh/script_xeh.hpp b/include/x/cba/addons/xeh/script_xeh.hpp index ef62f1df5..2eba00016 100644 --- a/include/x/cba/addons/xeh/script_xeh.hpp +++ b/include/x/cba/addons/xeh/script_xeh.hpp @@ -9,51 +9,58 @@ // Add all XEH event handlers ///////////////////////////////////////////////////////////////////////////////// -#define EXTENDED_EVENTHANDLERS init = "(_this select 0) call CBA_fnc_initEvents; (_this select 0) call CBA_fnc_init"; \ -fired = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_fired"")"; \ -animChanged = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_animChanged"")"; \ -animDone = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_animDone"")"; \ -animStateChanged = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_animStateChanged"")"; \ -containerClosed = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_containerClosed"")"; \ -containerOpened = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_containerOpened"")"; \ -controlsShifted = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_controlsShifted"")"; \ -dammaged = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_dammaged"")"; \ -engine = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_engine"")"; \ -epeContact = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_epeContact"")"; \ -epeContactEnd = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_epeContactEnd"")"; \ -epeContactStart = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_epeContactStart"")"; \ -explosion = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_explosion"")"; \ -firedNear = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_firedNear"")"; \ -fuel = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_cba_xeh_fuel"")"; \ -gear = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_gear"")"; \ -getIn = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_getIn"")"; \ -getInMan = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_getInMan"")"; \ -getOut = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_getOut"")"; \ -getOutMan = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_getOutMan"")"; \ -handleHeal = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_handleHeal"")"; \ -hit = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_hit"")"; \ -hitPart = "{_this call _x} forEach ((_this select 0 select 0) getVariable ""cba_xeh_hitPart"")"; \ -incomingMissile = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_incomingMissile"")"; \ -inventoryClosed = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_inventoryClosed"")"; \ -inventoryOpened = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_inventoryOpened"")"; \ -killed = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_killed"")"; \ -landedTouchDown = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_landedTouchDown"")"; \ -landedStopped = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_landedStopped"")"; \ -local = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_local"")"; \ -respawn = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_respawn"")"; \ -put = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_put"")"; \ -take = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_take"")"; \ -seatSwitched = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_seatSwitched"")"; \ -seatSwitchedMan = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_seatSwitchedMan"")"; \ -soundPlayed = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_soundPlayed"")"; \ -weaponAssembled = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_weaponAssembled"")"; \ -weaponDisassembled = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_weaponDisassembled"")"; \ -weaponDeployed = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_weaponDeployed"")"; \ -weaponRested = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_weaponRested"")"; \ -reloaded = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_reloaded"")"; +#define EXTENDED_EVENTHANDLERS init = "call cba_xeh_fnc_init"; \ +fired = "call cba_xeh_fnc_fired"; \ +animChanged = "call cba_xeh_fnc_animChanged"; \ +animDone = "call cba_xeh_fnc_animDone"; \ +animStateChanged = "call cba_xeh_fnc_animStateChanged"; \ +containerClosed = "call cba_xeh_fnc_containerClosed"; \ +containerOpened = "call cba_xeh_fnc_containerOpened"; \ +controlsShifted = "call cba_xeh_fnc_controlsShifted"; \ +dammaged = "call cba_xeh_fnc_dammaged"; \ +engine = "call cba_xeh_fnc_engine"; \ +epeContact = "call cba_xeh_fnc_epeContact"; \ +epeContactEnd = "call cba_xeh_fnc_epeContactEnd"; \ +epeContactStart = "call cba_xeh_fnc_epeContactStart"; \ +explosion = "call cba_xeh_fnc_explosion"; \ +firedNear = "call cba_xeh_fnc_firedNear"; \ +fuel = "call cba_xeh_fnc_cba_xeh_fuel"; \ +gear = "call cba_xeh_fnc_gear"; \ +getIn = "call cba_xeh_fnc_getIn"; \ +getInMan = "call cba_xeh_fnc_getInMan"; \ +getOut = "call cba_xeh_fnc_getOut"; \ +getOutMan = "call cba_xeh_fnc_getOutMan"; \ +handleHeal = "call cba_xeh_fnc_handleHeal"; \ +hit = "call cba_xeh_fnc_hit"; \ +hitPart = "call cba_xeh_fnc_hitPart"; \ +incomingMissile = "call cba_xeh_fnc_incomingMissile"; \ +inventoryClosed = "call cba_xeh_fnc_inventoryClosed"; \ +inventoryOpened = "call cba_xeh_fnc_inventoryOpened"; \ +killed = "call cba_xeh_fnc_killed"; \ +landedTouchDown = "call cba_xeh_fnc_landedTouchDown"; \ +landedStopped = "call cba_xeh_fnc_landedStopped"; \ +local = "call cba_xeh_fnc_local"; \ +respawn = "call cba_xeh_fnc_respawn"; \ +put = "call cba_xeh_fnc_put"; \ +take = "call cba_xeh_fnc_take"; \ +seatSwitched = "call cba_xeh_fnc_seatSwitched"; \ +seatSwitchedMan = "call cba_xeh_fnc_seatSwitchedMan"; \ +soundPlayed = "call cba_xeh_fnc_soundPlayed"; \ +weaponAssembled = "call cba_xeh_fnc_weaponAssembled"; \ +weaponDisassembled = "call cba_xeh_fnc_weaponDisassembled"; \ +weaponDeployed = "call cba_xeh_fnc_weaponDeployed"; \ +weaponRested = "call cba_xeh_fnc_weaponRested"; \ +reloaded = "call cba_xeh_fnc_reloaded"; \ +firedMan = "call cba_xeh_fnc_firedMan"; \ +turnIn = "call cba_xeh_fnc_turnIn"; \ +turnOut = "call cba_xeh_fnc_turnOut"; \ +deleted = "call cba_xeh_fnc_deleted"; \ +disassembled = "call cba_xeh_fnc_disassembled"; \ +Suppressed = "call cba_xeh_fnc_Suppressed"; \ +gestureChanged = "call cba_xeh_fnc_gestureChanged"; \ +gestureDone = "call cba_xeh_fnc_gestureDone"; - -/* +/* MACRO: DELETE_EVENTHANDLERS Removes all event handlers. @@ -94,9 +101,18 @@ respawn = ""; \ put = ""; \ take = ""; \ seatSwitched = ""; \ +seatSwitchedMan = ""; \ soundPlayed = ""; \ weaponAssembled = ""; \ weaponDisassembled = ""; \ weaponDeployed = ""; \ weaponRested = ""; \ -reloaded = ""; +reloaded = ""; \ +firedMan = ""; \ +turnIn = ""; \ +turnOut = ""; \ +deleted = ""; \ +disassembled = ""; \ +Suppressed = ""; \ +gestureChanged = ""; \ +gestureDone = "" diff --git a/optionals/compat_ace/CfgEventHandlers.hpp b/optionals/compat_ace/CfgEventHandlers.hpp index 93e3311cf..865276cfb 100644 --- a/optionals/compat_ace/CfgEventHandlers.hpp +++ b/optionals/compat_ace/CfgEventHandlers.hpp @@ -1,11 +1,11 @@ class Extended_PreStart_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preStart)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); + init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; diff --git a/sqfc.json b/sqfc.json new file mode 100644 index 000000000..2e1500e07 --- /dev/null +++ b/sqfc.json @@ -0,0 +1,16 @@ +{ + "inputDirs": [ + "P:/x/zen/addons/" + ], + "includePaths": [ + "P:/" + ], + "excludeList": [ + "initsettings.sqf", + "initkeybinds.sqf", + "initattributes.sqf", + "\\dev\\" + ], + "outputDir": "P:/", + "workerThreads": 12 +} diff --git a/tools/make.py b/tools/make.py index 161b4fe97..9adffe0c7 100644 --- a/tools/make.py +++ b/tools/make.py @@ -51,7 +51,7 @@ import time import timeit import re -import fileinput +from tempfile import mkstemp if sys.platform == "win32": import winreg @@ -227,6 +227,17 @@ def find_bi_tools(work_drive): else: raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") +def mikero_windows_registry(path, access=winreg.KEY_READ): + try: + return winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Mikero\{}".format(path), access=access) + except FileNotFoundError: + try: + return winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Mikero\{}".format(path), access=access) + except FileNotFoundError: + try: + return winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Wow6432Node\Mikero\{}".format(path), access=access) + except FileNotFoundError: + return winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Wow6432Node\Mikero\{}".format(path), access=access) def find_depbo_tools(): """Use registry entries to find DePBO-based tools.""" @@ -235,20 +246,8 @@ def find_depbo_tools(): for tool in requiredToolPaths: try: - try: - k = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Mikero\{}".format(tool)) - path = winreg.QueryValueEx(k, "exe")[0] - except FileNotFoundError: - try: - k = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Mikero\{}".format(tool)) - path = winreg.QueryValueEx(k, "exe")[0] - except FileNotFoundError: - try: - k = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Wow6432Node\Mikero\{}".format(tool)) - path = winreg.QueryValueEx(k, "exe")[0] - except FileNotFoundError: - k = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Wow6432Node\Mikero\{}".format(tool)) - path = winreg.QueryValueEx(k, "exe")[0] + k = mikero_windows_registry(tool) + path = winreg.QueryValueEx(k, "exe")[0] except FileNotFoundError: print_error("Could not find {}".format(tool)) failed = True @@ -264,6 +263,19 @@ def find_depbo_tools(): return requiredToolPaths +def pboproject_settings(): + """Use registry entries to configure needed pboproject settings.""" + value_exclude = "thumbs.db,*.txt,*.h,*.dep,*.cpp,*.bak,*.png,*.log,*.pew,source,*.tga" + + try: + k = mikero_windows_registry(r"pboProject\Settings", access=winreg.KEY_SET_VALUE) + winreg.SetValueEx(k, "m_exclude", 0, winreg.REG_SZ, value_exclude) + winreg.SetValueEx(k, "m_exclude2", 0, winreg.REG_SZ, value_exclude) + winreg.SetValueEx(k, "wildcard_exclude_from_pbo_normal", 0, winreg.REG_SZ, value_exclude) + winreg.SetValueEx(k, "wildcard_exclude_from_pbo_unbinarised_missions", 0, winreg.REG_SZ, value_exclude) + except: + raise Exception("BadDePBO", "pboProject not installed correctly, make sure to run it at least once") + def color(color): """Set the color. Works on Win32 and normal terminals.""" @@ -334,11 +346,11 @@ def copy_important_files(source_dir,destination_dir): print_error("COPYING IMPORTANT FILES.") raise - # Copy all extension DLL's + # Copy all extensions try: os.chdir(os.path.join(source_dir)) print_blue("\nSearching for DLLs in {}".format(os.getcwd())) - filenames = glob.glob("*.dll") + filenames = glob.glob("*.dll") + glob.glob("*.so") if not filenames: print ("Empty SET") @@ -356,7 +368,7 @@ def copy_important_files(source_dir,destination_dir): def copy_optionals_for_building(mod,pbos): - src_directories = os.listdir(optionals_root) + src_directories = next(os.walk(optionals_root))[1] current_dir = os.getcwd() print_blue("\nChecking optionals folder...") @@ -582,9 +594,17 @@ def get_project_version(version_increments=[]): def replace_file(filePath, oldSubstring, newSubstring): - for line in fileinput.input(filePath, inplace=True): - # Use stdout directly, print() adds newlines automatically - sys.stdout.write(line.replace(oldSubstring,newSubstring)) + global work_drive + fh, absPath = mkstemp(None, None, work_drive + "temp") + os.close(fh) + with open(absPath, "w", encoding="utf-8") as newFile: + with open(filePath, encoding="utf-8") as oldFile: + for line in oldFile: + newFile.write(line.replace(oldSubstring, newSubstring)) + + newFile.close() + os.remove(filePath) + shutil.move(absPath, filePath) def set_version_in_files(): @@ -603,7 +623,7 @@ def set_version_in_files(): try: # Save the file contents to a variable if the file exists if os.path.isfile(filePath): - f = open(filePath, "r+") + f = open(filePath, "r+", encoding="utf-8") fileText = f.read() f.close() @@ -826,6 +846,7 @@ def main(argv): make_target = "DEFAULT" # Which section in make.cfg to use for the build new_key = True # Make a new key and use it to sign? quiet = False # Suppress output from build tool? + sqfc_compiling = True # Parse arguments if "help" in argv or "-h" in argv or "--help" in argv: @@ -836,7 +857,6 @@ def main(argv): test -- Copy result to Arma 3. release -- Make archive with . force -- Ignore cache and build all. -checkexternal -- Check External Files target -- Use rules in make.cfg under heading [] rather than default [Make] key -- Use key in working directory with to sign. If it does not @@ -894,12 +914,6 @@ def main(argv): quiet = True argv.remove("quiet") - if "checkexternal" in argv: - argv.remove("checkexternal") - check_external = True - else: - check_external = False - if "version" in argv: argv.remove("version") version_update = True @@ -924,8 +938,6 @@ def main(argv): argv.remove("ci") ciBuild = True - print_yellow("\nCheck external references is set to {}".format(str(check_external))) - # Get the directory the make script is in. make_root = os.path.dirname(os.path.realpath(__file__)) make_root_parent = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) @@ -1034,6 +1046,8 @@ def main(argv): pboproject = depbo_tools["pboProject"] rapifyTool = depbo_tools["rapify"] makepboTool = depbo_tools["MakePbo"] + + pboproject_settings() except: raise print_error("Could not find dePBO tools. Download the needed tools from: https://dev.withsix.com/projects/mikero-pbodll/files") @@ -1122,9 +1136,10 @@ def main(argv): if ret == 0: print_green("Created: {}".format(os.path.join(private_key_path, key_name + ".biprivatekey"))) print("Removing any old signature keys...") - purge(os.path.join(module_root, release_dir, project, "addons"), "^.*\.bisign$","*.bisign") - purge(os.path.join(module_root, release_dir, project, "optionals"), "^.*\.bisign$","*.bisign") - purge(os.path.join(module_root, release_dir, project, "keys"), "^.*\.bikey$","*.bikey") + for root, _dirs, files in os.walk(os.path.join(module_root, release_dir)): + for file in files: + if file.endswith(".bisign") or file.endswith(".bikey"): + os.remove(os.path.join(root, file)) else: print_error("Failed to create key!") @@ -1172,6 +1187,23 @@ def main(argv): print_error("\nFailed to delete {}".format(os.path.join(obsolete_check_path,file))) pass + # Always cleanup old sqfc + for root, _dirs, files in os.walk(module_root_parent): + for file in files: + if file.endswith(".sqfc"): + os.remove(os.path.join(root, file)) + if sqfc_compiling: + print_blue("\nCompiling to sqfc...") + compiler_exe = os.path.join(module_root_parent, "ArmaScriptCompiler.exe") + if not os.path.isfile(compiler_exe): + print_yellow("ArmaScriptCompiler.exe not found in base mod folder - skipping") + else: + ret = subprocess.call([compiler_exe], cwd=module_root_parent, stdout=False) + if ret == 0: + print_green("sqfc finished") + else: + print_error("ArmaScriptCompiler.exe returned unexpected {}".format(ret)) + # For each module, prep files and then build. print_blue("\nBuilding...") for module in modules: @@ -1268,13 +1300,10 @@ def main(argv): if os.path.isfile(nobinFilePath): print_green("$NOBIN$ Found. Proceeding with non-binarizing!") - cmd = [makepboTool, "-P","-A","-G","-N","-X=*.backup", os.path.join(work_drive, prefix, module),os.path.join(module_root, release_dir, project,"addons")] + cmd = [makepboTool, "-P","-A","-X=*.backup", os.path.join(work_drive, prefix, module),os.path.join(module_root, release_dir, project,"addons")] else: - if check_external: - cmd = [pboproject, "-P", os.path.join(work_drive, prefix, module), "+Engine=Arma3", "-S","+Noisy", "+X", "+Clean", "+Mod="+os.path.join(module_root, release_dir, project), "-Key"] - else: - cmd = [pboproject, "-P", os.path.join(work_drive, prefix, module), "+Engine=Arma3", "-S","+Noisy", "-X", "+Clean", "+Mod="+os.path.join(module_root, release_dir, project), "-Key"] + cmd = [pboproject, "+B", "-P", os.path.join(work_drive, prefix, module), "+Engine=Arma3", "-S", "+Noisy", "+Clean", "-Warnings", "+Mod="+os.path.join(module_root, release_dir, project), "-Key"] color("grey") if quiet: @@ -1426,6 +1455,14 @@ def main(argv): except: print_error("ERROR: Could not delete pboProject temp files.") + if sqfc_compiling: + print_blue("\nCleaning up sqfc...") + # cleanup all old sqfc + for root, _dirs, files in os.walk(module_root_parent): + for file in files: + if file.endswith(".sqfc"): + os.remove(os.path.join(root, file)) + # Make release if make_release_zip: release_name = "{}_{}".format(zipPrefix, project_version.rsplit(".", 1)[0]) @@ -1505,6 +1542,9 @@ def main(argv): print("\nTotal Program time elapsed: {0:2}h {1:2}m {2:4.5f}s".format(h,m,s)) if ciBuild: - sys.exit(0) + if len(failedBuilds) > 0: + sys.exit(1) + else: + sys.exit(0) input("Press Enter to continue...")