diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp index bbd362f758..0a963df433 100644 --- a/addons/dragging/CfgVehicles.hpp +++ b/addons/dragging/CfgVehicles.hpp @@ -32,7 +32,6 @@ class CfgVehicles { // ammo boxes class ThingX; class ReammoBox_F: ThingX { - XEH_ENABLED; GVAR(canCarry) = 0; GVAR(carryPosition[]) = {0,1,1}; GVAR(carryDirection) = 0; diff --git a/tools/cba/addons/main/script_macros_common.hpp b/tools/cba/addons/main/script_macros_common.hpp index d205bfc975..fa24f29432 100644 --- a/tools/cba/addons/main/script_macros_common.hpp +++ b/tools/cba/addons/main/script_macros_common.hpp @@ -621,9 +621,6 @@ Author: #define LSTR(var1) TRIPLES(ADDON,STR,var1) -#define CACHE_DIS_SYS(var1,var2) (isNumber(var1 >> "CfgSettings" >> "CBA" >> "caching" >> QUOTE(var2)) && getNumber(var1 >> "CfgSettings" >> "CBA" >> "caching" >> QUOTE(var2)) != 1) -#define CACHE_DIS(var1) (!isNil "CBA_RECOMPILE" || CACHE_DIS_SYS(configFile,var1) || CACHE_DIS_SYS(missionConfigFile,var1)) - #ifndef DEBUG_SETTINGS #define DEBUG_SETTINGS [false, true, false] #endif @@ -829,21 +826,21 @@ Parameters: Author: Spooner ------------------------------------------- */ -#define IS_META_SYS(VAR,TYPE) (if (isNil {VAR}) then { false } else { (typeName (VAR)) == TYPE }) -#define IS_ARRAY(VAR) IS_META_SYS(VAR,"ARRAY") -#define IS_BOOL(VAR) IS_META_SYS(VAR,"BOOL") -#define IS_CODE(VAR) IS_META_SYS(VAR,"CODE") -#define IS_CONFIG(VAR) IS_META_SYS(VAR,"CONFIG") -#define IS_CONTROL(VAR) IS_META_SYS(VAR,"CONTROL") -#define IS_DISPLAY(VAR) IS_META_SYS(VAR,"DISPLAY") -#define IS_GROUP(VAR) IS_META_SYS(VAR,"GROUP") -#define IS_OBJECT(VAR) IS_META_SYS(VAR,"OBJECT") -#define IS_SCALAR(VAR) IS_META_SYS(VAR,"SCALAR") -#define IS_SCRIPT(VAR) IS_META_SYS(VAR,"SCRIPT") -#define IS_SIDE(VAR) IS_META_SYS(VAR,"SIDE") +#define IS_META_SYS(VAR,TYPE) (if (isNil {VAR}) then { false } else { (VAR) isEqualType TYPE }) +#define IS_ARRAY(VAR) IS_META_SYS(VAR,[]) +#define IS_BOOL(VAR) IS_META_SYS(VAR,false) +#define IS_CODE(VAR) IS_META_SYS(VAR,{}) +#define IS_CONFIG(VAR) IS_META_SYS(VAR,configNull) +#define IS_CONTROL(VAR) IS_META_SYS(VAR,controlNull) +#define IS_DISPLAY(VAR) IS_META_SYS(VAR,displayNull) +#define IS_GROUP(VAR) IS_META_SYS(VAR,grpNull) +#define IS_OBJECT(VAR) IS_META_SYS(VAR,objNull) +#define IS_SCALAR(VAR) IS_META_SYS(VAR,0) +#define IS_SCRIPT(VAR) IS_META_SYS(VAR,scriptNull) +#define IS_SIDE(VAR) IS_META_SYS(VAR,west) #define IS_STRING(VAR) IS_META_SYS(VAR,"STRING") -#define IS_TEXT(VAR) IS_META_SYS(VAR,"TEXT") -#define IS_LOCATION(VAR) IS_META_SYS(VAR,"LOCATION") +#define IS_TEXT(VAR) IS_META_SYS(VAR,text "") +#define IS_LOCATION(VAR) IS_META_SYS(VAR,locationNull) #define IS_BOOLEAN(VAR) IS_BOOL(VAR) #define IS_FUNCTION(VAR) IS_CODE(VAR) @@ -1408,8 +1405,9 @@ Author: } // XEH Specific -#define XEH_DISABLED class EventHandlers {}; SLX_XEH_DISABLED = 1 -#define XEH_ENABLED class EventHandlers { EXTENDED_EVENTHANDLERS }; delete SLX_XEH_DISABLED +#define XEH_CLASS CBA_Extended_EventHandlers +#define XEH_DISABLED class EventHandlers { class XEH_CLASS {}; }; SLX_XEH_DISABLED = 1 +#define XEH_ENABLED class EventHandlers { class XEH_CLASS { EXTENDED_EVENTHANDLERS }; }; SLX_XEH_DISABLED = 0 // TODO: These are actually outdated; _Once ? #define XEH_PRE_INIT QUOTE(call COMPILE_FILE(XEH_PreInit_Once)) diff --git a/tools/cba/addons/xeh/init_pre.sqf b/tools/cba/addons/xeh/init_pre.sqf deleted file mode 100644 index 1b6642c777..0000000000 --- a/tools/cba/addons/xeh/init_pre.sqf +++ /dev/null @@ -1,366 +0,0 @@ -// #define DEBUG_MODE_FULL -#include "script_component.hpp" -SCRIPT(init_pre); - -if !(isNil'SLX_XEH_MACHINE') exitWith {}; // Doublecheck.. - -LOG(MSG_INIT); -// No _this in pre/PostInit, also fixes call to init_compile -private "_this"; -_this = nil; - -private ["_id", "_cfgRespawn", "_respawn", "_level"]; - -// UNIQUE Session ID since start of game -_id = uiNamespace getVariable "SLX_XEH_ID"; -if (isNil "_id") then { _id = 1 } else { if (typeName _id != "SCALAR") then { _id = 0 }; if (_id < 0) then { _id = 0 }; INC(_id) }; -uiNamespace setVariable ["SLX_XEH_ID", _id]; - -CBA_isCached = uiNamespace getVariable "CBA_isCached"; -CBA_isCached = if (isNil "CBA_isCached" && {isMultiplayer} && {!isDedicated}) then { -1 } else { _id }; -uiNamespace setVariable ["CBA_isCached", CBA_isCached]; - -if (isNil "SLX_XEH_RECOMPILE") then { SLX_XEH_RECOMPILE = CACHE_DIS(xeh) }; - -if (!isMultiplayer || {isDedicated} || {CBA_isCached == -1}) then { - uiNamespace setVariable ["SLX_XEH_CACHE_KEYS", []]; - uiNamespace setVariable ["SLX_XEH_CACHE_KEYS2", []]; - uiNamespace setVariable ["SLX_XEH_CACHE_KEYS3", []]; - uiNamespace setVariable ["CBA_CACHE_KEYS", []]; -}; - -SLX_XEH_CACHE_KEYS = uiNamespace getVariable "SLX_XEH_CACHE_KEYS"; -SLX_XEH_CACHE_KEYS2 = uiNamespace getVariable "SLX_XEH_CACHE_KEYS2"; -SLX_XEH_CACHE_KEYS3 = uiNamespace getVariable "SLX_XEH_CACHE_KEYS3"; -CBA_CACHE_KEYS = uiNamespace getVariable "CBA_CACHE_KEYS"; - -// Always compile cache function once -call compile preProcessFileLineNumbers 'x\cba\addons\xeh\init_compile.sqf'; - -// Log -SLX_XEH_DisableLogging = isClass(configFile/"CfgPatches"/"Disable_XEH_Logging"); - -// Backup functions for macros -// TODO: Cleanup... -// CBA_fnc_log = { diag_log [diag_frameNo, diag_tickTime, time, _this] }; - - -/* CBA_fnc_defaultParam = { - params ["_params","_index","_defaultValue"]; - - private "_value"; - - if (!isNil "_defaultValue") then { - _value = _defaultValue; - }; - - if (!isNil "_params" && {(typeName _params) == "ARRAY"} && {count _params > _index} && {!isNil { _params select _index }}) then { - _value = _params select _index; - }; - - // Return. - if (isNil "_value") then { - nil; - } else { - _value; - }; -}; -*/ - -XEH_LOG("XEH: PreInit Started. v"+getText(configFile >> "CfgPatches" >> "CBA_XEH" >> "version")+". "+PFORMAT_5("MISSINIT",missionName,worldName,isMultiplayer,isServer,isDedicated)); -if (time > 0) then { XEH_LOG("XEH WARNING: Time > 0; This probably means there are no XEH compatible units by default on the map, perhaps add the SLX_XEH_Logic module.") }; - -// Compile all necessary scripts and start one vehicle crew initialisation thread -_cfgRespawn = (missionConfigFile/"respawn"); -_respawn = false; -if ( isNumber(_cfgRespawn) ) then { - _respawn = !(getNumber(_cfgRespawn) in [0, 1, 4, 5]); -}; -if ( isText(_cfgRespawn) ) then { - _respawn = !(getText(_cfgRespawn) in ["none", "bird", "group", "side"]); -}; - -SLX_XEH_objects = []; // Temporary array, to track InitPosts at mission initialization -SLX_XEH_INIT_MEN = []; // Temporary array, to track ManBased inits - to workaround JIP issue "Double init eh ran for crew units" -SLX_XEH_DELAYED = []; // Temporary array, to track Delayed Inits at mission initialization - - -// Game version detection -_level = 0; // pre v1.60 -// TODO: Improve v1.60 detection -// TODO: Temporary disabled due to #28652 -//if ((isNumber (configFile >> "CfgDifficulties" >> "recruit" >> "recoilCoef")) && (isNumber (configFile >> "CfgVehicles" >> "Car" >> "turnCoef"))) then { - //_level = 1; // v1.60 -//}; - -FUNC(determineProductVersion) = { - private "_pv"; - _pv = call {productVersion}; - - // A2 (and OA pre 1.61beta, and TOH pre 1.05?) does not support productVersion so we deal with it manually - if (isNil "_pv") then { - _pv = if (isClass(configFile >> "CfgPatches" >> "A3_Map_Stratis")) then { - // A3 Backup - ["Arma 3 Alpha","Arma3Alpha", -1, -1]; //,5,102571] - - } else { - if (isClass(configFile >> "CfgPatches" >> "United_States_H")) then { - // TOH Backup - ["TakeOn H", "TakeOnH", -1, -1]; - } else { - if (isClass(configFile >> "CfgPatches" >> "Takistan")) then { - // OA Backup - ["ArmA 2OA", "ArmA2OA", -1, -1]; - } else { - // A2 Backup - ["ArmA 2", "ArmA2", -1, -1]; - }; - }; - }; - }; - - _pv; -}; - -FUNC(determineGame) = { - // 0 = A2 - // 1 = OA - // 2 = TOH - // 3 = A3 :P - private "_pv"; - _pv = call FUNC(determineProductVersion); - - switch (_pv select 1) do { - case "ArmA2": {0}; - case "ArmA2OA": {1}; - case "TakeOnH": {2}; - case "Arma3Alpha": {3}; - case "Arma3": {3}; - default {0}; - }; -}; - -// System array with machine / mission / session information -SLX_XEH_MACHINE = -[ - !isDedicated, // 0 - isClient (and thus has player) - false, // 1 - isJip - !isServer, // 2 - isDedicatedClient (and thus not a Client-Server) - isServer, // 3 - isServer - isDedicated, // 4 - isDedicatedServer (and thus not a Client-Server) - false, // 5 - Player Check Finished - !isMultiplayer, // 6 - SP? - false, // 7 - StartInit Passed - false, // 8 - Postinit Passed - isMultiplayer && {_respawn}, // 9 - Multiplayer && respawn? - if (isDedicated) then { 0 } else { if (isServer) then { 1 } else { 2 } }, // 10 - Machine type (only 3 possible configurations) - _id, // 11 - SESSION_ID - _level, // 12 - LEVEL - Used for version determination - false, // 13 - TIMEOUT - PostInit timedOut - call FUNC(determineGame), // 14 - Game - call FUNC(determineProductVersion) // 15 - Product+Version -]; - -SLX_XEH_DUMMY = switch (SLX_XEH_MACHINE select 14) do { - case 2: {"Helipad_Invisible_H" }; - case 3: {"Land_HelipadEmpty_F" }; - default { "HeliHEmpty" }; -}; - -SLX_XEH_STR = ""; // Empty string -SLX_XEH_STR_INIT_EH = "Extended_Init_EventHandlers"; -SLX_XEH_STR_INIT_POST_EH = "Extended_InitPost_EventHandlers"; -SLX_XEH_STR_PreInit = "Extended_PreInit_EventHandlers"; -SLX_XEH_STR_PostInit = "Extended_PostInit_EventHandlers"; -SLX_XEH_STR_DEH = "DefaultEventhandlers"; -SLX_XEH_STR_TAG = "SLX_XEH_"; -SLX_XEH_STR_PLAYABLE = "SLX_XEH_PLAYABLE"; - -SLX_XEH_STR_PROCESSED = "SLX_XEH_PROCESSED"; -SLX_XEH_AR_FALSE = [SLX_XEH_STR_PROCESSED, false]; -SLX_XEH_AR_TRUE = [SLX_XEH_STR_PROCESSED, true]; - -SLX_XEH_OTHER_EVENTS = [XEH_EVENTS,XEH_CUSTOM_EVENTS]; // All events except the init event -SLX_XEH_OTHER_EVENTS_FULL = []; -{ SLX_XEH_OTHER_EVENTS_FULL pushBack format["Extended_%1_EventHandlers", _x] } forEach SLX_XEH_OTHER_EVENTS; -SLX_XEH_OTHER_EVENTS_XEH = []; -{ SLX_XEH_OTHER_EVENTS_XEH pushBack format["Extended_%1EH", _x] } forEach SLX_XEH_OTHER_EVENTS; -SLX_XEH_OTHER_EVENTS_XEH_PLAYERS = []; -{ SLX_XEH_OTHER_EVENTS_XEH_PLAYERS pushBack format["Extended_%1EH_Player", _x] } forEach SLX_XEH_OTHER_EVENTS; -SLX_XEH_OTHER_EVENTS_PLAYERS = []; - -// HitPart is special in that the passed parameter to the event handler is an array of arrays -{ - if (_x == "HitPart") then - { - SLX_XEH_OTHER_EVENTS_PLAYERS pushBack (compile format["{ { _this call _x } forEach (((_this select 0) select 0) getVariable [SLX_XEH_STR_%1_Player,[]]) }",_x]) - } - else - { - SLX_XEH_OTHER_EVENTS_PLAYERS pushBack (compile format["{ { _this call _x } forEach ((_this select 0) getVariable [SLX_XEH_STR_%1_Player,[]]) }",_x]) - } -} forEach SLX_XEH_OTHER_EVENTS; - -SLX_XEH_CONFIG_FILES = [configFile, campaignConfigFile, missionConfigFile]; -SLX_XEH_CONFIG_FILES_VARIABLE = [campaignConfigFile, missionConfigFile]; - -SLX_XEH_DEF_CLASSES = [SLX_XEH_STR, "All"]; - -// XEH for non XEH supported addons -// Only works until someone uses removeAllEventhandlers on the object -// Only works if there is at least 1 XEH-enabled object on the Map - Place SLX_XEH_Logic to make sure XEH initializes. -// TODO: Perhaps do a config verification - if no custom eventhandlers detected in _all_ CfgVehicles classes, don't run this XEH handler - might be too much processing. -SLX_XEH_EVENTS_NAT = [XEH_EVENTS]; -SLX_XEH_EVENTS_FULL_NAT = []; -{ SLX_XEH_EVENTS_FULL_NAT pushBack format["Extended_%1_EventHandlers", _x] } forEach SLX_XEH_EVENTS_NAT; - -SLX_XEH_EXCLUDES = []; // TODO: Anything else?? - Ammo crates for instance have no XEH by default due to crashes) - however, they don't appear in 'vehicles' list anyway. -SLX_XEH_CLASSES = []; // Used to cache classes that have full XEH setup - TODO: Performance test.. Could use object with a variable space, classname as key -SLX_XEH_FULL_CLASSES = []; // Used to cache classes that NEED full XEH setup -SLX_XEH_EXCL_CLASSES = []; // Used for exclusion classes - - -// Function Compilation -SLX_XEH_LOG = { XEH_LOG(_this); }; - -PREP(init_once); // Pre and PostInits - -PREP(init_delayed); -PREP(init_playable); - -// Inits and InitPosts -PREP(init); -PREP(init_enum); -PREP(init_enum_cache); -PREP(init_post); - -// Init Others -PREP(init_others); -PREP(init_others_enum); -PREP(init_others_enum_cache); - -PREP(addPlayerEvents); // Add / Remove the playerEvents -PREP(removePlayerEvents); -PREP(support_monitor); -PREP(support_monitor2); - -call COMPILE_FILE(init_eh); // All XEH Event functions - - -/* -* Process the crews of vehicles. This "thread" will run just -* before PostInit and the mission init.sqf is processed. The order of execution is -* -* 1) all config.cpp init EHs (including all Extended_Init_Eventhandlers) -* 2) all the init lines in the mission.sqm -* 3) spawn:ed "threads" are started -* 4) the mission's init.sqf/sqs is run -*/ - -GVAR(init_obj) = SLX_XEH_DUMMY createVehicleLocal [0, 0, 0]; -GVAR(init_obj) addEventHandler ["killed", { - #ifdef DEBUG_MODE_FULL - XEH_LOG("XEH: VehicleCrewInit: "+str(count vehicles)); - #endif - - { - _sim = getText(configFile/"CfgVehicles"/(typeOf _x)/"simulation"); - _crew = crew _x; - /* - * If it's a vehicle then start event handlers for the crew. - * (Vehicles have crew and are neither humanoids nor game logics) - */ - if (count _crew > 0 && {{ _sim == _x }count["soldier", "invisible"] == 0}) then { - { if !(_x in SLX_XEH_INIT_MEN) then { [_x] call SLX_XEH_EH_Init } } forEach _crew; - }; - } forEach vehicles; - SLX_XEH_INIT_MEN = nil; - - deleteVehicle GVAR(init_obj);GVAR(init_obj) = nil -}]; - -GVAR(init_obj) setDamage 1; // Schedule to run itsy bitsy later - -// Prepare postInit -GVAR(init_obj2) = SLX_XEH_DUMMY createVehicleLocal [0, 0, 0]; -GVAR(init_obj2) addEventHandler ["killed", { - call COMPILE_FILE(init_post); - deleteVehicle GVAR(init_obj2);GVAR(init_obj2) = nil; -}]; - -// Schedule PostInit -SLX_XEH_STR spawn { - // Warn if PostInit takes longer than 10 tickTime seconds - SLX_XEH_STR spawn { - private["_time2Wait"]; - _time2Wait = diag_ticktime + 10; - waituntil {diag_ticktime > _time2Wait}; - if !(SLX_XEH_MACHINE select 8) then { - XEH_LOG("WARNING: PostInit did not finish in a timely fashion"); - waitUntil {time > 0}; - // Consider there will be no player if neither PostInit-Ready, nor PlayerCheck-Ready - if !(SLX_XEH_MACHINE select 8 || {SLX_XEH_MACHINE select 5}) then { SLX_XEH_MACHINE set [13, true]; }; - }; - }; - - // On Server + Non JIP Client, we are now after all objects have inited - // and at the briefing, still time == 0 - if (isNull player) then { - #ifdef DEBUG_MODE_FULL - "NULL PLAYER" call SLX_XEH_LOG; - #endif - if !((SLX_XEH_MACHINE select 4) || {(SLX_XEH_MACHINE select 6)}) then { // only if MultiPlayer and not dedicated - #ifdef DEBUG_MODE_FULL - "JIP" call SLX_XEH_LOG; - #endif - - // TEST for weird jip-is-server-issue :S - if (!(SLX_XEH_MACHINE select 2) || {SLX_XEH_MACHINE select 3} || {SLX_XEH_MACHINE select 4}) then { - str(["WARNING: JIP Client, yet wrong detection", SLX_XEH_MACHINE]) call SLX_XEH_LOG; - SLX_XEH_MACHINE set [2, true]; // set Dedicated client - SLX_XEH_MACHINE set [3, false]; // set server - SLX_XEH_MACHINE set [4, false]; // set dedicatedserver - }; - waitUntil { !(isNull player) || {SLX_XEH_MACHINE select 13} }; - if (SLX_XEH_MACHINE select 13) then { XEH_LOG("WARNING: TimedOut waiting for player object to be ready. Continueing PostInit without Player ready") }; - }; - }; - - if !(isNull player) then { - if (isNull (group player) && {player isKindOf "CAManBase"}) then { - // DEBUG TEST: Crashing due to JIP, or when going from briefing - // into game - #ifdef DEBUG_MODE_FULL - "NULLGROUP" call SLX_XEH_LOG; - #endif - waitUntil { !(isNull (group player)) }; - }; - waitUntil { local player }; - }; - - // set JIP - SLX_XEH_MACHINE set [1, !isDedicated && getClientState in ["BRIEFING SHOWN","BRIEFING READ","GAME FINISHED","DEBRIEFING READ"]]; - - GVAR(init_obj2) setDamage 1; // Schedule to run itsy bitsy later - - SLX_XEH_MACHINE set [5, true]; // set player check = complete -}; - -// Load and call any "pre-init", run-once event handlers -/* - Compile code strings in the Extended_PreInit_EventHandlers class and call - them. This is done once per mission and before any extended init event - handler code is run. An addon maker can put run-once initialisation code - in such a pre-init "EH" rather than in a normal XEH init EH which might be - called several times. -*/ -{ (_x/SLX_XEH_STR_PreInit) call FUNC(init_once) } forEach SLX_XEH_CONFIG_FILES; - -private "_s"; -// Normally, full caching is enabled. If not, log an informative message. -_s = if (SLX_XEH_RECOMPILE || CBA_COMPILE_RECOMPILE || CBA_FUNC_RECOMPILE) then { - PFORMAT_3(" CACHE DISABLED? (Disable caching with cba_cache_disable.pbo)",SLX_XEH_RECOMPILE,CBA_COMPILE_RECOMPILE,CBA_FUNC_RECOMPILE) -} else { - "" -}; -XEH_LOG("XEH: PreInit Finished." + _s); diff --git a/tools/cba/addons/xeh/script_xeh.hpp b/tools/cba/addons/xeh/script_xeh.hpp index 4f242b492e..82fb724c03 100644 --- a/tools/cba/addons/xeh/script_xeh.hpp +++ b/tools/cba/addons/xeh/script_xeh.hpp @@ -8,103 +8,88 @@ // MACRO: EXTENDED_EVENTHANDLERS // Add all XEH event handlers ///////////////////////////////////////////////////////////////////////////////// -#define EXTENDED_EVENTHANDLERS init = "_this call SLX_XEH_EH_Init"; \ -fired = "_this call SLX_XEH_EH_Fired"; \ -animChanged = "_this call SLX_XEH_EH_AnimChanged"; \ -animDone = "_this call SLX_XEH_EH_AnimDone"; \ -animStateChanged = "_this call SLX_XEH_EH_AnimStateChanged"; \ -containerClosed = "_this call SLX_XEH_EH_ContainerClosed"; \ -containerOpened = "_this call SLX_XEH_EH_ContainerOpened"; \ -controlsShifted = "_this call SLX_XEH_EH_ControlsShifted"; \ -dammaged = "_this call SLX_XEH_EH_Dammaged"; \ -engine = "_this call SLX_XEH_EH_Engine"; \ -epeContact = "_this call SLX_XEH_EH_EpeContact"; \ -epeContactEnd = "_this call SLX_XEH_EH_EpeContactEnd"; \ -epeContactStart = "_this call SLX_XEH_EH_EpeContactStart"; \ -explosion = "_this call SLX_XEH_EH_Explosion"; \ -firedNear = "_this call SLX_XEH_EH_FiredNear"; \ -fuel = "_this call SLX_XEH_EH_Fuel"; \ -gear = "_this call SLX_XEH_EH_Gear"; \ -getIn = "_this call SLX_XEH_EH_GetIn"; \ -getOut = "_this call SLX_XEH_EH_GetOut"; \ -handleHeal = "_this call SLX_XEH_EH_HandleHeal"; \ -hit = "_this call SLX_XEH_EH_Hit"; \ -hitPart = "_this call SLX_XEH_EH_HitPart"; \ -incomingMissile = "_this call SLX_XEH_EH_IncomingMissile"; \ -inventoryClosed = "_this call SLX_XEH_EH_InventoryClosed"; \ -inventoryOpened = "_this call SLX_XEH_EH_InventoryOpened"; \ -killed = "_this call SLX_XEH_EH_Killed"; \ -landedTouchDown = "_this call SLX_XEH_EH_LandedTouchDown"; \ -landedStopped = "_this call SLX_XEH_EH_LandedStopped"; \ -local = "_this call SLX_XEH_EH_Local"; \ -respawn = "_this call SLX_XEH_EH_Respawn"; \ -put = "_this call SLX_XEH_EH_Put"; \ -take = "_this call SLX_XEH_EH_Take"; \ -seatSwitched = "_this call SLX_XEH_EH_SeatSwitched"; \ -soundPlayed = "_this call SLX_XEH_EH_SoundPlayed"; \ -weaponAssembled = "_this call SLX_XEH_EH_WeaponAssembled"; \ -weaponDisAssembled = "_this call SLX_XEH_EH_WeaponDisassembled"; - -//handleDamage = "_this call SLX_XEH_EH_HandleDamage"; \ -//mpHit = "_this call SLX_XEH_EH_MPHit"; \ -//mpKilled = "_this call SLX_XEH_EH_MPKilled"; \ -//mpRespawn = "_this call SLX_XEH_EH_MPRespawn"; +#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"")"; \ +getOut = "{_this call _x} forEach ((_this select 0) getVariable ""cba_xeh_getOut"")"; \ +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"")"; \ +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"")"; /* MACRO: DELETE_EVENTHANDLERS - Removes all event handlers. - - Example: - (begin example) - class DefaultEventhandlers; - class Car_F; - class MRAP_01_base_F: Car_F { - class EventHandlers; - }; - class B_MRAP_01_F: MRAP_01_base_F { - class Eventhandlers: EventHandlers { - DELETE_EVENTHANDLERS - }; - }; - (end example) + Removes all event handlers. */ -#define DELETE_EVENTHANDLERS delete init; \ -delete fired; \ -delete animChanged; \ -delete animDone; \ -delete animStateChanged; \ -delete containerClosed; \ -delete containerOpened; \ -delete controlsShifted; \ -delete dammaged; \ -delete engine; \ -delete epeContact; \ -delete epeContactEnd; \ -delete epeContactStart; \ -delete explosion; \ -delete firedNear; \ -delete fuel; \ -delete gear; \ -delete getIn; \ -delete getOut; \ -delete handleHeal; \ -delete hit; \ -delete hitPart; \ -delete incomingMissile; \ -delete inventoryClosed; \ -delete inventoryOpened; \ -delete killed; \ -delete landedTouchDown; \ -delete landedStopped; \ -delete local; \ -delete respawn; \ -delete put; \ -delete take; \ -delete seatSwitched; \ -delete soundPlayed; \ -delete weaponAssembled; \ -delete weaponDisAssembled; +#define DELETE_EVENTHANDLERS init = ""; \ +fired = ""; \ +animChanged = ""; \ +animDone = ""; \ +animStateChanged = ""; \ +containerClosed = ""; \ +containerOpened = ""; \ +controlsShifted = ""; \ +dammaged = ""; \ +engine = ""; \ +epeContact = ""; \ +epeContactEnd = ""; \ +epeContactStart = ""; \ +explosion = ""; \ +firedNear = ""; \ +fuel = ""; \ +gear = ""; \ +getIn = ""; \ +getOut = ""; \ +handleHeal = ""; \ +hit = ""; \ +hitPart = ""; \ +incomingMissile = ""; \ +inventoryClosed = ""; \ +inventoryOpened = ""; \ +killed = ""; \ +landedTouchDown = ""; \ +landedStopped = ""; \ +local = ""; \ +respawn = ""; \ +put = ""; \ +take = ""; \ +seatSwitched = ""; \ +soundPlayed = ""; \ +weaponAssembled = ""; \ +weaponDisassembled = ""; \ +weaponDeployed = ""; \ +weaponRested = "";