Don't recompile XEH EH's before every call (#5728)

* Fix medical respawn/init

* Medical use CBA addClassEH

* Movement inventoryDisplayLoad

* Medical handleRespawn header typo

* Parachute handleRespawn

* Rearm and parachute handleRespawn

* concertina_wire handleInit

* Fix header

* use XEH function instead of config

* use XEH function instead of config

* remove unneeded init eh
This commit is contained in:
Dedmen Miller 2017-11-07 22:21:58 +01:00 committed by PabstMirror
parent a3e9879cec
commit bacb7d069b
18 changed files with 98 additions and 49 deletions

View File

@ -40,12 +40,12 @@ class Extended_Init_EventHandlers {
}; };
class ACE_ConcertinaWire { class ACE_ConcertinaWire {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_init)); init = QUOTE(call FUNC(handleInit));
}; };
}; };
class Land_Razorwire_F { class Land_Razorwire_F {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_init)); init = QUOTE(call FUNC(handleInit));
}; };
}; };
}; };

View File

@ -3,5 +3,6 @@ PREP(deploy);
PREP(dismount); PREP(dismount);
PREP(dismountSuccess); PREP(dismountSuccess);
PREP(handleDamage); PREP(handleDamage);
PREP(handleInit);
PREP(handleKilled); PREP(handleKilled);
PREP(vehicleDamage); PREP(vehicleDamage);

View File

@ -1,3 +0,0 @@
#include "script_component.hpp"
params ["_wire"];
_wire addEventHandler ["HandleDamage", {call FUNC(handleDamage)}];

View File

@ -0,0 +1,18 @@
/*
* Author: Rocko
* Handles wire Init
*
* Arguments:
* 0: wire <OBJECT>
*
* Return Value:
* None
*
* Example:
* [wire] call ace_concertina_wire_fnc_handleInit
*
* Public: No
*/
#include "script_component.hpp"
params ["_wire"];
_wire addEventHandler ["HandleDamage", {call FUNC(handleDamage)}];

View File

@ -16,40 +16,3 @@ class Extended_PostInit_EventHandlers {
init = QUOTE(call COMPILE_FILE(XEH_postInit)); init = QUOTE(call COMPILE_FILE(XEH_postInit));
}; };
}; };
class Extended_Init_EventHandlers {
class CAManBase {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_init));
};
};
class ACE_bodyBagObject {
class ADDON {
init = QUOTE(_this call DEFUNC(dragging,initObject));
};
};
};
class Extended_Respawn_EventHandlers {
class CAManBase {
class ADDON {
respawn = QUOTE(call COMPILE_FILE(XEH_respawn));
};
};
};
class Extended_Killed_EventHandlers {
class CAManBase {
class ADDON {
killed = QUOTE(call FUNC(handleKilled));
};
};
};
class Extended_Local_EventHandlers {
class CAManBase {
class ADDON {
local = QUOTE(call FUNC(handleLocal));
};
};
};

View File

@ -40,9 +40,11 @@ PREP(handleDamage_fractures);
PREP(handleDamage_internalInjuries); PREP(handleDamage_internalInjuries);
PREP(handleDamage_wounds); PREP(handleDamage_wounds);
PREP(handleDamage_woundsOld); PREP(handleDamage_woundsOld);
PREP(handleUnitVitals); PREP(handleInit);
PREP(handleKilled); PREP(handleKilled);
PREP(handleLocal); PREP(handleLocal);
PREP(handleRespawn);
PREP(handleUnitVitals);
PREP(handleBandageOpening); PREP(handleBandageOpening);
PREP(hasItem); PREP(hasItem);
PREP(hasItems); PREP(hasItems);

View File

@ -41,6 +41,11 @@ private _fixStatic = {
}; };
["StaticWeapon", "init", _fixStatic] call CBA_fnc_addClassEventHandler; ["StaticWeapon", "init", _fixStatic] call CBA_fnc_addClassEventHandler;
["Car", "init", _fixStatic] call CBA_fnc_addClassEventHandler; ["Car", "init", _fixStatic] call CBA_fnc_addClassEventHandler;
["CAManBase", "Init", FUNC(handleInit)] call CBA_fnc_addClassEventHandler;
["CAManBase", "Respawn", FUNC(handleRespawn)] call CBA_fnc_addClassEventHandler;
["CAManBase", "Killed", FUNC(handleKilled)] call CBA_fnc_addClassEventHandler;
["CAManBase", "Local", FUNC(handleLocal)] call CBA_fnc_addClassEventHandler;
addMissionEventHandler ["Loaded",{ addMissionEventHandler ["Loaded",{
{ {
TRACE_1("starting preload (save load)",_x); TRACE_1("starting preload (save load)",_x);

View File

@ -1,3 +1,18 @@
/*
* Author: KoffeinFlummi
* Called when a unit is initialized via XEH_init
*
* Arguments:
* 0: The Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [bob] call ACE_medical_fnc_handleInit
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit"]; params ["_unit"];

View File

@ -1,3 +1,18 @@
/*
* Author: KoffeinFlummi
* Called when a unit is Respawned
*
* Arguments:
* 0: The Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [bob] call ACE_medical_fnc_handleRespawn
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit"]; params ["_unit"];

View File

@ -19,6 +19,6 @@ class Extended_PostInit_EventHandlers {
class Extended_DisplayLoad_EventHandlers { class Extended_DisplayLoad_EventHandlers {
class RscDisplayInventory { class RscDisplayInventory {
ADDON = QUOTE(_this call COMPILE_FILE(XEH_inventoryDisplayLoad)); ADDON = QUOTE(_this call FUNC(inventoryDisplayLoad));
}; };
}; };

View File

@ -5,3 +5,4 @@ PREP(canClimb);
PREP(climb); PREP(climb);
PREP(handleClimb); PREP(handleClimb);
PREP(handleVirtualMass); PREP(handleVirtualMass);
PREP(inventoryDisplayLoad);

View File

@ -1,3 +1,18 @@
/*
* Author: commy2
* Executed every time an inventory display is opened.
*
* Arguments:
* 0: Inventory display <DISPLAY>
*
* Return Value:
* None
*
* Example:
* [DISPLAY] call ACE_movement_fnc_inventoryDisplayLoad
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
disableSerialization; disableSerialization;

View File

@ -20,7 +20,7 @@ class Extended_PostInit_EventHandlers {
class Extended_Respawn_EventHandlers { class Extended_Respawn_EventHandlers {
class CAManBase { class CAManBase {
class ADDON { class ADDON {
respawn = QUOTE(call COMPILE_FILE(XEH_respawn)); respawn = QUOTE(call FUNC(handleRespawn));
}; };
}; };
}; };

View File

@ -1,6 +1,7 @@
PREP(doLanding); PREP(doLanding);
PREP(handleInfoDisplayChanged); PREP(handleInfoDisplayChanged);
PREP(handleRespawn);
PREP(hideAltimeter); PREP(hideAltimeter);
PREP(onEachFrame); PREP(onEachFrame);
PREP(showAltimeter); PREP(showAltimeter);

View File

@ -9,7 +9,7 @@
* None * None
* *
* Example: * Example:
* None * call ace_parachute_fnc_handleRespawn
* *
* Public: No * Public: No
*/ */

View File

@ -28,7 +28,7 @@ class Extended_PostInit_EventHandlers {
class Extended_Respawn_EventHandlers { class Extended_Respawn_EventHandlers {
class CAManBase { class CAManBase {
class ADDON { class ADDON {
respawn = QUOTE(call COMPILE_FILE(XEH_respawn)); respawn = QUOTE(call FUNC(XEH_respawn));
}; };
}; };
}; };

View File

@ -19,6 +19,7 @@ PREP(getTurretConfigMagazines);
PREP(getTurretMagazineAmmo); PREP(getTurretMagazineAmmo);
PREP(grabAmmo); PREP(grabAmmo);
PREP(handleKilled); PREP(handleKilled);
PREP(handleRespawn);
PREP(handleUnconscious); PREP(handleUnconscious);
PREP(hasEnoughSupply); PREP(hasEnoughSupply);
PREP(initSupplyVehicle); PREP(initSupplyVehicle);

View File

@ -1,3 +1,18 @@
/*
* Author: unknown
* Called when a unit is Respawned
*
* Arguments:
* 0: The Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [bob] call ACE_rearm_fnc_handleRespawn
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit"]; params ["_unit"];