From 379e02646bd96ef8b4bf8bb3513c8951d9fc33db Mon Sep 17 00:00:00 2001 From: jonpas Date: Fri, 8 Sep 2023 17:25:17 +0200 Subject: [PATCH 1/8] Add ADDON definition with subcomponent --- addons/jam/jam_finish/script_component.hpp | 5 ++-- addons/main/script_macros_common.hpp | 18 +++++++++++---- .../CfgVehicles.hpp} | 19 --------------- addons/xeh/xeh_contact/config.cpp | 21 +++++++++++++++++ addons/xeh/xeh_contact/script_component.hpp | 2 ++ .../config.cpp => xeh_csla/CfgVehicles.hpp} | 19 --------------- addons/xeh/xeh_csla/config.cpp | 21 +++++++++++++++++ addons/xeh/xeh_csla/script_component.hpp | 2 ++ .../config.cpp => xeh_sog/CfgVehicles.hpp} | 19 --------------- addons/xeh/xeh_sog/config.cpp | 21 +++++++++++++++++ addons/xeh/xeh_sog/script_component.hpp | 2 ++ .../config.cpp => xeh_ws/CfgVehicles.hpp} | 23 ++----------------- addons/xeh/xeh_ws/config.cpp | 21 +++++++++++++++++ addons/xeh/xeh_ws/script_component.hpp | 2 ++ 14 files changed, 109 insertions(+), 86 deletions(-) rename addons/xeh/{compat_contact/config.cpp => xeh_contact/CfgVehicles.hpp} (63%) create mode 100644 addons/xeh/xeh_contact/config.cpp create mode 100644 addons/xeh/xeh_contact/script_component.hpp rename addons/xeh/{compat_csla/config.cpp => xeh_csla/CfgVehicles.hpp} (59%) create mode 100644 addons/xeh/xeh_csla/config.cpp create mode 100644 addons/xeh/xeh_csla/script_component.hpp rename addons/xeh/{compat_sog/config.cpp => xeh_sog/CfgVehicles.hpp} (56%) create mode 100644 addons/xeh/xeh_sog/config.cpp create mode 100644 addons/xeh/xeh_sog/script_component.hpp rename addons/xeh/{compat_ws/config.cpp => xeh_ws/CfgVehicles.hpp} (72%) create mode 100644 addons/xeh/xeh_ws/config.cpp create mode 100644 addons/xeh/xeh_ws/script_component.hpp diff --git a/addons/jam/jam_finish/script_component.hpp b/addons/jam/jam_finish/script_component.hpp index 9e174c839a..e909b92ee4 100644 --- a/addons/jam/jam_finish/script_component.hpp +++ b/addons/jam/jam_finish/script_component.hpp @@ -1,3 +1,2 @@ -#define COMPONENT jam_finish -#include "\x\cba\addons\main\script_mod.hpp" -#include "\x\cba\addons\main\script_macros.hpp" +#define SUBCOMPONENT finish +#include "\x\cba\addons\jam\script_component.hpp" diff --git a/addons/main/script_macros_common.hpp b/addons/main/script_macros_common.hpp index be13021c04..7aa5b7de2e 100644 --- a/addons/main/script_macros_common.hpp +++ b/addons/main/script_macros_common.hpp @@ -15,11 +15,11 @@ - Provide a solid structure that can be dynamic and easy editable (Which sometimes means we cannot adhere to Aim #1 ;-) An example is the path that is built from defines. Some available in this file, others in mods and addons. - Follows Standard: - Object variables: PREFIX_COMPONENT + Follows Standard: + Object variables: PREFIX_COMPONENT (or PREFIX_COMPONENT_SUBCOMPONENT) Main-object variables: PREFIX_main - Paths: MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\SCRIPTNAME.sqf - e.g: x\six\addons\sys_menu\fDate.sqf + Paths: MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\SCRIPTNAME.sqf (or MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\SUBCOMPONENT\SCRIPTNAME.sqf) + e.g: x\six\addons\sys_menu\fDate.sqf (or x\six\addons\sys_menu\compat\fDate.sqf) Usage: define PREFIX and COMPONENT, then include this file @@ -29,6 +29,9 @@ and include your mod's script_macros.hpp In your scripts you can then include the addon's component.hpp with relative path) + use in subcomponents (subconfigs) + define SUBCOMPONENT and include parent component's script_component.hpp + TODO: - Try only to use 1 string type " vs ' - Evaluate double functions, and simplification @@ -51,9 +54,14 @@ #define MAINLOGIC main #endif -#define ADDON DOUBLES(PREFIX,COMPONENT) #define MAIN_ADDON DOUBLES(PREFIX,main) +#ifdef SUBCOMPONENT + #define ADDON TRIPLES(PREFIX,COMPONENT,SUBCOMPONENT) +#else + #define ADDON DOUBLES(PREFIX,COMPONENT) +#endif + /* ------------------------------------------- Macro: VERSION_CONFIG Define CBA Versioning System config entries. diff --git a/addons/xeh/compat_contact/config.cpp b/addons/xeh/xeh_contact/CfgVehicles.hpp similarity index 63% rename from addons/xeh/compat_contact/config.cpp rename to addons/xeh/xeh_contact/CfgVehicles.hpp index 38efa29a90..485f050429 100644 --- a/addons/xeh/compat_contact/config.cpp +++ b/addons/xeh/xeh_contact/CfgVehicles.hpp @@ -1,22 +1,3 @@ -#include "\x\cba\addons\xeh\script_component.hpp" -#undef COMPONENT -#define COMPONENT xeh_compat_contact - -class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { "cba_xeh", "A3_Data_F_Contact" }; - skipWhenMissingDependencies = 1; - author = "$STR_CBA_Author"; - VERSION_CONFIG; - // this prevents any patched class from requiring XEH - addonRootClass = "A3_Characters_F"; - }; -}; -class XEH_CLASS_BASE; - class CfgVehicles { class B_W_Soldier_F; class B_W_Story_Protagonist_01_F: B_W_Soldier_F { diff --git a/addons/xeh/xeh_contact/config.cpp b/addons/xeh/xeh_contact/config.cpp new file mode 100644 index 0000000000..ec90f8b212 --- /dev/null +++ b/addons/xeh/xeh_contact/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = ECSTRING(xeh,component); + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"cba_xeh", "A3_Data_F_Contact"}; + skipWhenMissingDependencies = 1; + author = "$STR_CBA_Author"; + authors[] = {"PabstMirror"}; + url = "$STR_CBA_URL"; + VERSION_CONFIG; + + // this prevents any patched class from requiring XEH + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/xeh/xeh_contact/script_component.hpp b/addons/xeh/xeh_contact/script_component.hpp new file mode 100644 index 0000000000..6c66d46022 --- /dev/null +++ b/addons/xeh/xeh_contact/script_component.hpp @@ -0,0 +1,2 @@ +#define SUBCOMPONENT contact +#include "\x\cba\addons\xeh\script_component.hpp" diff --git a/addons/xeh/compat_csla/config.cpp b/addons/xeh/xeh_csla/CfgVehicles.hpp similarity index 59% rename from addons/xeh/compat_csla/config.cpp rename to addons/xeh/xeh_csla/CfgVehicles.hpp index 360ee3ef62..47c2fd1cbf 100644 --- a/addons/xeh/compat_csla/config.cpp +++ b/addons/xeh/xeh_csla/CfgVehicles.hpp @@ -1,22 +1,3 @@ -#include "\x\cba\addons\xeh\script_component.hpp" -#undef COMPONENT -#define COMPONENT xeh_compat_csla - -class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { "cba_xeh", "CSLA", "US85" }; - skipWhenMissingDependencies = 1; - author = "$STR_CBA_Author"; - VERSION_CONFIG; - // this prevents any patched class from requiring XEH - addonRootClass = "A3_Characters_F"; - }; -}; -class XEH_CLASS_BASE; - class CfgVehicles { class StaticATWeapon; class CSLA_9K113_Stat: StaticATWeapon { diff --git a/addons/xeh/xeh_csla/config.cpp b/addons/xeh/xeh_csla/config.cpp new file mode 100644 index 0000000000..27d3698262 --- /dev/null +++ b/addons/xeh/xeh_csla/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = ECSTRING(xeh,component); + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"cba_xeh", "CSLA", "US85"}; + skipWhenMissingDependencies = 1; + author = "$STR_CBA_Author"; + authors[] = {"PabstMirror"}; + url = "$STR_CBA_URL"; + VERSION_CONFIG; + + // this prevents any patched class from requiring XEH + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/xeh/xeh_csla/script_component.hpp b/addons/xeh/xeh_csla/script_component.hpp new file mode 100644 index 0000000000..39a0fc67f8 --- /dev/null +++ b/addons/xeh/xeh_csla/script_component.hpp @@ -0,0 +1,2 @@ +#define SUBCOMPONENT csla +#include "\x\cba\addons\xeh\script_component.hpp" diff --git a/addons/xeh/compat_sog/config.cpp b/addons/xeh/xeh_sog/CfgVehicles.hpp similarity index 56% rename from addons/xeh/compat_sog/config.cpp rename to addons/xeh/xeh_sog/CfgVehicles.hpp index f866ef46ce..b2a1ef39a4 100644 --- a/addons/xeh/compat_sog/config.cpp +++ b/addons/xeh/xeh_sog/CfgVehicles.hpp @@ -1,22 +1,3 @@ -#include "\x\cba\addons\xeh\script_component.hpp" -#undef COMPONENT -#define COMPONENT xeh_compat_sog - -class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { "cba_xeh", "loadorder_f_vietnam" }; - skipWhenMissingDependencies = 1; - author = "$STR_CBA_Author"; - VERSION_CONFIG; - // this prevents any patched class from requiring XEH - addonRootClass = "A3_Characters_F"; - }; -}; -class XEH_CLASS_BASE; - class CfgVehicles { class vn_object_b_base_02; class Land_vn_candle_01: vn_object_b_base_02 { diff --git a/addons/xeh/xeh_sog/config.cpp b/addons/xeh/xeh_sog/config.cpp new file mode 100644 index 0000000000..689d2f67b7 --- /dev/null +++ b/addons/xeh/xeh_sog/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = ECSTRING(xeh,component); + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"cba_xeh", "loadorder_f_vietnam"}; + skipWhenMissingDependencies = 1; + author = "$STR_CBA_Author"; + authors[] = {"PabstMirror"}; + url = "$STR_CBA_URL"; + VERSION_CONFIG; + + // this prevents any patched class from requiring XEH + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/xeh/xeh_sog/script_component.hpp b/addons/xeh/xeh_sog/script_component.hpp new file mode 100644 index 0000000000..71f2315412 --- /dev/null +++ b/addons/xeh/xeh_sog/script_component.hpp @@ -0,0 +1,2 @@ +#define SUBCOMPONENT sog +#include "\x\cba\addons\xeh\script_component.hpp" diff --git a/addons/xeh/compat_ws/config.cpp b/addons/xeh/xeh_ws/CfgVehicles.hpp similarity index 72% rename from addons/xeh/compat_ws/config.cpp rename to addons/xeh/xeh_ws/CfgVehicles.hpp index 7ce5e24893..a39cf7f600 100644 --- a/addons/xeh/compat_ws/config.cpp +++ b/addons/xeh/xeh_ws/CfgVehicles.hpp @@ -1,22 +1,3 @@ -#include "\x\cba\addons\xeh\script_component.hpp" -#undef COMPONENT -#define COMPONENT xeh_compat_ws - -class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { "cba_xeh", "data_f_lxWS" }; - skipWhenMissingDependencies = 1; - author = "$STR_CBA_Author"; - VERSION_CONFIG; - // this prevents any patched class from requiring XEH - addonRootClass = "A3_Characters_F"; - }; -}; -class XEH_CLASS_BASE; - class CfgVehicles { class PowerLines_Small_base_F; class Land_PowerPoleWooden_lxWS: PowerLines_Small_base_F { @@ -38,12 +19,12 @@ class CfgVehicles { class C_Journalist_lxWS: C_journalist_F { XEH_ENABLED; }; - + class C_Man_casual_1_F_afro; class C_Tak_01_A_lxWS: C_Man_casual_1_F_afro { XEH_ENABLED; }; - + class B_Soldier_TL_F; class B_ION_Story_Givens_lxWS: B_Soldier_TL_F { XEH_ENABLED; diff --git a/addons/xeh/xeh_ws/config.cpp b/addons/xeh/xeh_ws/config.cpp new file mode 100644 index 0000000000..821bbbfaab --- /dev/null +++ b/addons/xeh/xeh_ws/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = ECSTRING(xeh,component); + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"cba_xeh", "data_f_lxWS"}; + skipWhenMissingDependencies = 1; + author = "$STR_CBA_Author"; + authors[] = {"PabstMirror"}; + url = "$STR_CBA_URL"; + VERSION_CONFIG; + + // this prevents any patched class from requiring XEH + addonRootClass = "A3_Characters_F"; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/xeh/xeh_ws/script_component.hpp b/addons/xeh/xeh_ws/script_component.hpp new file mode 100644 index 0000000000..0ecf22b739 --- /dev/null +++ b/addons/xeh/xeh_ws/script_component.hpp @@ -0,0 +1,2 @@ +#define SUBCOMPONENT ws +#include "\x\cba\addons\xeh\script_component.hpp" From d696c1d74e4fc3b7fef3f4294c29055df4de3e35 Mon Sep 17 00:00:00 2001 From: jonpas Date: Fri, 8 Sep 2023 17:43:17 +0200 Subject: [PATCH 2/8] Fix missing XEH_CLASS_BASE --- addons/xeh/xeh_contact/config.cpp | 2 ++ addons/xeh/xeh_csla/config.cpp | 2 ++ addons/xeh/xeh_sog/config.cpp | 2 ++ addons/xeh/xeh_ws/config.cpp | 2 ++ 4 files changed, 8 insertions(+) diff --git a/addons/xeh/xeh_contact/config.cpp b/addons/xeh/xeh_contact/config.cpp index ec90f8b212..6f6250799c 100644 --- a/addons/xeh/xeh_contact/config.cpp +++ b/addons/xeh/xeh_contact/config.cpp @@ -18,4 +18,6 @@ class CfgPatches { }; }; +class XEH_CLASS_BASE; + #include "CfgVehicles.hpp" diff --git a/addons/xeh/xeh_csla/config.cpp b/addons/xeh/xeh_csla/config.cpp index 27d3698262..a0395a404f 100644 --- a/addons/xeh/xeh_csla/config.cpp +++ b/addons/xeh/xeh_csla/config.cpp @@ -18,4 +18,6 @@ class CfgPatches { }; }; +class XEH_CLASS_BASE; + #include "CfgVehicles.hpp" diff --git a/addons/xeh/xeh_sog/config.cpp b/addons/xeh/xeh_sog/config.cpp index 689d2f67b7..5b4435b8f3 100644 --- a/addons/xeh/xeh_sog/config.cpp +++ b/addons/xeh/xeh_sog/config.cpp @@ -18,4 +18,6 @@ class CfgPatches { }; }; +class XEH_CLASS_BASE; + #include "CfgVehicles.hpp" diff --git a/addons/xeh/xeh_ws/config.cpp b/addons/xeh/xeh_ws/config.cpp index 821bbbfaab..e986b47a5a 100644 --- a/addons/xeh/xeh_ws/config.cpp +++ b/addons/xeh/xeh_ws/config.cpp @@ -18,4 +18,6 @@ class CfgPatches { }; }; +class XEH_CLASS_BASE; + #include "CfgVehicles.hpp" From 77db66a56119b2278d13571ac5dfb55eb7794418 Mon Sep 17 00:00:00 2001 From: jonpas Date: Fri, 8 Sep 2023 18:29:06 +0200 Subject: [PATCH 3/8] Apply suggestions from code review Co-authored-by: PabstMirror --- addons/xeh/xeh_csla/config.cpp | 2 +- addons/xeh/xeh_sog/config.cpp | 2 +- addons/xeh/xeh_ws/config.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/xeh/xeh_csla/config.cpp b/addons/xeh/xeh_csla/config.cpp index a0395a404f..0e5208f155 100644 --- a/addons/xeh/xeh_csla/config.cpp +++ b/addons/xeh/xeh_csla/config.cpp @@ -9,7 +9,7 @@ class CfgPatches { requiredAddons[] = {"cba_xeh", "CSLA", "US85"}; skipWhenMissingDependencies = 1; author = "$STR_CBA_Author"; - authors[] = {"PabstMirror"}; + authors[] = {"Dahlgren"}; url = "$STR_CBA_URL"; VERSION_CONFIG; diff --git a/addons/xeh/xeh_sog/config.cpp b/addons/xeh/xeh_sog/config.cpp index 5b4435b8f3..474a142c23 100644 --- a/addons/xeh/xeh_sog/config.cpp +++ b/addons/xeh/xeh_sog/config.cpp @@ -9,7 +9,7 @@ class CfgPatches { requiredAddons[] = {"cba_xeh", "loadorder_f_vietnam"}; skipWhenMissingDependencies = 1; author = "$STR_CBA_Author"; - authors[] = {"PabstMirror"}; + authors[] = {"Dahlgren"}; url = "$STR_CBA_URL"; VERSION_CONFIG; diff --git a/addons/xeh/xeh_ws/config.cpp b/addons/xeh/xeh_ws/config.cpp index e986b47a5a..bacce56af6 100644 --- a/addons/xeh/xeh_ws/config.cpp +++ b/addons/xeh/xeh_ws/config.cpp @@ -9,7 +9,7 @@ class CfgPatches { requiredAddons[] = {"cba_xeh", "data_f_lxWS"}; skipWhenMissingDependencies = 1; author = "$STR_CBA_Author"; - authors[] = {"PabstMirror"}; + authors[] = {"Dahlgren"}; url = "$STR_CBA_URL"; VERSION_CONFIG; From 80e5cf54355dce67490eccc631881263ceec379a Mon Sep 17 00:00:00 2001 From: jonpas Date: Fri, 8 Sep 2023 19:17:07 +0200 Subject: [PATCH 4/8] Define SUBADDON instead --- addons/jam/jam_finish/config.cpp | 4 ++-- addons/jr/jr_prep/config.cpp | 4 ++-- addons/jr/jr_prep/script_component.hpp | 5 ++--- addons/main/script_macros_common.hpp | 12 ++++++------ addons/ui/ui_helper/config.cpp | 2 +- addons/ui/ui_helper/script_component.hpp | 2 ++ addons/xeh/xeh_a3/config.cpp | 2 +- addons/xeh/xeh_a3/script_component.hpp | 2 ++ addons/xeh/xeh_contact/config.cpp | 4 ++-- addons/xeh/xeh_csla/config.cpp | 4 ++-- addons/xeh/xeh_sog/config.cpp | 4 ++-- addons/xeh/xeh_ws/config.cpp | 4 ++-- 12 files changed, 26 insertions(+), 23 deletions(-) create mode 100644 addons/ui/ui_helper/script_component.hpp create mode 100644 addons/xeh/xeh_a3/script_component.hpp diff --git a/addons/jam/jam_finish/config.cpp b/addons/jam/jam_finish/config.cpp index 336641721f..0faa68f27a 100644 --- a/addons/jam/jam_finish/config.cpp +++ b/addons/jam/jam_finish/config.cpp @@ -1,8 +1,8 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - name = ECSTRING(jam,component); + class SUBADDON { + name = CSTRING(component); units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; diff --git a/addons/jr/jr_prep/config.cpp b/addons/jr/jr_prep/config.cpp index 39bff803ba..709e21bd45 100644 --- a/addons/jr/jr_prep/config.cpp +++ b/addons/jr/jr_prep/config.cpp @@ -1,8 +1,8 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - name = ECSTRING(jr,component); + class SUBADDON { + name = CSTRING(component); units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; diff --git a/addons/jr/jr_prep/script_component.hpp b/addons/jr/jr_prep/script_component.hpp index 3620398d6a..c3b425a3d9 100644 --- a/addons/jr/jr_prep/script_component.hpp +++ b/addons/jr/jr_prep/script_component.hpp @@ -1,3 +1,2 @@ -#define COMPONENT jr_prep -#include "\x\cba\addons\main\script_mod.hpp" -#include "\x\cba\addons\main\script_macros.hpp" +#define SUBCOMPONENT prep +#include "\x\cba\addons\jr\script_component.hpp" diff --git a/addons/main/script_macros_common.hpp b/addons/main/script_macros_common.hpp index 7aa5b7de2e..2f3980a250 100644 --- a/addons/main/script_macros_common.hpp +++ b/addons/main/script_macros_common.hpp @@ -16,10 +16,10 @@ An example is the path that is built from defines. Some available in this file, others in mods and addons. Follows Standard: - Object variables: PREFIX_COMPONENT (or PREFIX_COMPONENT_SUBCOMPONENT) + Object variables: PREFIX_COMPONENT Main-object variables: PREFIX_main - Paths: MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\SCRIPTNAME.sqf (or MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\SUBCOMPONENT\SCRIPTNAME.sqf) - e.g: x\six\addons\sys_menu\fDate.sqf (or x\six\addons\sys_menu\compat\fDate.sqf) + Paths: MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\SCRIPTNAME.sqf + e.g: x\six\addons\sys_menu\fDate.sqf Usage: define PREFIX and COMPONENT, then include this file @@ -31,6 +31,7 @@ use in subcomponents (subconfigs) define SUBCOMPONENT and include parent component's script_component.hpp + currently only supported by SUBADDON, additional macros may be added in the future TODO: - Try only to use 1 string type " vs ' @@ -54,12 +55,11 @@ #define MAINLOGIC main #endif +#define ADDON DOUBLES(PREFIX,COMPONENT) #define MAIN_ADDON DOUBLES(PREFIX,main) #ifdef SUBCOMPONENT - #define ADDON TRIPLES(PREFIX,COMPONENT,SUBCOMPONENT) -#else - #define ADDON DOUBLES(PREFIX,COMPONENT) + #define SUBADDON DOUBLES(ADDON,SUBCOMPONENT) #endif /* ------------------------------------------- diff --git a/addons/ui/ui_helper/config.cpp b/addons/ui/ui_helper/config.cpp index b3c0fa8452..027825b04b 100644 --- a/addons/ui/ui_helper/config.cpp +++ b/addons/ui/ui_helper/config.cpp @@ -1,5 +1,5 @@ class CfgPatches { - class cba_ui_helper { + class SUBADDON { requiredAddons[] = {"cba_ui"}; units[] = {}; }; diff --git a/addons/ui/ui_helper/script_component.hpp b/addons/ui/ui_helper/script_component.hpp new file mode 100644 index 0000000000..c7da2fea53 --- /dev/null +++ b/addons/ui/ui_helper/script_component.hpp @@ -0,0 +1,2 @@ +#define SUBCOMPONENT helper +#include "\x\cba\addons\ui\script_component.hpp" diff --git a/addons/xeh/xeh_a3/config.cpp b/addons/xeh/xeh_a3/config.cpp index 79cf14bd34..b4cfc22f94 100644 --- a/addons/xeh/xeh_a3/config.cpp +++ b/addons/xeh/xeh_a3/config.cpp @@ -1,5 +1,5 @@ class CfgPatches { - class cba_xeh_a3 { + class SUBADDON { requiredAddons[] = {"cba_xeh"}; units[] = {}; }; diff --git a/addons/xeh/xeh_a3/script_component.hpp b/addons/xeh/xeh_a3/script_component.hpp new file mode 100644 index 0000000000..b8ba86712d --- /dev/null +++ b/addons/xeh/xeh_a3/script_component.hpp @@ -0,0 +1,2 @@ +#define SUBCOMPONENT a3 +#include "\x\cba\addons\xeh\script_component.hpp" diff --git a/addons/xeh/xeh_contact/config.cpp b/addons/xeh/xeh_contact/config.cpp index 6f6250799c..e79bfd21b1 100644 --- a/addons/xeh/xeh_contact/config.cpp +++ b/addons/xeh/xeh_contact/config.cpp @@ -1,8 +1,8 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - name = ECSTRING(xeh,component); + class SUBADDON { + name = CSTRING(component); units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; diff --git a/addons/xeh/xeh_csla/config.cpp b/addons/xeh/xeh_csla/config.cpp index 0e5208f155..259ae255ef 100644 --- a/addons/xeh/xeh_csla/config.cpp +++ b/addons/xeh/xeh_csla/config.cpp @@ -1,8 +1,8 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - name = ECSTRING(xeh,component); + class SUBADDON { + name = CSTRING(component); units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; diff --git a/addons/xeh/xeh_sog/config.cpp b/addons/xeh/xeh_sog/config.cpp index 474a142c23..602a883e2b 100644 --- a/addons/xeh/xeh_sog/config.cpp +++ b/addons/xeh/xeh_sog/config.cpp @@ -1,8 +1,8 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - name = ECSTRING(xeh,component); + class SUBADDON { + name = CSTRING(component); units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; diff --git a/addons/xeh/xeh_ws/config.cpp b/addons/xeh/xeh_ws/config.cpp index bacce56af6..e19cbbefe5 100644 --- a/addons/xeh/xeh_ws/config.cpp +++ b/addons/xeh/xeh_ws/config.cpp @@ -1,8 +1,8 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - name = ECSTRING(xeh,component); + class SUBADDON { + name = CSTRING(component); units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; From 2aa8105df756b87bdfab3b1619398a7748167913 Mon Sep 17 00:00:00 2001 From: jonpas Date: Fri, 8 Sep 2023 19:20:11 +0200 Subject: [PATCH 5/8] Add SUBGVAR family --- addons/main/script_macros_common.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/main/script_macros_common.hpp b/addons/main/script_macros_common.hpp index 2f3980a250..e3d89293a8 100644 --- a/addons/main/script_macros_common.hpp +++ b/addons/main/script_macros_common.hpp @@ -897,10 +897,13 @@ Macro: GVAR() Sickboy ------------------------------------------- */ #define GVAR(var1) DOUBLES(ADDON,var1) +#define SUBGVAR(var1) TRIPLES(ADDON,SUBCOMPONENT,var1) #define EGVAR(var1,var2) TRIPLES(PREFIX,var1,var2) #define QGVAR(var1) QUOTE(GVAR(var1)) +#define QSUBGVAR(var1) QUOTE(SUBGVAR(var1)) #define QEGVAR(var1,var2) QUOTE(EGVAR(var1,var2)) #define QQGVAR(var1) QUOTE(QGVAR(var1)) +#define QQSUBGVAR(var1) QUOTE(QSUBGVAR(var1)) #define QQEGVAR(var1,var2) QUOTE(QEGVAR(var1,var2)) /* ------------------------------------------- From f1081d439a7610e8a6610bf3867315210bf483ce Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 Sep 2023 00:24:35 +0200 Subject: [PATCH 6/8] Apply suggestions from code review Co-authored-by: PabstMirror --- addons/ui/ui_helper/config.cpp | 2 ++ addons/xeh/xeh_a3/config.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/addons/ui/ui_helper/config.cpp b/addons/ui/ui_helper/config.cpp index 027825b04b..e0078fd8da 100644 --- a/addons/ui/ui_helper/config.cpp +++ b/addons/ui/ui_helper/config.cpp @@ -1,3 +1,5 @@ +#include "script_component.hpp" + class CfgPatches { class SUBADDON { requiredAddons[] = {"cba_ui"}; diff --git a/addons/xeh/xeh_a3/config.cpp b/addons/xeh/xeh_a3/config.cpp index b4cfc22f94..e423807eb2 100644 --- a/addons/xeh/xeh_a3/config.cpp +++ b/addons/xeh/xeh_a3/config.cpp @@ -1,3 +1,5 @@ +#include "script_component.hpp" + class CfgPatches { class SUBADDON { requiredAddons[] = {"cba_xeh"}; From 9a9778964fb66619c4ce7c687d573e357686f33f Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 Sep 2023 00:44:31 +0200 Subject: [PATCH 7/8] Remove SUGVAR family --- addons/main/script_macros_common.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/addons/main/script_macros_common.hpp b/addons/main/script_macros_common.hpp index e3d89293a8..2f3980a250 100644 --- a/addons/main/script_macros_common.hpp +++ b/addons/main/script_macros_common.hpp @@ -897,13 +897,10 @@ Macro: GVAR() Sickboy ------------------------------------------- */ #define GVAR(var1) DOUBLES(ADDON,var1) -#define SUBGVAR(var1) TRIPLES(ADDON,SUBCOMPONENT,var1) #define EGVAR(var1,var2) TRIPLES(PREFIX,var1,var2) #define QGVAR(var1) QUOTE(GVAR(var1)) -#define QSUBGVAR(var1) QUOTE(SUBGVAR(var1)) #define QEGVAR(var1,var2) QUOTE(EGVAR(var1,var2)) #define QQGVAR(var1) QUOTE(QGVAR(var1)) -#define QQSUBGVAR(var1) QUOTE(QSUBGVAR(var1)) #define QQEGVAR(var1,var2) QUOTE(QEGVAR(var1,var2)) /* ------------------------------------------- From 8d326dd10b66db57039b954f2bcbd68691415f70 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 Sep 2023 13:44:03 +0200 Subject: [PATCH 8/8] Subcomponent optionals --- optionals/legacy_jr/legacy_jr_prep/config.cpp | 4 ++-- optionals/legacy_jr/legacy_jr_prep/script_component.hpp | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/optionals/legacy_jr/legacy_jr_prep/config.cpp b/optionals/legacy_jr/legacy_jr_prep/config.cpp index 1f453453ea..183e141f4b 100644 --- a/optionals/legacy_jr/legacy_jr_prep/config.cpp +++ b/optionals/legacy_jr/legacy_jr_prep/config.cpp @@ -1,9 +1,9 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { + class SUBADDON { author = "$STR_CBA_Author"; - name = ECSTRING(legacy_jr,component); + name = CSTRING(component); url = "$STR_CBA_URL"; units[] = {}; weapons[] = {}; diff --git a/optionals/legacy_jr/legacy_jr_prep/script_component.hpp b/optionals/legacy_jr/legacy_jr_prep/script_component.hpp index 01632962ff..8ca9ff62fc 100644 --- a/optionals/legacy_jr/legacy_jr_prep/script_component.hpp +++ b/optionals/legacy_jr/legacy_jr_prep/script_component.hpp @@ -1,3 +1,2 @@ -#define COMPONENT legacy_jr_prep -#include "\x\cba\addons\main\script_mod.hpp" -#include "\x\cba\addons\main\script_macros.hpp" +#define SUBCOMPONENT prep +#include "\x\cba\addons\legacy_jr\script_component.hpp"