diff --git a/.hemtt/project.toml b/.hemtt/project.toml index 042bf73b..6675b6ca 100644 --- a/.hemtt/project.toml +++ b/.hemtt/project.toml @@ -16,3 +16,8 @@ author = "ArmaForces" [version] path = "addons/main/script_version.hpp" + +[asc] +exclude = [ + ".inc.sqf" +] diff --git a/addons/civilian/XEH_preInit.sqf b/addons/civilian/XEH_preInit.sqf index f2a8692a..54c961ff 100644 --- a/addons/civilian/XEH_preInit.sqf +++ b/addons/civilian/XEH_preInit.sqf @@ -2,7 +2,7 @@ ADDON = false; #include "XEH_PREP.hpp" -#include "initSettings.sqf" +#include "initSettings.inc.sqf" // Killswitch if (!EGVAR(common,enabled)) exitWith {}; diff --git a/addons/civilian/initSettings.sqf b/addons/civilian/initSettings.inc.sqf similarity index 94% rename from addons/civilian/initSettings.sqf rename to addons/civilian/initSettings.inc.sqf index 80c7733e..73eb5ee3 100644 --- a/addons/civilian/initSettings.sqf +++ b/addons/civilian/initSettings.inc.sqf @@ -1,5 +1,3 @@ -#include "script_component.hpp" - [ QGVAR(initialCiviliansCount), "SLIDER", diff --git a/addons/civilian_statemachine/functions/fnc_getGroupVehicles.sqf b/addons/civilian_statemachine/functions/fnc_getGroupVehicles.sqf index 04755a17..0824d798 100644 --- a/addons/civilian_statemachine/functions/fnc_getGroupVehicles.sqf +++ b/addons/civilian_statemachine/functions/fnc_getGroupVehicles.sqf @@ -20,5 +20,3 @@ params ["_group"]; // Get all group vehicles private _groupVehicles = units _group apply {_x getVariable [QGVAR(ownedVehicle), objNull]} select {!isNull _x}; _groupVehicles arrayIntersect _groupVehicles // return - -_groupVehicles diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 79426295..fc5e5bfa 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -6,8 +6,9 @@ GVAR(enabled) = ("SK" isEqualTo (getText (missionConfigFile >> "Header" >> "game GVAR(ACE_Loaded) = isClass (configFile >> "CfgPatches" >> "ace_common"); GVAR(ACRE_Loaded) = isClass (configFile >> "CfgPatches" >> "acre_main"); -GVAR(CUP_Loaded) = isClass (configFile >> "CfgPatches" >> "cup_common"); // Probably something else, not "cup_common" -GVAR(RHS_Loaded) = isClass (configFile >> "CfgPatches" >> "rhs_common"); // Same here +GVAR(AFFT_Loaded) = isClass (configFile >> "CfgPatches" >> "afft_main"); +GVAR(CUP_Loaded) = isClass (configFile >> "CfgPatches" >> "CUP_Vehicles_Core"); +GVAR(RHS_Loaded) = isClass (configFile >> "CfgPatches" >> "rhssaf_main_loadorder"); // Killswitch if (!GVAR(enabled)) exitWith {}; diff --git a/addons/equipment/XEH_preInit.sqf b/addons/equipment/XEH_preInit.sqf index 2538b674..2bf326ec 100644 --- a/addons/equipment/XEH_preInit.sqf +++ b/addons/equipment/XEH_preInit.sqf @@ -2,7 +2,7 @@ ADDON = false; #include "XEH_PREP.hpp" -#include "initSettings.sqf" +#include "initSettings.inc.sqf" // Killswitch if (!EGVAR(common,enabled)) exitWith {}; diff --git a/addons/equipment/initSettings.sqf b/addons/equipment/initSettings.inc.sqf similarity index 94% rename from addons/equipment/initSettings.sqf rename to addons/equipment/initSettings.inc.sqf index 71f8a1f4..df882afe 100644 --- a/addons/equipment/initSettings.sqf +++ b/addons/equipment/initSettings.inc.sqf @@ -1,5 +1,3 @@ -#include "script_component.hpp" - [ QGVAR(equipmentPresetCustom), "CHECKBOX", diff --git a/addons/killers/XEH_preInit.sqf b/addons/killers/XEH_preInit.sqf index a3606f78..6ea6e34c 100644 --- a/addons/killers/XEH_preInit.sqf +++ b/addons/killers/XEH_preInit.sqf @@ -2,7 +2,7 @@ ADDON = false; #include "XEH_PREP.hpp" -#include "initSettings.sqf" +#include "initSettings.inc.sqf" // Killswitch if (!EGVAR(common,enabled)) exitWith {}; diff --git a/addons/killers/initSettings.sqf b/addons/killers/initSettings.inc.sqf similarity index 86% rename from addons/killers/initSettings.sqf rename to addons/killers/initSettings.inc.sqf index e17bf092..bc949596 100644 --- a/addons/killers/initSettings.sqf +++ b/addons/killers/initSettings.inc.sqf @@ -1,5 +1,3 @@ -#include "script_component.hpp" - [ QGVAR(startPositionsCount), "SLIDER", diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index 3e6aaab9..8b7a91ef 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ -#define MAJOR 1 -#define MINOR 0 -#define PATCH 0 -#define BUILD 0 +#define MAJOR 0 +#define MINOR 95 +#define PATCH 6 +#define BUILD 20240201 diff --git a/addons/markers/XEH_preInit.sqf b/addons/markers/XEH_preInit.sqf index 97f1c278..8cf778f2 100644 --- a/addons/markers/XEH_preInit.sqf +++ b/addons/markers/XEH_preInit.sqf @@ -2,7 +2,7 @@ ADDON = false; #include "XEH_PREP.hpp" -#include "initSettings.sqf" +#include "initSettings.inc.sqf" // Killswitch if (!EGVAR(common,enabled)) exitWith {}; diff --git a/addons/markers/initSettings.sqf b/addons/markers/initSettings.inc.sqf similarity index 84% rename from addons/markers/initSettings.sqf rename to addons/markers/initSettings.inc.sqf index 32771847..826b4017 100644 --- a/addons/markers/initSettings.sqf +++ b/addons/markers/initSettings.inc.sqf @@ -1,5 +1,3 @@ -#include "script_component.hpp" - [ QGVAR(refreshRate), "SLIDER", diff --git a/addons/police/XEH_postInit.sqf b/addons/police/XEH_postInit.sqf index cb9faa84..bdc6bb86 100644 --- a/addons/police/XEH_postInit.sqf +++ b/addons/police/XEH_postInit.sqf @@ -37,7 +37,9 @@ if (isServer) then { }; // Fill arsenal with starting items -call FUNC(equipmentScoreCheck); +[{GVAR(arsenals) isNotEqualTo []}, { + call FUNC(equipmentScoreCheck); +}] call CBA_fnc_waitUntilAndExecute; // Event creating teleport actions to all police stations [QGVAR(createTeleport), { diff --git a/addons/score/XEH_preInit.sqf b/addons/score/XEH_preInit.sqf index fc41e32c..1cc34f41 100644 --- a/addons/score/XEH_preInit.sqf +++ b/addons/score/XEH_preInit.sqf @@ -2,7 +2,7 @@ ADDON = false; #include "XEH_PREP.hpp" -#include "initSettings.sqf" +#include "initSettings.inc.sqf" // Killswitch if (!EGVAR(common,enabled)) exitWith {}; diff --git a/addons/score/initSettings.sqf b/addons/score/initSettings.inc.sqf similarity index 99% rename from addons/score/initSettings.sqf rename to addons/score/initSettings.inc.sqf index 4a6073ae..63e5ade0 100644 --- a/addons/score/initSettings.sqf +++ b/addons/score/initSettings.inc.sqf @@ -1,5 +1,3 @@ -#include "script_component.hpp" - [ QGVAR(killersScoreMax), "SLIDER", diff --git a/include/x/cba/addons/main/script_macros_common.hpp b/include/x/cba/addons/main/script_macros_common.hpp index 41a4faea..2683f3b0 100644 --- a/include/x/cba/addons/main/script_macros_common.hpp +++ b/include/x/cba/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. @@ -197,7 +205,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 +273,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 +312,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,16 +862,13 @@ 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 \ -{ \ - class CBA \ - { \ - class Versioning \ - { \ - class var1 \ - { \ - }; \ + +#define VERSIONING_SYS(var1) class CfgSettings { \ + class CBA { \ + class Versioning { \ + class var1 {}; \ }; \ }; \ }; @@ -1030,12 +1035,9 @@ Macro: PATHTO_FNC() #define QQEFUNC(var1,var2) QUOTE(QEFUNC(var1,var2)) #ifndef PRELOAD_ADDONS - #define PRELOAD_ADDONS class CfgAddons \ -{ \ - class PreloadAddons \ - { \ - class ADDON \ - { \ + #define PRELOAD_ADDONS class CfgAddons { \ + class PreloadAddons { \ + class ADDON { \ list[]={ QUOTE(ADDON) }; \ }; \ }; \ @@ -1273,9 +1275,11 @@ Macro: xSTRING() #define ELSTRING(var1,var2) QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2)) #define CSTRING(var1) QUOTE(TRIPLES($STR,ADDON,var1)) #define ECSTRING(var1,var2) QUOTE(TRIPLES($STR,DOUBLES(PREFIX,var1),var2)) + #define SUBCSTRING(var1) QUOTE(TRIPLES($STR,SUBADDON,var1)) #define LLSTRING(var1) localize QUOTE(TRIPLES(STR,ADDON,var1)) #define LELSTRING(var1,var2) localize QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2)) + #define LSUBLSTRING(var1) localize QUOTE(TRIPLES(STR,SUBADDON,var1)) #endif @@ -1812,9 +1816,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 +1832,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))