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/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/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 be13021c04..2f3980a250 100644 --- a/addons/main/script_macros_common.hpp +++ b/addons/main/script_macros_common.hpp @@ -15,7 +15,7 @@ - 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: + Follows Standard: Object variables: PREFIX_COMPONENT Main-object variables: PREFIX_main Paths: MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\SCRIPTNAME.sqf @@ -29,6 +29,10 @@ 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 + currently only supported by SUBADDON, additional macros may be added in the future + TODO: - Try only to use 1 string type " vs ' - Evaluate double functions, and simplification @@ -54,6 +58,10 @@ #define ADDON DOUBLES(PREFIX,COMPONENT) #define MAIN_ADDON DOUBLES(PREFIX,main) +#ifdef SUBCOMPONENT + #define SUBADDON DOUBLES(ADDON,SUBCOMPONENT) +#endif + /* ------------------------------------------- Macro: VERSION_CONFIG Define CBA Versioning System config entries. diff --git a/addons/ui/ui_helper/config.cpp b/addons/ui/ui_helper/config.cpp index b3c0fa8452..e0078fd8da 100644 --- a/addons/ui/ui_helper/config.cpp +++ b/addons/ui/ui_helper/config.cpp @@ -1,5 +1,7 @@ +#include "script_component.hpp" + 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..e423807eb2 100644 --- a/addons/xeh/xeh_a3/config.cpp +++ b/addons/xeh/xeh_a3/config.cpp @@ -1,5 +1,7 @@ +#include "script_component.hpp" + 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/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..e79bfd21b1 --- /dev/null +++ b/addons/xeh/xeh_contact/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = CSTRING(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"; + }; +}; + +class XEH_CLASS_BASE; + +#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..259ae255ef --- /dev/null +++ b/addons/xeh/xeh_csla/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = CSTRING(component); + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"cba_xeh", "CSLA", "US85"}; + skipWhenMissingDependencies = 1; + author = "$STR_CBA_Author"; + authors[] = {"Dahlgren"}; + url = "$STR_CBA_URL"; + VERSION_CONFIG; + + // this prevents any patched class from requiring XEH + addonRootClass = "A3_Characters_F"; + }; +}; + +class XEH_CLASS_BASE; + +#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..602a883e2b --- /dev/null +++ b/addons/xeh/xeh_sog/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = CSTRING(component); + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"cba_xeh", "loadorder_f_vietnam"}; + skipWhenMissingDependencies = 1; + author = "$STR_CBA_Author"; + authors[] = {"Dahlgren"}; + url = "$STR_CBA_URL"; + VERSION_CONFIG; + + // this prevents any patched class from requiring XEH + addonRootClass = "A3_Characters_F"; + }; +}; + +class XEH_CLASS_BASE; + +#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..e19cbbefe5 --- /dev/null +++ b/addons/xeh/xeh_ws/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = CSTRING(component); + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"cba_xeh", "data_f_lxWS"}; + skipWhenMissingDependencies = 1; + author = "$STR_CBA_Author"; + authors[] = {"Dahlgren"}; + url = "$STR_CBA_URL"; + VERSION_CONFIG; + + // this prevents any patched class from requiring XEH + addonRootClass = "A3_Characters_F"; + }; +}; + +class XEH_CLASS_BASE; + +#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" 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"