ACE3/addons/zeus/XEH_postInit.sqf
Remco Speekenbrink 324bf68614 Add Zeus utility modules
- Add categories to zeus modules to group them based on their functionality
- Add new utility modules:
  1. Toggle simulation
  2. Update editable objects
- Clean up some of the zeus module code (standardise function headers, camel case, etc.)
2016-11-15 12:07:48 +00:00

40 lines
1.5 KiB
Plaintext

#include "script_component.hpp"
["ace_settingsInitialized",{
// Only add an InitPost EH if setting is enabled (and apply retroactively)
if (isServer && GVAR(autoAddObjects)) then {
["AllVehicles", "InitPost", FUNC(addObjectToCurator), true, [], true] call CBA_fnc_addClassEventHandler;
};
}] call CBA_fnc_addEventHandler;
// Global skill module PVs values for persistence, just listen for the PV
QGVAR(GlobalSkillAI) addPublicVariableEventHandler FUNC(moduleGlobalSetSkill);
[QGVAR(moduleDefendArea), CBA_fnc_taskDefend] call CBA_fnc_addEventHandler;
[QGVAR(modulePatrolArea), CBA_fnc_taskPatrol] call CBA_fnc_addEventHandler;
[QGVAR(moduleSearchNearby), CBA_fnc_searchNearby] call CBA_fnc_addEventHandler;
[QGVAR(moduleSearchArea), CBA_fnc_taskSearchArea] call CBA_fnc_addEventHandler;
// Editable object commands must be ran on server, this events are used in the respective module
if (isServer) then {
[QGVAR(addObjects), {
params ["_objects", ["_curator",objNull]];
if !(isNull _curator) exitWith { _curator addCuratorEditableObjects [_objects, true]; };
{
_x addCuratorEditableObjects [_objects, true];
} forEach allCurators;
}] call CBA_fnc_addEventHandler;
[QGVAR(removeObjects), {
params ["_objects", ["_curator",objNull]];
if !(isNull _curator) exitWith { _curator removeCuratorEditableObjects [_objects, true]; };
{
_x removeCuratorEditableObjects [_objects, true];
} forEach allCurators;
}] call CBA_fnc_addEventHandler;
};