diff --git a/tools/cba/addons/main/script_macros_common.hpp b/tools/cba/addons/main/script_macros_common.hpp index fa24f29432..461e407256 100644 --- a/tools/cba/addons/main/script_macros_common.hpp +++ b/tools/cba/addons/main/script_macros_common.hpp @@ -632,6 +632,9 @@ Author: #define CFGSETTINGS CFGSETTINGSS(PREFIX,COMPONENT) #define PATHTO(var1) PATHTO_SYS(PREFIX,COMPONENT_F,var1) #define PATHTOF(var1) PATHTOF_SYS(PREFIX,COMPONENT,var1) +#define PATHTOEF(var1,var2) PATHTOF_SYS(PREFIX,var1,var2) +#define QPATHTOF(var1) QUOTE(PATHTOF(var1)) +#define QPATHTOEF(var1,var2) QUOTE(PATHTOEF(var1,var2)) #define COMPILE_FILE(var1) COMPILE_FILE_SYS(PREFIX,COMPONENT_F,var1) #define COMPILE_FILE_CFG(var1) COMPILE_FILE_CFG_SYS(PREFIX,COMPONENT_F,var1) @@ -674,6 +677,8 @@ Author: #define EGVAR(var1,var2) TRIPLES(PREFIX,var1,var2) #define QGVAR(var1) QUOTE(GVAR(var1)) #define QEGVAR(var1,var2) QUOTE(EGVAR(var1,var2)) +#define QQGVAR(var1) QUOTE(QGVAR(var1)) +#define QQEGVAR(var1,var2) QUOTE(QEGVAR(var1,var2)) /* ------------------------------------------- Macro: GVARMAIN() @@ -693,6 +698,7 @@ Author: ------------------------------------------- */ #define GVARMAIN(var1) GVARMAINS(PREFIX,var1) #define QGVARMAIN(var1) QUOTE(GVARMAIN(var1)) +#define QQGVARMAIN(var1) QUOTE(QGVARMAIN(var1)) // TODO: What's this? #define SETTINGS DOUBLES(PREFIX,settings) #define CREATELOGIC CREATELOGICS(PREFIX,COMPONENT) @@ -719,6 +725,14 @@ Author: #define FUNCMAIN(var1) TRIPLES(PREFIX,fnc,var1) #define FUNC_INNER(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2) #define EFUNC(var1,var2) FUNC_INNER(var1,var2) +#define QFUNC(var1) QUOTE(FUNC(var1)) +#define QFUNCMAIN(var1) QUOTE(FUNCMAIN(var1)) +#define QFUNC_INNER(var1,var2) QUOTE(FUNC_INNER(var1,var2)) +#define QEFUNC(var1,var2) QUOTE(EFUNC(var1,var2)) +#define QQFUNC(var1) QUOTE(QFUNC(var1)) +#define QQFUNCMAIN(var1) QUOTE(QFUNCMAIN(var1)) +#define QQFUNC_INNER(var1,var2) QUOTE(QFUNC_INNER(var1,var2)) +#define QQEFUNC(var1,var2) QUOTE(QEFUNC(var1,var2)) #ifndef PRELOAD_ADDONS #define PRELOAD_ADDONS class CfgAddons \ @@ -1258,6 +1272,39 @@ Author: TEST_FAIL('(A OPERATOR B)') \ }; +/* ------------------------------------------- +Macro: TEST_DEFINED_AND_OP() + Tests that A and B are defined and (A OPERATOR B) is true. + If the test fails, an error is raised with the given MESSAGE. + +Parameters: + A - First value [Any] + OPERATOR - Binary operator to use [Operator] + B - Second value [Any] + MESSSAGE - Message to display [String] + +Example: + (begin example) + TEST_OP(_fish,>,5,"Too few fish!"); + (end) + +Author: + Killswitch, PabstMirror +------------------------------------------- */ +#define TEST_DEFINED_AND_OP(A,OPERATOR,B,MESSAGE) \ + if (isNil #A) then { \ + TEST_FAIL('(A is not defined) ' + (MESSAGE)); \ + } else { \ + if (isNil #B) then { \ + TEST_FAIL('(B is not defined) ' + (MESSAGE)); \ + } else { \ + if ((A) OPERATOR (B)) then { \ + TEST_SUCCESS('(A OPERATOR B) ' + (MESSAGE)) \ + } else { \ + TEST_FAIL('(A OPERATOR B) ' + (MESSAGE)) \ + }; }; }; + + /* ------------------------------------------- Macro: TEST_DEFINED() Tests that a VARIABLE is defined. @@ -1417,3 +1464,5 @@ Author: #define XEH_POST_INIT QUOTE(call COMPILE_FILE(XEH_PostInit_Once)) #define XEH_POST_CINIT QUOTE(call COMPILE_FILE(XEH_PostClientInit_Once)) #define XEH_POST_SINIT QUOTE(call COMPILE_FILE(XEH_PostServerInit_Once)) + +#define IS_LINUX (productVersion select 2 <= 154) diff --git a/tools/cba/addons/xeh/script_xeh.hpp b/tools/cba/addons/xeh/script_xeh.hpp index 82fb724c03..ef62f1df53 100644 --- a/tools/cba/addons/xeh/script_xeh.hpp +++ b/tools/cba/addons/xeh/script_xeh.hpp @@ -27,7 +27,9 @@ firedNear = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_fir 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"")"; \ @@ -42,11 +44,13 @@ respawn = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_respa 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"")"; +weaponRested = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_weaponRested"")"; \ +reloaded = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_reloaded"")"; /* @@ -73,7 +77,9 @@ firedNear = ""; \ fuel = ""; \ gear = ""; \ getIn = ""; \ +getInMan = ""; \ getOut = ""; \ +getOutMan = ""; \ handleHeal = ""; \ hit = ""; \ hitPart = ""; \ @@ -92,4 +98,5 @@ soundPlayed = ""; \ weaponAssembled = ""; \ weaponDisassembled = ""; \ weaponDeployed = ""; \ -weaponRested = ""; +weaponRested = ""; \ +reloaded = "";